1 2 Ambtion.com 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 Ambtion.com 279 280 281 Advertise Free on Auto-pilot!
Watch the latest videos on YouTube.com
newgoldenjewels: Fast Emulator For Shellcodes In Rust

Sunday, June 4, 2023

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





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

No comments: