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

No comments: