Emulating Shellcodes - Chapter 2

 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)'



Continuing the emulation it's setting the SEH  pointer to previous stage:


Lets see from the console where is pointing the SEH chain item:


to be continued ...


https://github.com/sha0coder/scemu






More information


  1. Hacks And Tools
  2. Hack Tools Github
  3. Hacker Tools Apk
  4. New Hacker Tools
  5. Hack Tools For Mac
  6. Hacking Tools And Software
  7. Hacking Tools Hardware
  8. Pentest Reporting Tools
  9. How To Make Hacking Tools
  10. Hacking Tools For Windows 7
  11. Hacking Tools 2020
  12. Nsa Hack Tools
  13. Tools 4 Hack
  14. Hack Tools For Ubuntu
  15. What Is Hacking Tools
  16. Hacker Tools For Mac
  17. Hacking Tools Pc
  18. Hacking App
  19. Hacker Tools Apk Download
  20. New Hacker Tools
  21. How To Hack
  22. Hacking Tools Mac
  23. Hack Tools For Pc
  24. Pentest Tools Android
  25. Pentest Tools Url Fuzzer
  26. Bluetooth Hacking Tools Kali
  27. Hacking Tools Windows 10
  28. Best Pentesting Tools 2018
  29. Hacker Tools For Windows
  30. Hack Rom Tools
  31. Pentest Tools Android
  32. Hacker Tools Github
  33. Hacking Tools For Beginners
  34. Pentest Tools Apk
  35. Hack Tools For Windows
  36. Pentest Tools For Android
  37. Hacker Tools For Pc
  38. Hacking Tools For Mac
  39. Hacker Tools List
  40. Hacking Tools For Windows Free Download
  41. Hacker Tools 2019
  42. Easy Hack Tools
  43. Wifi Hacker Tools For Windows
  44. Hack Tool Apk No Root
  45. Pentest Tools Online
  46. Computer Hacker
  47. Hacker Tools For Windows
  48. Pentest Tools Framework
  49. How To Install Pentest Tools In Ubuntu
  50. World No 1 Hacker Software
  51. Hacker Tools For Pc
  52. Black Hat Hacker Tools
  53. Hack Tools Mac
  54. Hacker Tools 2019
  55. Hacker Tools List
  56. Hacking Tools Windows
  57. Pentest Tools Github
  58. Hack Tools Online
  59. Kik Hack Tools
  60. Pentest Tools Github
  61. Pentest Tools Free
  62. Hack And Tools
  63. Pentest Tools Framework
  64. Hack Tools Mac
  65. Android Hack Tools Github
  66. Best Pentesting Tools 2018
  67. Pentest Tools For Mac
  68. Pentest Tools Review
  69. Pentest Recon Tools
  70. Pentest Tools Review
  71. Hacking Tools Download
  72. Underground Hacker Sites
  73. Hacker Tool Kit
  74. Physical Pentest Tools
  75. Pentest Tools Download
  76. Best Hacking Tools 2019
  77. Physical Pentest Tools
  78. Blackhat Hacker Tools
  79. Install Pentest Tools Ubuntu
  80. Hacking Apps
  81. Hack Tools Download
  82. Hack Tools For Games
  83. Best Hacking Tools 2019
  84. Wifi Hacker Tools For Windows
  85. Hacker Tools For Pc
  86. Growth Hacker Tools
  87. Hacker
  88. Hacker Tools Mac
  89. Hacking App
  90. Hacker Search Tools
  91. Pentest Tools Linux
  92. Kik Hack Tools
  93. What Are Hacking Tools
  94. Hacking Tools Usb
  95. Hacking Tools For Pc
  96. Hacker
  97. Pentest Tools For Windows
  98. Kik Hack Tools
  99. Hacking Tools Usb
  100. Hacking Tools Online
  101. Hacking Tools Name
  102. Hacker Security Tools
  103. Hacks And Tools
  104. Pentest Tools Find Subdomains
  105. Hacker Tools Linux
  106. Hacking Tools Pc

EMAIL подписка