Sunday, January 21, 2024

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 info


  1. Hacker Tools For Pc
  2. Blackhat Hacker Tools
  3. Hacking Apps
  4. Hacker Tools Github
  5. Pentest Tools Download
  6. Nsa Hack Tools Download
  7. Tools For Hacker
  8. Nsa Hack Tools
  9. What Are Hacking Tools
  10. Hack Website Online Tool
  11. Hack Tools For Windows
  12. Pentest Tools Free
  13. Pentest Tools Windows
  14. Hacking Tools For Mac
  15. How To Hack
  16. Hacking Tools For Mac
  17. Pentest Tools Open Source
  18. Github Hacking Tools
  19. Black Hat Hacker Tools
  20. Growth Hacker Tools
  21. Hack Tools For Ubuntu
  22. Hacker Tools Linux
  23. Hack And Tools
  24. Pentest Tools Website Vulnerability
  25. Pentest Tools For Mac
  26. Pentest Tools Online
  27. Hacking Tools 2019
  28. Github Hacking Tools
  29. Hacker Tools 2019
  30. Pentest Tools Tcp Port Scanner
  31. Hacking Tools Github
  32. Hack Tools For Windows
  33. Hacker Tools Online
  34. Growth Hacker Tools
  35. Pentest Tools Port Scanner
  36. Pentest Tools Apk
  37. Pentest Tools Find Subdomains
  38. New Hacker Tools
  39. Pentest Tools Website Vulnerability
  40. Pentest Tools Subdomain
  41. Pentest Tools Kali Linux
  42. Tools 4 Hack
  43. How To Hack
  44. Hacking App
  45. Hacker Tools Free
  46. How To Hack
  47. Hacker Hardware Tools
  48. Pentest Tools Download
  49. Hacking Tools Hardware
  50. Pentest Tools Review
  51. Hacking Tools For Mac
  52. Tools For Hacker
  53. Hacking Tools And Software
  54. Hack And Tools
  55. Bluetooth Hacking Tools Kali
  56. Hacking Tools Download
  57. Hack Tools Github
  58. Hacker Tools Windows
  59. Pentest Reporting Tools
  60. Hacking Tools Kit
  61. Hacking Tools Mac
  62. Hacking Apps
  63. Hackrf Tools
  64. Pentest Tools Apk
  65. Hacking Tools
  66. Hacking Tools Hardware
  67. Hacker Hardware Tools
  68. Best Hacking Tools 2020
  69. Hack Tool Apk
  70. Hacking Tools For Games
  71. Hack Tools 2019
  72. Easy Hack Tools
  73. Best Hacking Tools 2020
  74. Pentest Tools Open Source
  75. Hacking Tools For Windows Free Download
  76. Hacker Tools Github
  77. Easy Hack Tools
  78. Hacking Tools Online
  79. Hacking Tools For Kali Linux
  80. Hacking Tools Windows 10
  81. Physical Pentest Tools
  82. Hack Tools For Games
  83. Hacking Tools Windows 10
  84. Hacker Tools Github
  85. Pentest Tools For Android
  86. Best Pentesting Tools 2018
  87. Pentest Tools Apk
  88. Hackrf Tools
  89. Usb Pentest Tools
  90. Tools Used For Hacking
  91. Hack Tools Online
  92. Pentest Tools Github
  93. Pentest Tools Subdomain
  94. Hacking Tools Kit
  95. Pentest Tools Windows
  96. How To Hack
  97. Pentest Tools Android
  98. Pentest Tools Nmap
  99. Hacks And Tools
  100. Hack Tools
  101. Best Pentesting Tools 2018

No comments:

Post a Comment