qq379797807 / ew Goto Github PK
View Code? Open in Web Editor NEWThis project forked from idlefire/ew
内网穿透(跨平台)
This project forked from idlefire/ew
内网穿透(跨平台)
【软件介绍】 EarthWorm是一款用于开启 SOCKS v5 代理服务的工具,基于标准 C 开发,可提供多平台间的转接通讯,用于复杂网络环境下的数据转发。 专有主页: http://rootkiter.com/EarthWorm/ 【使用场景】 普通网络环境: 1. 目标网络边界存在公网IP且可任意开监听端口: +---------+ +-------------------+ |HackTools| ->> | 8888-> 1.1.1.1 | +---------+ +-------------------+ a)./ew -s ssocksd -l 8888 // 在 1.1.1.1 主机上通过这个命令开启 8888 端口的 socks 代理 b) HackTools 可通过访问 1.1.1.1:8888 端口使用 1.1.1.1 主机提供的代理 2. 目标网络边界不存在公网 IP,需要通过反弹方式创建 socks 代理 一台可控公网IP主机 可控内网主机 +---------+ +--------------------------+ | +---------------+ |HackTools| ->> | 1080 -> 1.1.1.1 -> 8888 | 防火墙 | <-- 2.2.2.2 | +---------+ +--------------------------+ | +---------------+ a) ./ew -s rcsocks -l 1080 -e 8888 // 在 1.1.1.1 的公网主机添加转接隧道,将 1080 收到的代理请求转交给反连 8888 端口的主机 b) ./ew -s rssocks -d 1.1.1.1 -e 8888 // 将目标网络的可控边界主机反向连接公网主机 c) HackTools 可通过访问 1.1.1.1:1080 端口使用 rssocks 主机提供的 socks5 代理服务 对于二重网络环境: 1. 获得目标网络内两台主机 A、B 的权限,情况描述如下: A 主机: 存在公网 IP,且自由监听任意端口,无法访问特定资源 B 主机: 目标网络内部主机,可访问特定资源,但无法访问公网 A 主机可直连 B 主机 可控边界主机A 可访问指定资源的主机B +---------+ +-----------------------+ +-----------------+ |HackTools| ->> | 1080 --> 2.2.2.2 --> | ->> | 9999 -> 2.2.2.3 | +---------+ +-----------------------+ +-----------------+ a) ./ew -s ssocksd -l 9999 // 在 2.2.2.3 主机上利用 ssocksd 方式启动 9999 端口的 socks 代理 b) ./ew -s lcx_tran -l 1080 -f 2.2.2.3 -g 9999 // 将 1080 端口收到的 socks 代理请求转交给 2.2.2.3 的主机。 c) HackTools 可通过访问 2.2.2.2:1080 来使用 2.2.2.3 主机提供的 socks5 代理。 2. 获得目标网络内两台主机 A、B 的权限,情况描述如下: A 主机: 目标网络的边界主机,无公网 IP,无法访问特定资源。 B 主机: 目标网络内部主机,可访问特定资源,却无法回连公网。 A 主机可直连 B 主机 一台可控公网IP主机 可控内网主机A 可访问指定资源的主机B +---------+ +--------------------------+ | +-----------------+ +-----------------+ |HackTools| ->> | 1080 -> 1.1.1.1 -> 8888 | 防火墙 | <-- 2.2.2.2 --> | ->> | 9999 -> 2.2.2.3 | +---------+ +--------------------------+ | +-----------------+ +-----------------+ a) ./ew -s lcx_listen -l 1080 -e 8888 // 在 1.1.1.1 公网主机添加转接隧道,将 1080 收到的代理请求 // 转交给反连 8888 端口的主机 b) ./ew -s ssocksd -l 9999 // 在 2.2.2.3 主机上利用 ssocksd 方式启动 9999 端口的 socks 代理 c) ./ew -s lcx_slave -d 1.1.1.1 -e 8888 -f 2.2.2.3 -g 9999 // 在 2.2.2.2 上,通过工具的 lcx_slave 方式,打通1.1.1.1:8888 和 2.2.2.3:9999 之间的通讯隧道 d) HackTools 可通过访问 1.1.1.1:1080 来使用 2.2.2.3 主机提供的 socks5 代理 【参数说明】 目前工具提供六种链路状态,可通过 -s 参数进行选定,分别为: ssocksd rcsocks rssocks lcx_slave lcx_tran lcx_listen 其中 SOCKS5 服务的核心逻辑支持由 ssocksd 和 rssocks 提供,分别对应正向与反向socks代理。 其余的 lcx 链路状态用于打通测试主机同 socks 服务器之间的通路。 lcx 类别管道: lcx_slave 该管道一侧通过反弹方式连接代理请求方,另一侧连接代理提供主机。 lcx_tran 该管道,通过监听本地端口接收代理请求,并转交给代理提供主机。 lcx_listen 该管道,通过监听本地端口接收数据,并将其转交给目标网络回连的代理提供主机。 通过组合lcx类别管道的特性,可以实现多层内网环境下的渗透测试。 下面是一个三级跳的本地测试例子。。。 ./ew -s rcsocks -l 1080 -e 8888 ./ew -s lcx_slave -d 127.0.0.1 -e 8888 -f 127.0.0.1 -g 9999 ./ew -s lcx_listen -l 9999 -e 7777 ./ew -s rssocks -d 127.0.0.1 -e 7777 数据流向为 IE -> 1080 -> 8888 -> 9999 -> 7777 -> rssocks 【补充说明】 1.为了减少网络资源的消耗,程序中添加了超时机制,默认时间为10000毫秒(10秒), 用户可以通过追加 -t 参数来调整这个值,单位为毫秒。在多级级联功能中,超时机制 将以隧道中最短的时间为默认值。 2.单纯从设计原理上讲,多级级联的三种状态可以转发任意以TCP为基础的通讯服务, 包括远程桌面/web服务 等。 3.产品包中的 ew_for_Arm32 在开发者已有平台下(android手机、小米路由器、树莓派) 测试无误。 如果有其它异常环境请将对应详细细节反馈给作者,以便更新程序问题。 【联系作者】 [email protected] 如果您在使用中有什么好想法,或遇到什么BUG,都可以主动联系我。 我会尽最大所能让这个工具更加完美,感谢大家的支持。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.