mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-06 13:27:55 +08:00
[fix]
This commit is contained in:
parent
dd6daa5421
commit
0493c1ce5e
@ -32,4 +32,8 @@ public class InternalNetworkPermeateRealServer {
|
||||
* 访问端口
|
||||
*/
|
||||
private Integer visitorPort;
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
private Boolean isSsl;
|
||||
}
|
@ -5,6 +5,7 @@ import lombok.Setter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Deprecated
|
||||
@Setter
|
||||
@Getter
|
||||
public class NettyMsg {
|
||||
|
@ -14,7 +14,7 @@ import java.nio.charset.StandardCharsets;
|
||||
@Getter
|
||||
public class NettyProxyMsg {
|
||||
// body 长度 type 1 clientId 4 clientTargetIp 4 clientTargetPort 4 visitorPort 4 visitorId 4 data 4
|
||||
public static final int bodyLength = 1 + 4 + 4 + 4 + 4 + 4 + 4;
|
||||
public static final int bodyLength = 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4;
|
||||
|
||||
|
||||
/**
|
||||
@ -25,6 +25,13 @@ public class NettyProxyMsg {
|
||||
*/
|
||||
private byte type;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
* byte 长度 1
|
||||
* 1 true
|
||||
* 0 false
|
||||
*/
|
||||
private byte isSsl = 0;
|
||||
/**
|
||||
* 客户端ID
|
||||
* byte[] 长度 4
|
||||
@ -110,4 +117,23 @@ public class NettyProxyMsg {
|
||||
}
|
||||
|
||||
|
||||
public Boolean isSsl() {
|
||||
return isSsl == 1;
|
||||
}
|
||||
|
||||
public void isSsl(Boolean isSsl) {
|
||||
if (isSsl) {
|
||||
this.isSsl = 1;
|
||||
} else {
|
||||
this.isSsl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public byte getIsSsl() {
|
||||
return isSsl;
|
||||
}
|
||||
|
||||
public void setIsSsl(byte isSsl) {
|
||||
this.isSsl = isSsl;
|
||||
}
|
||||
}
|
@ -109,6 +109,8 @@ public class NettyProxyMsgDecoder extends LengthFieldBasedFrameDecoder {
|
||||
int bodyLength = in.readInt();
|
||||
byte type = in.readByte();
|
||||
nettyProxyMsg.setType(type);
|
||||
byte isSsl = in.readByte();
|
||||
nettyProxyMsg.setIsSsl(isSsl);
|
||||
|
||||
int clientIdLength = in.readInt();
|
||||
byte[] clientIdBytes = new byte[clientIdLength];
|
||||
|
@ -23,6 +23,7 @@ public class NettyProxyMsgEncoder extends MessageToByteEncoder<NettyProxyMsg> {
|
||||
// body 长度 type 1 clientId 4 clientTargetIp 4 clientTargetPort 4 visitorPort 4 visitorId 4 data 4
|
||||
int bodyLength = NettyProxyMsg.bodyLength;
|
||||
byte typeBytes = msg.getType();
|
||||
byte isSsl = msg.getIsSsl();
|
||||
byte[] clientIdBytes = msg.getClientId();
|
||||
byte[] clientTargetIpBytes = msg.getClientTargetIp();
|
||||
byte[] clientTargetPortBytes = msg.getClientTargetPort();
|
||||
@ -30,7 +31,6 @@ public class NettyProxyMsgEncoder extends MessageToByteEncoder<NettyProxyMsg> {
|
||||
byte[] visitorIdBytes = msg.getVisitorId();
|
||||
byte[] msgDataBytes = msg.getData();
|
||||
|
||||
|
||||
if (clientIdBytes != null) {
|
||||
bodyLength += clientIdBytes.length;
|
||||
}
|
||||
@ -54,6 +54,7 @@ public class NettyProxyMsgEncoder extends MessageToByteEncoder<NettyProxyMsg> {
|
||||
out.writeInt(bodyLength);
|
||||
|
||||
out.writeByte(typeBytes);
|
||||
out.writeByte(isSsl);
|
||||
|
||||
// 防止数据读错位置 clientId
|
||||
if (clientIdBytes != null) {
|
||||
|
@ -19,6 +19,10 @@ public class InitServerPermeateSocket implements CommandLineRunner {
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
lazyInternalNetworkServerPermeateMappingApplication.initPermeateSocket();
|
||||
try {
|
||||
lazyInternalNetworkServerPermeateMappingApplication.initPermeateSocket();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
package org.framework.lazy.cloud.network.heartbeat.server.netty.filter;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.socket.SocketChannel;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.decoder.TransferDecoder;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.encoder.TransferEncoder;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.filter.DebugChannelInitializer;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.handler.PermeateClientRealHandler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.handler.NettyServerPermeateServerRealHandler;
|
||||
|
||||
public class PermeateClientRealFilter extends DebugChannelInitializer<SocketChannel> {
|
||||
public class NettyServerPermeateServerRealFilter extends DebugChannelInitializer<SocketChannel> {
|
||||
/**
|
||||
* This method will be called once the {@link Channel} was registered. After the method returns this instance
|
||||
* will be removed from the {@link ChannelPipeline} of the {@link Channel}.
|
||||
@ -17,10 +18,18 @@ public class PermeateClientRealFilter extends DebugChannelInitializer<SocketChan
|
||||
@Override
|
||||
protected void initChannel0(SocketChannel ch) {
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
// // 适配https
|
||||
// try {
|
||||
// SslContext sslContext = SslContextBuilder.forClient()
|
||||
// .trustManager(InsecureTrustManagerFactory.INSTANCE).build();
|
||||
// ch.pipeline().addLast(sslContext.newHandler(ch.alloc(), "https://juno.shuhan-juno.com", 443));
|
||||
// } catch (SSLException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// 解码、编码
|
||||
pipeline.addLast(new TransferDecoder(Integer.MAX_VALUE, 1024 * 1024*10));
|
||||
pipeline.addLast(new TransferEncoder());
|
||||
pipeline.addLast(new PermeateClientRealHandler());
|
||||
pipeline.addLast(new NettyServerPermeateServerRealHandler());
|
||||
|
||||
}
|
||||
}
|
@ -8,13 +8,13 @@ import io.netty.channel.socket.SocketChannel;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.InternalNetworkPermeateRealServer;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelFlowAdapter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.filter.DebugChannelInitializer;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.handler.PermeateVisitorHandler;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.handler.NettyServerPermeateServerVisitorHandler;
|
||||
|
||||
public class PermeateVisitorFilter extends DebugChannelInitializer<SocketChannel> {
|
||||
public class NettyServerPermeateServerVisitorFilter extends DebugChannelInitializer<SocketChannel> {
|
||||
private final InternalNetworkPermeateRealServer internalNetworkPermeateRealServer;
|
||||
private final ChannelFlowAdapter channelFlowAdapter;
|
||||
|
||||
public PermeateVisitorFilter(InternalNetworkPermeateRealServer internalNetworkPermeateRealServer, ChannelFlowAdapter channelFlowAdapter) {
|
||||
public NettyServerPermeateServerVisitorFilter(InternalNetworkPermeateRealServer internalNetworkPermeateRealServer, ChannelFlowAdapter channelFlowAdapter) {
|
||||
this.internalNetworkPermeateRealServer = internalNetworkPermeateRealServer;
|
||||
this.channelFlowAdapter = channelFlowAdapter;
|
||||
}
|
||||
@ -32,6 +32,6 @@ public class PermeateVisitorFilter extends DebugChannelInitializer<SocketChannel
|
||||
protected void initChannel0(SocketChannel ch) throws Exception {
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
pipeline.addLast(new ChannelDuplexHandler());
|
||||
pipeline.addLast(new PermeateVisitorHandler(internalNetworkPermeateRealServer, channelFlowAdapter));
|
||||
pipeline.addLast(new NettyServerPermeateServerVisitorHandler(internalNetworkPermeateRealServer, channelFlowAdapter));
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeK
|
||||
* 来自客户端 真实服务器返回的数据请求
|
||||
*/
|
||||
@Slf4j
|
||||
public class PermeateClientRealHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
|
||||
public class NettyServerPermeateServerRealHandler extends SimpleChannelInboundHandler<NettyByteBuf> {
|
||||
|
||||
@Override
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
@ -17,12 +17,12 @@ import org.framework.lazy.cloud.network.heartbeat.server.netty.socket.NettyServe
|
||||
import java.util.UUID;
|
||||
|
||||
@Slf4j
|
||||
public class PermeateVisitorHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
||||
public class NettyServerPermeateServerVisitorHandler extends SimpleChannelInboundHandler<ByteBuf> {
|
||||
private final InternalNetworkPermeateRealServer internalNetworkPermeateRealServer;
|
||||
private final ChannelFlowAdapter channelFlowAdapter;// 流量适配器
|
||||
// private final NettyChannelPool nettyChannelPool = new DefaultNettyChannelPool(10);
|
||||
|
||||
public PermeateVisitorHandler(InternalNetworkPermeateRealServer internalNetworkPermeateRealServer, ChannelFlowAdapter channelFlowAdapter) {
|
||||
public NettyServerPermeateServerVisitorHandler(InternalNetworkPermeateRealServer internalNetworkPermeateRealServer, ChannelFlowAdapter channelFlowAdapter) {
|
||||
this.internalNetworkPermeateRealServer = internalNetworkPermeateRealServer;
|
||||
this.channelFlowAdapter = channelFlowAdapter;
|
||||
}
|
@ -8,7 +8,7 @@ import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.InternalNetworkPermeateRealServer;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.filter.PermeateClientRealFilter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.filter.NettyServerPermeateServerRealFilter;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -50,7 +50,7 @@ public class NettyServerPermeateServerConnectRealSocket {
|
||||
// .option(ChannelOption.SO_BACKLOG, 128)//务端接受连接的队列长度 默认128
|
||||
// .option(ChannelOption.RCVBUF_ALLOCATOR, new NettyRecvByteBufAllocator(1024 * 1024))//用于Channel分配接受Buffer的分配器 默认AdaptiveRecvByteBufAllocator.DEFAULT
|
||||
.option(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(1024 * 1024, 1024 * 1024 * 2))
|
||||
.handler(new PermeateClientRealFilter())
|
||||
.handler(new NettyServerPermeateServerRealFilter())
|
||||
|
||||
;
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.framework.lazy.cloud.network.heartbeat.common.InternalNetworkPermeate
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.NettyPermeateVisitorContext;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.NettyVisitorPortContext;
|
||||
import org.framework.lazy.cloud.network.heartbeat.common.adapter.ChannelFlowAdapter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.filter.PermeateVisitorFilter;
|
||||
import org.framework.lazy.cloud.network.heartbeat.server.netty.filter.NettyServerPermeateServerVisitorFilter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -22,19 +22,16 @@ import java.io.IOException;
|
||||
public class NettyServerPermeateServerConnectVisitorSocket {
|
||||
private final EventLoopGroup bossGroup = new NioEventLoopGroup();
|
||||
private final EventLoopGroup workerGroup = new NioEventLoopGroup();
|
||||
private final PermeateVisitorFilter permeateVisitorFilter;
|
||||
private final NettyServerPermeateServerVisitorFilter nettyServerPermeateServerVisitorFilter;
|
||||
|
||||
@Getter
|
||||
private final int visitorPort;
|
||||
|
||||
private final InternalNetworkPermeateRealServer internalNetworkPermeateRealServer;
|
||||
|
||||
public NettyServerPermeateServerConnectVisitorSocket(PermeateVisitorFilter permeateVisitorFilter,
|
||||
InternalNetworkPermeateRealServer internalNetworkPermeateRealServer,
|
||||
public NettyServerPermeateServerConnectVisitorSocket(NettyServerPermeateServerVisitorFilter nettyServerPermeateServerVisitorFilter,
|
||||
int visitorPort) {
|
||||
this.permeateVisitorFilter = permeateVisitorFilter;
|
||||
this.nettyServerPermeateServerVisitorFilter = nettyServerPermeateServerVisitorFilter;
|
||||
this.visitorPort = visitorPort;
|
||||
this.internalNetworkPermeateRealServer = internalNetworkPermeateRealServer;
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +63,7 @@ public class NettyServerPermeateServerConnectVisitorSocket {
|
||||
.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK, new WriteBufferWaterMark(1024 * 1024, 1024 * 1024 * 2))
|
||||
|
||||
|
||||
.childHandler(permeateVisitorFilter);
|
||||
.childHandler(nettyServerPermeateServerVisitorFilter);
|
||||
ChannelFuture sync = bootstrap.bind(visitorPort).sync();
|
||||
sync.addListener((ChannelFutureListener) future -> {
|
||||
if (future.isSuccess()) {
|
||||
@ -122,10 +119,11 @@ public class NettyServerPermeateServerConnectVisitorSocket {
|
||||
* 访问端口
|
||||
*/
|
||||
private Integer permeateVisitorPort;
|
||||
|
||||
/**
|
||||
* 访客ID
|
||||
* 是否是ssl
|
||||
*/
|
||||
private String visitorId;
|
||||
private Boolean isSsl;
|
||||
|
||||
/**
|
||||
* 流量适配器
|
||||
@ -179,6 +177,16 @@ public class NettyServerPermeateServerConnectVisitorSocket {
|
||||
this.channelFlowAdapter = channelFlowAdapter;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* 是否是ssl
|
||||
*
|
||||
* @param isSsl 是否是ssl
|
||||
* @return 当前对象
|
||||
*/
|
||||
public NettyPermeateVisitorSocketBuilder builderIsSsl(Boolean isSsl) {
|
||||
this.isSsl = isSsl;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public NettyServerPermeateServerConnectVisitorSocket build() {
|
||||
@ -197,10 +205,11 @@ public class NettyServerPermeateServerConnectVisitorSocket {
|
||||
.clientTargetIp(clientTargetIp)
|
||||
.clientTargetPort(clientTargetPort)
|
||||
.visitorPort(permeateVisitorPort)
|
||||
.isSsl(isSsl)
|
||||
.build();
|
||||
|
||||
PermeateVisitorFilter permeateVisitorFilter = new PermeateVisitorFilter(internalNetworkPermeateRealServer, channelFlowAdapter);
|
||||
return new NettyServerPermeateServerConnectVisitorSocket(permeateVisitorFilter, internalNetworkPermeateRealServer, permeateVisitorPort);
|
||||
NettyServerPermeateServerVisitorFilter nettyServerPermeateServerVisitorFilter = new NettyServerPermeateServerVisitorFilter(internalNetworkPermeateRealServer, channelFlowAdapter);
|
||||
return new NettyServerPermeateServerConnectVisitorSocket(nettyServerPermeateServerVisitorFilter, permeateVisitorPort);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,4 +56,10 @@ public class LazyInternalNetworkPenetrationMappingStoryCommand {
|
||||
*/
|
||||
@Schema(description = "服务端ID", name = "serverId", example = "")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -61,4 +61,10 @@ public class LazyInternalNetworkPenetrationMappingUpdateCommand {
|
||||
*/
|
||||
@Schema(description = "服务端ID", name = "serverId", example = "")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -98,4 +98,11 @@ public class LazyInternalNetworkClientPermeateClientMappingStoryCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
@ -98,4 +98,10 @@ public class LazyInternalNetworkClientPermeateClientMappingUpdateCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
@ -91,4 +91,9 @@ public class LazyInternalNetworkClientPermeateServerMappingStoryCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -91,4 +91,9 @@ public class LazyInternalNetworkClientPermeateServerMappingUpdateCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -84,4 +84,9 @@ public class LazyInternalNetworkServerPermeateMappingStoryCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -84,4 +84,9 @@ public class LazyInternalNetworkServerPermeateMappingUpdateCommand {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -98,4 +98,9 @@ public class LazyInternalNetworkClientPermeateClientMappingDTO {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -91,4 +91,9 @@ public class LazyInternalNetworkClientPermeateServerMappingDTO {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -79,4 +79,10 @@ public class LazyInternalNetworkPenetrationMappingDTO {
|
||||
*/
|
||||
@Schema(description = "服务端ID", name = "serverId", example = "")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -84,4 +84,9 @@ public class LazyInternalNetworkServerPermeateMappingDTO {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -59,7 +59,8 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
String permeateTargetIp = lazyInternalNetworkServerPermeateMapping.getPermeateTargetIp();
|
||||
Integer permeateTargetPort = lazyInternalNetworkServerPermeateMapping.getPermeateTargetPort();
|
||||
Integer visitorPort = lazyInternalNetworkServerPermeateMapping.getVisitorPort();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
Boolean isSsl = lazyInternalNetworkServerPermeateMapping.getIsSsl();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort,isSsl);
|
||||
return lazyInternalNetworkServerPermeateMappingRepository.story(lazyInternalNetworkServerPermeateMapping);
|
||||
}
|
||||
|
||||
@ -82,7 +83,8 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
String permeateTargetIp = lazyInternalNetworkServerPermeateMapping.getPermeateTargetIp();
|
||||
Integer permeateTargetPort = lazyInternalNetworkServerPermeateMapping.getPermeateTargetPort();
|
||||
Integer visitorPort = lazyInternalNetworkServerPermeateMapping.getVisitorPort();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
Boolean isSsl = lazyInternalNetworkServerPermeateMapping.getIsSsl();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort,isSsl);
|
||||
}
|
||||
return lazyInternalNetworkServerPermeateMappingRepository.batchStory(lazyInternalNetworkServerPermeateMappingList);
|
||||
}
|
||||
@ -105,7 +107,8 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
String permeateTargetIp = lazyInternalNetworkServerPermeateMapping.getPermeateTargetIp();
|
||||
Integer permeateTargetPort = lazyInternalNetworkServerPermeateMapping.getPermeateTargetPort();
|
||||
Integer visitorPort = lazyInternalNetworkServerPermeateMapping.getVisitorPort();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
Boolean isSsl = lazyInternalNetworkServerPermeateMapping.getIsSsl();
|
||||
this.changePermeateSocket(permeateTargetIp, permeateTargetPort, visitorPort,isSsl);
|
||||
return lazyInternalNetworkServerPermeateMappingRepository.story(lazyInternalNetworkServerPermeateMapping);
|
||||
}
|
||||
|
||||
@ -189,8 +192,9 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
String permeateTargetIp = internalNetworkServerPermeateMapping.getPermeateTargetIp();
|
||||
Integer permeateTargetPort = internalNetworkServerPermeateMapping.getPermeateTargetPort();
|
||||
Integer visitorPort = internalNetworkServerPermeateMapping.getVisitorPort();
|
||||
Boolean isSsl = internalNetworkServerPermeateMapping.getIsSsl();
|
||||
log.info("init permeate socket ip:{}, port:{},visitorPort:{}", permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
this.createPermeateVisitor(permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
this.createPermeateVisitor(permeateTargetIp, permeateTargetPort, visitorPort,isSsl);
|
||||
}
|
||||
});
|
||||
|
||||
@ -203,11 +207,11 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
* @param permeateTargetPort 客户端莫表端口
|
||||
* @param visitorPort 访客端口
|
||||
*/
|
||||
private void changePermeateSocket(String permeateTargetIp, Integer permeateTargetPort, Integer visitorPort) {
|
||||
private void changePermeateSocket(String permeateTargetIp, Integer permeateTargetPort, Integer visitorPort, Boolean isSsl) {
|
||||
// 删除 客户端映射
|
||||
this.closePermeateSocket(visitorPort);
|
||||
// 更新 客户端映射
|
||||
createPermeateVisitor(permeateTargetIp, permeateTargetPort, visitorPort);
|
||||
createPermeateVisitor(permeateTargetIp, permeateTargetPort, visitorPort,isSsl);
|
||||
}
|
||||
|
||||
|
||||
@ -236,13 +240,14 @@ public class LazyInternalNetworkServerPermeateMappingApplicationImpl implements
|
||||
* @param permeateTargetPort 客户端目标端口
|
||||
* @param visitorPort 访客端口
|
||||
*/
|
||||
private void createPermeateVisitor(String permeateTargetIp, Integer permeateTargetPort, Integer visitorPort) {
|
||||
private void createPermeateVisitor(String permeateTargetIp, Integer permeateTargetPort, Integer visitorPort, Boolean isSsl) {
|
||||
// 更新 客户端映射
|
||||
NettyServerPermeateServerConnectVisitorSocket nettyServerPermeateServerConnectVisitorSocket = NettyServerPermeateServerConnectVisitorSocket.NettyPermeateVisitorSocketBuilder
|
||||
.builder()
|
||||
.builderClientTargetIp(permeateTargetIp)
|
||||
.builderClientTargetPort(permeateTargetPort)
|
||||
.builderVisitorPort(visitorPort)
|
||||
.builderIsSsl(isSsl)
|
||||
.builderChannelFlowAdapter(channelFlowAdapter)
|
||||
.build();
|
||||
try {
|
||||
|
@ -79,4 +79,11 @@ public class LazyInternalNetworkPenetrationMapping {
|
||||
@Schema(description = "服务端ID", name = "serverId", example = "")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
|
||||
}
|
@ -3,6 +3,8 @@ package org.framework.lazy.cloud.network.heartbeat.server.standalone.domain.mode
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.lang.String;
|
||||
import java.lang.Long;
|
||||
@ -97,5 +99,10 @@ public class LazyInternalNetworkClientPermeateClientMapping {
|
||||
*/
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
@ -90,5 +90,10 @@ public class LazyInternalNetworkClientPermeateServerMapping {
|
||||
*/
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
@ -84,4 +84,10 @@ public class LazyInternalNetworkServerPermeateMapping {
|
||||
@Schema(description ="渗透端口",name ="visitorPort",example = "")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
@ -110,5 +110,10 @@ public class LazyInternalNetworkClientPermeateClientMappingDO {
|
||||
@LazyTableField(name="update_time",comment="",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
@LazyTableField(name="is_ssl",comment="是否是ssl",defaultValue = "'0'")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -110,4 +110,10 @@ public class LazyInternalNetworkClientPermeateServerMappingDO {
|
||||
@LazyTableFieldUnique(name="visitor_port",comment="渗透端口",notNull=true,columnType="int")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
@LazyTableField(name="is_ssl",comment="是否是ssl",defaultValue = "'0'")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -91,4 +91,10 @@ public class LazyInternalNetworkPenetrationMappingDO {
|
||||
@Schema(description = "服务端ID", name = "serverId", example = "")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
@LazyTableField(name="is_ssl",comment="是否是ssl",defaultValue = "'0'")
|
||||
private Boolean isSsl;
|
||||
}
|
@ -102,4 +102,11 @@ public class LazyInternalNetworkServerPermeateMappingDO {
|
||||
@LazyTableFieldUnique(name="visitor_port",comment="渗透端口",notNull=true,columnType="int")
|
||||
private Integer visitorPort;
|
||||
|
||||
/**
|
||||
* 是否是ssl
|
||||
*/
|
||||
@Schema(description ="是否是ssl",name ="is_ssl",example = "")
|
||||
@LazyTableField(name="is_ssl",comment="是否是ssl",defaultValue = "'0'")
|
||||
private Boolean isSsl;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user