Lets check different Cobalt Strike shellcodes and stages in the shellcodes emulator SCEMU.
This stages are fully emulated well and can get the IOC and the behavior of the shellcode.
But lets see another first stage big shellcode with c runtime embedded in a second stage.
In this case is loading tons of API using GetProcAddress at the beginning, then some encode/decode pointer and tls get/set values to store an address. And ends up crashing because is jumping an address that seems more code than address 0x9090f1eb.
Here there are two types of allocations:
Lets spawn a console on -c 3307548 and see if some of this allocations has the next stage.
The "m" command show all the memory maps but the "ma" show only the allocations done by the shellcode.
Dumping memory with "md" we see that there is data, and dissasembling this address with "d" we see the prolog of a function.
So we have second stage unpacked in alloc_e40064
With "mdd" we do a memory dump to disk we found the size in previous screenshot, and we can do some static reversing of stage2 in radare/ghidra/ida
In radare we can verify that the extracted is the next stage:
I usually do correlation between the emulation and ghidra, to understand the algorithms.
If wee look further we can realize that the emulator called a function on the stage2, we can see the change of code base address and is calling the allocated buffer in 0x4f...
And this stage2 perform several API calls let's check it in ghidra.
We can see in the emulator that enters in the IF block, and what are the (*DAT_...)() calls
Before a crash lets continue to the SEH pointer, in this case is the way, and the exception routine checks IsDebuggerPresent() which is not any debugger pressent for sure, so eax = 0;
So lets say yes and continue the emulation.
Both IsDebuggerPresent() and UnHandledExceptionFilter() can be used to detect a debugger, but the emulator return what has to return to not be detected.
Nevertheless the shellcode detects something and terminates the process.
Lets trace the branches to understand the logic:
target/release/scemu -f shellcodes/unsuported_cs.bin -vv | egrep '(\*\*|j|cmp|test)'
Lets see from the console where is pointing the SEH chain item:
to be continued ...
https://github.com/sha0coder/scemu
Read more
- Hack Apps
- Hacker Tool Kit
- Pentest Tools Download
- Best Hacking Tools 2020
- Hacking Tools For Windows 7
- Hack Tools 2019
- Hacker Security Tools
- Nsa Hack Tools
- Hack Tools For Mac
- Hacking Tools For Windows Free Download
- Hacking Tools Windows 10
- Pentest Tools Linux
- Hacker Tools Mac
- Pentest Tools Online
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Github
- Hak5 Tools
- Pentest Tools Website
- Hacker Tools For Mac
- Hack Tools For Games
- Hacking Tools And Software
- Easy Hack Tools
- Pentest Tools Tcp Port Scanner
- Nsa Hack Tools Download
- Hacker Security Tools
- Ethical Hacker Tools
- Hack Tools For Windows
- What Is Hacking Tools
- Pentest Tools For Android
- Hacks And Tools
- Hacking Tools 2020
- New Hack Tools
- Hacking Tools And Software
- Hack Tools For Ubuntu
- Hacker Tools Apk Download
- Hacker Tools Windows
- Underground Hacker Sites
- Nsa Hack Tools Download
- Pentest Tools For Mac
- Hack App
- Hacker Tools 2019
- Hacker Tools Online
- Hacking Tools Online
- Hak5 Tools
- Hack Rom Tools
- Hacks And Tools
- Pentest Tools Website
- Hacker Tools Linux
- Pentest Tools For Mac
- Pentest Tools Subdomain
- Best Hacking Tools 2020
- Underground Hacker Sites
- Pentest Tools Bluekeep
- Hacking Tools Online
- Pentest Tools For Android
- Hacker Tools Hardware
- Underground Hacker Sites
- Hacker Tools For Windows
- Best Pentesting Tools 2018
- Pentest Tools For Mac
- Hack Tools For Mac
- Top Pentest Tools
- Hacker Tools
- Pentest Tools Find Subdomains
- Kik Hack Tools
- How To Install Pentest Tools In Ubuntu
- Pentest Tools Website Vulnerability
- Hacking App
- Easy Hack Tools
- Hack Apps
- Hack Apps
- Hacker Hardware Tools
- Hack Tools
- Tools For Hacker
- Github Hacking Tools
- Hack Tools For Ubuntu
- Wifi Hacker Tools For Windows
- How To Hack
- Hacking Tools For Beginners
- Hacking Tools For Mac
- Hacker Tools Apk
- Hackers Toolbox
- Hacking Tools For Pc
- Hacker Tools For Mac
- Hack Tools For Mac
- Hacker Tools For Windows
- Hacking Tools Hardware
- Nsa Hack Tools Download
- Black Hat Hacker Tools
- Hacker Tool Kit
- Bluetooth Hacking Tools Kali
- Tools 4 Hack
- Hacking Tools For Kali Linux
- Best Hacking Tools 2020
- Best Pentesting Tools 2018
- Pentest Tools Download
- Pentest Tools Website Vulnerability
- Hacking Tools Usb
- Hack Tools Download
- Pentest Box Tools Download
- Hacking Tools
- Install Pentest Tools Ubuntu
- Hack Tools
- Hacking Tools Download
No comments:
Post a Comment