tomcat白名单(七)方案三,随机数侵入

1 搜集

1.1 https://blog.csdn.net/SkyChaserYu/article/details/105840504

TLS1.3 抓包分析

Random,随机数,是由安全随机数生成器生成的32个字节。

 

1.2 https://blog.csdn.net/lcl088005/article/details/84883839

日记 - 两种HTTPS请求,以及私钥和证书的生成 手写ssl客户端

 

2 切入

跟踪路径:

javax.net.ssl|DEBUG|01|main|2023-10-23 16:18:35.326 CST|ClientHello.java:642|Produced ClientHello handshake message 

 

 

 

服务端:

客户端:

 

32个字节,前两个为0,则认定为proxy流量,否则认定为原流量,第3个字节做索引,可以提供8位2进制256个通道

 

 3 测试

3.1 本地

 

 

3.2 openshift

 

 

3.3 完整测试httpproxy,访问已经开白名单的id,通过

 

 

4 mac本地

4.1  11 vs 8

 

 

mac的1.8里面,前4位被征用了

 

4.2

4.2.1 启动20000-》带起30000

4.2.2 启动8081, http

4.2.3 启动client,

//-Djavax.net.debug=all
public class NettyHttpClientForRandom {

static int index = 99; // dev white 用13可以在本地测到uat scef,用12可以在线上测到dev scef 404
// 用99本地可以测到 20000-30000tcp 30000-8081http

private static String getHostPort() {
if (false)
return "https://instance-monitoring.apps.namicggtd39d.ecs.dyn.nsroot.net:443/scef/react_index.html?app=SCEFApplication&sm_user=hb90398";


// step1 30000
// step2 20000 index 99
return "https://localhost:20000/scef/react_index.html?app=SCEFApplication&sm_user=hb90398";
}

4.2.4 chrom访问https://localhost:20000,出现与http://localhost:8081一样界面

 

5 连接的关闭


透明代理因为没有解码的概念,不能定义解码完成继而关闭连接,但是可以设置idle,最简单的还是由客户端接受完response后close,中继在客户端inactive时close target的连接

本次程序必须使用短连接,如果要使用长连接则要求客户端连接与target绑定

明文代理可以在FullHttpResponse发送给客户端后回调中关闭向客户端与向target的连接

我没这么做,只是监控了client、target两端的inactive

            response.headers().add("test","from proxy");
ChannelFuture future = clientChannel.writeAndFlush(response);
// future.addListener(new ChannelFutureListener() {
// @Override
// public void operationComplete(ChannelFuture future) throws Exception {
// ctx.close();
// clientChannel.close();
// }
// });

 

http代理服务器(十二)httpclient close

 

以下是没关客户端的后果

 

 

 

6 记事表

6.1 8u访问 20231101

8u部署透明https代理

httpclient setproxy

 

6.2 邮件 20231103

could部署socks5代理

java mail设置参数或非java mail的发邮件工具设置系统参数

 

6.3 ssh 20231106

8u部署sockes代理

客户端

com.jcraft.jsch.Session session
session.setProxy(new com.jcraft.jsch.ProxySOCKS5(sshServer.getProxyHost(), sshServer.getProxyPort()));

 

6.4 senerium chrom测试 20231106

8u部署透明https代理

windows设置1999 https透明代理,利用chrome一打开即继承windows代理的特性

 

posted on 2023-10-23 00:19  silyvin  阅读(30)  评论(0编辑  收藏  举报