TREVORproxy SSH 代理演示
TREVORproxy 子网代理演示
常见用例
- WAF绕过
- 密码喷洒
- 网页抓取
工作原理
TREVORproxy 有两种操作模式:子网代理和SSH 代理:
- 子网代理模式使用Linux 内核的AnyIP功能为您的网络接口分配整个子网,并为每个连接提供来自该子网的随机源 IP 地址。
- 例如,如果您的云提供商为您提供了IPv6 范围,您可以从超过十八千万亿(18,446,744,073,709,551,616)个唯一 IP 地址/64发送流量。
- SSH 代理模式iptables与 SSH 的 SOCKS 代理功能 ( ssh -D) 相结合,通过远程系统(云虚拟机等)循环数据包
注意:TREVORproxy 并非 DoS 攻击工具,因为它不会“欺骗”数据包。它是一个功能齐全的 SOCKS 代理,这意味着它被设计用于接收返回流量。
示例 #1 - 从 IPv6 子网内的随机地址发送流量
- 注意:在subnet模式下,trevorproxy必须以 root 身份运行
- 注意:这必须是一个合法的子网,例如,您的云提供商分配给您的 IPv6 范围。
# Start TREVORproxy$ sudo trevorproxy subnet -s dead:beef::0/64 -i eth0[DEBUG] ip route add local dead:beef::0/64 dev eth0[INFO] Listening on socks5://127.0.0.1:1080# Test SOCKS proxy# Note that each request has a different source IP address$ curl --proxy socks5://127.0.0.1:1080 -6 api64.ipify.orgdead:beef::74d0:b1be:3166:c934$ curl --proxy socks5://127.0.0.1:1080 -6 api64.ipify.orgdead:beef::4927:1b4:8e5f:d44d$ curl --proxy socks5://127.0.0.1:1080 -6 api64.ipify.orgdead:beef::2bb8:7b79:706e:cb7d$ curl --proxy socks5://127.0.0.1:1080 -6 api64.ipify.orgdead:beef::7e13:abe3:dc24:5a00
示例 #2 - 通过 SSH 隧道发送流量
# Configure proxychains$ cat /etc/proxychains.conf...socks5 127.0.0.11080...# Start TREVORproxy$ trevorproxy ssh [email protected] [email protected][DEBUG] Opening SSH connection to [email protected][DEBUG] /usr/bin/ssh [email protected] -D 32482 -o StrictHostKeychecking=no[DEBUG] Opening SSH connection to [email protected][DEBUG] /usr/bin/ssh [email protected] -D 32483 -o StrictHostKeychecking=no[DEBUG] Waiting for /usr/bin/ssh [email protected] -D 32482 -o StrictHostKeychecking=no[DEBUG] Waiting for /usr/bin/ssh [email protected] -D 32483 -o StrictHostKeychecking=no[DEBUG] Creating iptables rules[DEBUG] iptables -A OUTPUT -t nat -d 127.0.0.1 -olo -p tcp --dport 1080 -j DNAT --to-destination 127.0.0.1:32482 -m statistic --mode nth --every 2 --packet 0[DEBUG] iptables -A OUTPUT -t nat -d 127.0.0.1 -olo -p tcp --dport 1080 -j DNAT --to-destination 127.0.0.1:32483[INFO] Listening on socks5://127.0.0.1:1080# Test SOCKS proxy$ proxychains curl ifconfig.me1.2.3.4$ proxychains curl ifconfig.me4.3.2.1$ proxychains curl ifconfig.me1.2.3.4$ proxychains curl ifconfig.me4.3.2.1
CLI 使用
$ trevorproxy --helpusage: trevorproxy [-h] [-p PORT] [-l LISTEN_ADDRESS] [-q] [-v] {interface,ssh} ...Round-robin requests through multiple SSH tunnels via a single SOCKS serverpositional arguments: {interface,ssh} proxy type interface send traffic from local interface ssh send traffic through SSH hostsoptional arguments: -h, --help show this help message andexit -p PORT, --port PORT Port for SOCKS server to listen on (default:1080) -l LISTEN_ADDRESS, --listen-address LISTEN_ADDRESS Listen address for SOCKS server (default:127.0.0.1) -q, --quiet Be quiet -v, -d, --verbose, --debug Be verbose
CLI 使用 - 子网代理
$ trevorproxy subnet --helpusage: trevorproxy subnet [-h] [-i INTERFACE] [-s SUBNET]optional arguments: -h, --help show this help message andexit -i INTERFACE, --interface INTERFACE Interface to send packets on -s SUBNET, --subnet SUBNET Subnet to send packets from
CLI 使用 - SSH 代理
$ trevorproxy ssh --helpusage: trevorproxy ssh [-h] [-k KEY] [--base-port BASE_PORT] ssh_hosts [ssh_hosts ...]positional arguments: ssh_hosts Round-robin load-balance through these SSH hosts (user@host)optional arguments: -h, --help show this help message and exit -k KEY, --key KEY Use this SSH key when connecting to proxy hosts--base-port BASE_PORT Base listening port tousefor SOCKS proxies (default: 32482)
项目地址:
https://github.com/blacklanternsecurity/TREVORproxy
请参阅随附的博客文章,了解有趣的咆哮和一些很酷的演示! https://github.com/blacklanternsecurity/TREVORspray/blob/trevorspray-v2/blogpost.md
原文始发于微信公众号(Ots安全):一个用 Python 编写的 SOCKS 代理,可以随机化你的源 IP 地址
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论