1. 前言
我们要实现的是外界访问80端口,根据协议不同的到的响应就不一样,使用的协议可以是socks也可以是http。
2. 实现
2.1 开启http服务
python -m http.server 80
2.2 开启socks服务
frsocks_windows_386.exe -sockstype fsocks -listen 9999
2.3 通过protoplex实现端口复用
下面命令的意思是,监听192.168.171.135:4444,如果是socks5协议的流量就将流量转发给192.168.171.135:9999,如果是http流量,就将流量转发给192.168.171.135:80
protoplex_windows_386 --socks5 192.168.171.135:9999 --http 192.168.171.135:80 -b 192.168.171.135:4444
到了这一步我们可以实现4444端口的端口复用,但我们本来是想实现80端口的,因此还需一步端口转发。
2.4 最后一步端口转发
此步骤需要管理员权限
此步骤需要管理员权限
此步骤需要管理员权限
将80端口的流量重定向到4444端口:
netsh advfirewall set currentprofile state off
netsh interface portproxy add v4tov4 listenport=80 listenaddress=192.168.171.135 connectport=4444 connectaddress=192.168.171.135 protocol=tcp
netsh interface portproxy show all
#删除刚才的规则
netsh interface portproxy delete v4tov4 listenport=80 listenaddress=192.168.171.135
2.5 最终效果
socks代理也可使用
参考文章
https://blog.csdn.net/weixin_39717029/article/details/111266559