Monday, June 5, 2023

Emulating Shellcodes - Chapter 1

 There are many basic shellcodes that can be emulated from the beginning from the end providing IOC like where is connecting and so on. But what can we do when the emulation get stuck at some point?

The console has many tools to interact with the emulator like it was a debugger but the shellcode really is not being executed so is safer than a debugger.

target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin -vv 


In some shellcodes the emulator emulates millions of instructions without problem, but in this case at instruction number 176 there is a crash, the [esp + 30h] contain an unexpected 0xffffffff.

There are two ways to trace the memory, tracing all memory operations with -m or inspecting specific place with -i which allow to use registers to express the memory location:

target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin  -i 'dword ptr [esp + 0x30]'


Now we know that in position 174 the value 0xffffffff is set.

But we have more control if we set the console at first instruction with -c 1 and set a memory breakpoint on write.




This "dec" instruction changes the zero for the 0xffffffff, and the instruction 90 is what actually is changing the stack value.

Lets trace the eax register to see if its a kind of counter or what is doing.


target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin  --reg eax 


Eax is not a counter, is getting hardcoded values which is probably an API name:


In this case this shellcode depend on previous states and crash also in the debugger because of  register values. this is just an example of how to operate in cases where is not fully emulated.

In next chapter will see how to unpack and dump to disk using the emulator.


More articles


  1. New Hacker Tools
  2. Bluetooth Hacking Tools Kali
  3. Hacker Tools For Ios
  4. Pentest Tools Download
  5. Hacking Tools For Kali Linux
  6. Hack Tools For Games
  7. Hacking Tools Software
  8. Pentest Tools Url Fuzzer
  9. Pentest Tools List
  10. Hacker Tools Free Download
  11. Hacking Tools For Windows 7
  12. Hacker Tools For Mac
  13. Hacking Tools Github
  14. Hacking Tools Windows
  15. Hack Tools 2019
  16. Pentest Tools Website
  17. Hack Rom Tools
  18. Hacks And Tools
  19. Pentest Tools For Ubuntu
  20. Pentest Tools Apk
  21. Hacking Tools For Mac
  22. Tools 4 Hack
  23. Pentest Tools Find Subdomains
  24. Hack Tool Apk No Root
  25. Best Pentesting Tools 2018
  26. Bluetooth Hacking Tools Kali
  27. Hacking Tools Download
  28. Hacker Tools For Mac
  29. Pentest Tools For Android
  30. Hack Tools Github
  31. Pentest Tools Port Scanner
  32. How To Install Pentest Tools In Ubuntu
  33. Hack Tool Apk
  34. Pentest Tools Android
  35. Hack Tool Apk
  36. Pentest Tools Website
  37. Hacking Tools Kit
  38. Hack Tool Apk
  39. Blackhat Hacker Tools
  40. Hack Tools For Games
  41. How To Install Pentest Tools In Ubuntu
  42. Hacking Tools Download
  43. Pentest Tools Url Fuzzer
  44. Hack Tools Online
  45. Hack Tools For Windows
  46. Growth Hacker Tools
  47. Hacking Tools 2020
  48. Hacking Tools Name
  49. Nsa Hack Tools
  50. Hack Tools Pc
  51. Hacking Tools 2019
  52. Hacker
  53. Hacking Tools Hardware
  54. How To Install Pentest Tools In Ubuntu
  55. Pentest Recon Tools
  56. Hack Tools Github
  57. Top Pentest Tools
  58. Pentest Tools Subdomain
  59. Hacking Tools Windows 10
  60. Hacking Tools Windows 10
  61. Hacking Tools For Beginners
  62. Hacker Tools Free
  63. Pentest Tools
  64. Pentest Automation Tools
  65. Pentest Tools Github
  66. Pentest Reporting Tools
  67. Hack Tools
  68. Hacking Tools Software
  69. Termux Hacking Tools 2019
  70. Hacking Tools For Pc
  71. Hack And Tools
  72. Pentest Tools Nmap
  73. Pentest Box Tools Download
  74. Hack Tool Apk No Root
  75. Hack Tools Pc
  76. Hack Tools Github
  77. Hacker Techniques Tools And Incident Handling
  78. Pentest Tools Tcp Port Scanner
  79. Beginner Hacker Tools
  80. Best Pentesting Tools 2018
  81. Hacker Techniques Tools And Incident Handling
  82. Hacking Tools For Pc
  83. Physical Pentest Tools
  84. Physical Pentest Tools
  85. Pentest Tools Android
  86. Pentest Tools Alternative
  87. Pentest Tools Windows
  88. Hack Tools For Ubuntu
  89. Hacking Tools For Windows Free Download
  90. Hacker Tools Software
  91. Hackrf Tools
  92. Pentest Tools Online
  93. Nsa Hacker Tools
  94. Usb Pentest Tools
  95. Hacks And Tools
  96. Hack Tool Apk No Root
  97. Pentest Tools For Mac
  98. Tools Used For Hacking
  99. Pentest Tools Github
  100. Pentest Tools Url Fuzzer
  101. Hacking Apps
  102. Hacking Tools For Mac
  103. Hacker Tools Online
  104. Hacker Tools Software
  105. Hacking Tools For Games
  106. Pentest Tools Android
  107. Pentest Tools Url Fuzzer
  108. Hacking Tools For Kali Linux
  109. Computer Hacker
  110. How To Make Hacking Tools
  111. Hack Tool Apk No Root
  112. Free Pentest Tools For Windows
  113. Pentest Reporting Tools
  114. Ethical Hacker Tools
  115. Hacking Tools For Pc
  116. Bluetooth Hacking Tools Kali
  117. Pentest Tools For Windows
  118. Blackhat Hacker Tools
  119. Pentest Tools Github
  120. Wifi Hacker Tools For Windows
  121. Hacking Tools And Software
  122. Hacking Tools Kit
  123. Hacker Tools Free Download
  124. Pentest Tools Subdomain
  125. Hack Rom Tools
  126. Black Hat Hacker Tools
  127. Pentest Tools Download
  128. Hacking Tools For Windows
  129. Hacking Tools Name
  130. Hack Tools
  131. Black Hat Hacker Tools
  132. Hacker Tools Free
  133. Pentest Tools Alternative
  134. Free Pentest Tools For Windows
  135. Underground Hacker Sites
  136. Hack Tools Github
  137. Hacking Tools Github
  138. Pentest Tools Download
  139. Hacker Security Tools
  140. Hack Tools Github
  141. Hack And Tools
  142. Hacker Tools Windows
  143. Hack And Tools
  144. Hacking Tools Usb
  145. How To Make Hacking Tools
  146. Pentest Tools For Android
  147. What Are Hacking Tools
  148. Hacker Tools Github
  149. Easy Hack Tools
  150. Best Hacking Tools 2020
  151. Hacker Tools 2020
  152. Hacking Tools Free Download
  153. Hacking Tools Usb
  154. Pentest Tools Website Vulnerability
  155. Underground Hacker Sites
  156. Hacking Tools Kit
  157. Hack Website Online Tool
  158. Hacker Tools For Ios
  159. Hackrf Tools
  160. Hacking Tools For Windows Free Download
  161. Pentest Tools Tcp Port Scanner
  162. Pentest Tools For Mac
  163. Pentest Recon Tools
  164. Pentest Recon Tools
  165. Pentest Tools Website
  166. Hacker Tools For Ios
  167. Pentest Tools Download
  168. Hack Tools For Pc
  169. Ethical Hacker Tools
  170. Hack Tools
  171. Tools For Hacker
  172. Hacking Tools For Pc
  173. Pentest Tools Port Scanner
  174. Tools For Hacker
  175. Hacking App

No comments: