:
:

Powered by GetResponse email marketing software

Make Money Online Instantly

Make Money Online Instantly - Your One Stop Resource For "Make Money Online Instantly"

Monday, January 22, 2024

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






Related links


  1. Hacking Tools Online
  2. Pentest Tools
  3. Easy Hack Tools
  4. Tools 4 Hack
  5. Hack Tools
  6. Computer Hacker
  7. Blackhat Hacker Tools
  8. Pentest Tools For Android
  9. Hacking Apps
  10. Pentest Tools Alternative
  11. Ethical Hacker Tools
  12. Hacker Tools For Pc
  13. Pentest Tools Online
  14. Hacking Tools Kit
  15. How To Install Pentest Tools In Ubuntu
  16. Pentest Automation Tools
  17. Pentest Tools For Ubuntu
  18. Hacker Tools Free Download
  19. Hacker Tools For Ios
  20. Pentest Tools For Ubuntu
  21. Hacker Tools 2020
  22. Hack And Tools
  23. Hacker Tools Windows
  24. Hacker Techniques Tools And Incident Handling
  25. Hack Tools
  26. World No 1 Hacker Software
  27. Hacker Tools Apk Download
  28. Hacking Tools Windows 10
  29. Hacker Tools
  30. Hack Website Online Tool
  31. Hacking Tools And Software
  32. Hacking App
  33. Pentest Reporting Tools
  34. Hacker Tools Free Download
  35. Hack Apps
  36. Hacker Tools 2020
  37. Pentest Tools Kali Linux
  38. Nsa Hack Tools Download
  39. Best Pentesting Tools 2018
  40. How To Hack
  41. Hacking Tools For Beginners
  42. Hacking Tools For Windows
  43. Hacker Tools Free
  44. Hackers Toolbox
  45. Free Pentest Tools For Windows
  46. Hacker Techniques Tools And Incident Handling
  47. Hacker Tools 2020
  48. Hacking Tools Hardware
  49. Pentest Tools Tcp Port Scanner
  50. Tools For Hacker
  51. Pentest Tools Kali Linux
  52. Hacker Tools Linux
  53. What Are Hacking Tools
  54. Computer Hacker
  55. World No 1 Hacker Software
  56. Hackrf Tools
  57. Underground Hacker Sites
  58. Hack Rom Tools
  59. Hackers Toolbox
  60. Pentest Tools For Mac
  61. Hacking Tools Free Download
  62. Hacker Tools
  63. Computer Hacker
  64. Hacker Tools Apk
  65. Hacking Tools Usb
  66. Hacker Tools Software
  67. Hacker Search Tools
  68. Hack Tools Mac
  69. Hacker Tools Software
  70. Underground Hacker Sites
  71. How To Install Pentest Tools In Ubuntu
  72. What Is Hacking Tools
  73. Pentest Tools Open Source
  74. Hacking Tools Hardware
  75. Game Hacking
  76. Hacking Tools For Windows
  77. Hacker Tools Mac
  78. Ethical Hacker Tools
  79. Hacker Tools For Pc
  80. Hacker Tools Apk Download
  81. Computer Hacker
  82. Hack Tools 2019
  83. Hack Tools Github
  84. Pentest Tools Windows
  85. Hacking Tools For Windows Free Download
  86. Hacking Tools Pc
  87. Blackhat Hacker Tools
  88. Hacking Tools Free Download
  89. How To Make Hacking Tools
  90. Computer Hacker
  91. Pentest Tools Download
  92. Nsa Hacker Tools
  93. Hacker Search Tools
  94. Hacking App
  95. Pentest Tools
  96. Hacker Tools For Windows
  97. Pentest Tools Port Scanner
  98. Pentest Tools Apk
  99. Hacking Tools Usb
  100. How To Hack
  101. Blackhat Hacker Tools
  102. Hacker Tools For Pc
  103. Github Hacking Tools
  104. Hack Tools For Ubuntu
  105. Pentest Tools Find Subdomains
  106. Blackhat Hacker Tools
  107. Pentest Tools Review
  108. Pentest Tools Tcp Port Scanner
  109. Pentest Tools Url Fuzzer
  110. Growth Hacker Tools
  111. Hacking Tools Github
  112. Growth Hacker Tools
  113. Bluetooth Hacking Tools Kali
  114. Hacking Tools For Mac
  115. Pentest Tools Kali Linux
  116. Hack App
  117. Pentest Tools Subdomain

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home