
NimicStack is the pure Nim implementation of Call Stack Spoofing technique to mimic legitimate programs
NimicStack는 합법적인 프로그램을 모방하기 위한 Call Stack Spoofing 기법의 순수 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의 세 가지 예제 콜 스택을 모방할 수 있습니다.
.\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 출력:
승인된 보안 테스트 전용입니다. 명시적 허가 없이 시스템에 대해 이 도구를 오용하는 것은 불법입니다.