python拦截tcp数据包_socksmon 使用您的HTTP拦截代理监视任意TCP流量

socksmon

Monitor arbitrary TCP traffic using your HTTP interception proxy of choice

What is socksmon?

socksmon is a SOCKSv4 server based on Twisted, that tunnels incoming TCP traffic through an HTTP proxy. socksmon does this by starting an internal webserver on port 2357, posts the traffic to using the man in the middle proxy for editing it and then it forward it to the destination.

socksmon has preliminary support for SSL interception, meaning arbitrary ssl encrypted tcp traffic can be analyzed using your interception proxy of choice.

How do I use it?

First you need to create a certificate you would like to use with socksmon in PEM format and put it under /tmp/server.pem. If you use BURP, export the private key and the certificate and then concatenate them together. (e.g. cat server.crt server.key > /tmp/server.pem)

Second, start your interception proxy with port 8080 on localhost.

Third, send SOCKSv4 traffic to yourip:9050. Be sure to use SOCKSv4, SOCKSv5 won't work due to the Twisted SOCKS server implementation. For redirecting traffic I recommend Proxifier1 under Windows and Redsocks2 or Proxychains3 under Linux.

Todo

Patches / PRs are welcome.

Better SSL certificate generation

Currently no certificates are generated for specific endpoints, e.g. the specified key is used directly for all sites. This is problematic with clients that check the common name or the revocation list in the certificate.

Upstream proxy support

Upstream proxies should be supported for all traffic. HTTP should get special treatment, so proxies that disallow CONNECT can be used as well.

Command line options

Command line options should be used to set the proxy port, certificates and webserver ports.

Modular traffic modification framework

Implement a modular framework that allows processing of TCP traffic. It should be easy to implement decoders and re-encoders for different protocols and formats (e.g. deserialize Java object to XML).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值