Jan 23, 2024

Fast Emulator For Shellcodes In Rust

I have developed a fast emulator for modern shellcodes, that perform huge loops of millions of instructions emulated for resolving API or for other stuff.

The emulator is in Rust and all the few dependencies as well, so the rust safety is good for emulating malware.  

There are shellcodes that can be emulated from the beginning to the end, but when this is not possible the tool has many features that can be used like a console, a memory tracing, register tracing, and so on.

https://github.com/sha0coder/scemu



In less than two seconds we have emulated 7 millions of instructions arriving to the recv. 

At this point we have some  IOC like  the ip:port where it's connecting and other details.

Lets see what happens after the recv() spawning a console at position: 7,012,204


target/release/scemu -f shellcodes/shikata.bin -vv -c 7012204



In the console, pressing "enter" several times to emulate  step into several steps and we arrive to a return instruction.


Let's see the stack in this moment:


The "ret" instruction is going to jump to the buffer read with recv() so is a kind of stager.

The option "-e" or "--endpoint" is not ready for now, but it will allow to proxy the calls to get the next  stage automatically, but for now we have the details to get the stage.


SCEMU also identify all the Linux  syscalls for 32bits shellcodes:



The encoder used in shellgen is also supported https://github.com/MarioVilas/shellgen

Let's check with cobalt-strike:


We can see where is connecting and which headers is using, so right now we can replicate the communications.



In verbose mode we could do several greps to see the calls and correlate with ghidra/ida/radare or  for example grep the branches to study the emulation flow.


target/release/scemu -f shellcodes/rshell_sgn.bin -vv | grep j


target/release/scemu -f shellcodes/rshell_sgn.bin -vv -c 44000 -l


The -l --loops options makes the emulation a bit slower but track the number of iterations.

Is possible to print all the registers in every step with  -r or --registers  but also is possible to track  specific register for example with --reg esi


target/release/scemu -f shellcodes/shikata.bin --reg esi 


In this case ESI register points to the API name, if we track EAX or ECX will see that are the counters of the loop. These shellcodes  contains a hard loop to locate the API names.

The flag -i or --inspect allow to monitor memory using expressions like "dword ptr [eax + 0xa]"

target/release/scemu -f shellcodes/shikata.bin -i 'dword ptr [esi]'

And more things to come...  find a demo below:

https://www.youtube.com/watch?v=qTYmMjW3DFs





Read more


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

0 အမွတ္တရေျပာသြားတာ:

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger