Friday, June 2, 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.


Related posts
  1. Best Hacking Tools 2019
  2. Hack Tools Online
  3. Pentest Tools
  4. Hacker Tools 2020
  5. Hack Rom Tools
  6. Underground Hacker Sites
  7. Hacks And Tools
  8. How To Make Hacking Tools
  9. Hacking Tools Download
  10. Hack Apps
  11. Hack Tools For Ubuntu
  12. Computer Hacker
  13. Hack Tools Pc
  14. Hack Tools Github
  15. Usb Pentest Tools
  16. Hacking Tools Windows
  17. Hacking Apps
  18. Hacking Tools For Games
  19. Hack Tools Pc
  20. Hack Tools For Mac
  21. Best Hacking Tools 2020
  22. Hack And Tools
  23. Hacking Tools Software
  24. Hacking Tools
  25. Pentest Tools Tcp Port Scanner
  26. Hacking Tools For Windows Free Download
  27. Hack Rom Tools
  28. Pentest Automation Tools
  29. Kik Hack Tools
  30. Hacker Tools Free Download
  31. Blackhat Hacker Tools
  32. New Hacker Tools
  33. Hack App
  34. New Hack Tools
  35. Hacking Tools Name
  36. Ethical Hacker Tools
  37. Hacker Tools For Ios
  38. Game Hacking
  39. Android Hack Tools Github
  40. Hacker Tools Apk Download
  41. Hack Tools For Games
  42. Hacking Tools Github
  43. New Hack Tools
  44. Pentest Tools Linux
  45. Hacker Tools List
  46. Hacker Tools Free
  47. Blackhat Hacker Tools
  48. Hacking Tools For Pc
  49. Pentest Reporting Tools
  50. Hacker Tool Kit
  51. Pentest Tools Find Subdomains
  52. Pentest Box Tools Download
  53. Hacking App
  54. Hacker Tools Apk Download
  55. Pentest Tools Open Source
  56. Kik Hack Tools
  57. Hack And Tools
  58. Free Pentest Tools For Windows
  59. Pentest Tools Framework
  60. Hacking Tools For Mac
  61. Game Hacking
  62. Ethical Hacker Tools
  63. Pentest Tools Website Vulnerability
  64. Hacker Tools Apk Download
  65. Pentest Tools Framework
  66. How To Install Pentest Tools In Ubuntu
  67. Bluetooth Hacking Tools Kali
  68. Hacker Security Tools
  69. Termux Hacking Tools 2019
  70. Hacking Apps
  71. Hacking App
  72. Hack Tools Mac
  73. Hack Rom Tools
  74. Pentest Tools
  75. Hacking Tools Free Download
  76. Game Hacking
  77. Hacking Tools Software
  78. Pentest Tools Url Fuzzer
  79. Hackers Toolbox
  80. Hacking Tools For Kali Linux
  81. Hacker Techniques Tools And Incident Handling
  82. How To Hack
  83. New Hacker Tools
  84. Hacking Tools For Windows 7
  85. Pentest Tools Kali Linux
  86. Hacker Tools Windows
  87. Pentest Automation Tools
  88. Underground Hacker Sites
  89. Hacking Tools Download
  90. Best Pentesting Tools 2018
  91. Hack Tool Apk No Root
  92. Pentest Tools Kali Linux
  93. Hacker Tools Free
  94. Hacker Tools 2020
  95. Underground Hacker Sites
  96. Hacker Tools Windows
  97. Hack Tools For Mac
  98. Android Hack Tools Github
  99. Hacking Tools Mac
  100. Hacking Tools For Windows 7
  101. Hacking App
  102. Hack Tools Download
  103. Hacker Tools Free
  104. Hacker Tools Online
  105. Tools Used For Hacking
  106. Hacking Tools 2020
  107. Beginner Hacker Tools
  108. Hacker Tool Kit

No comments:

Post a Comment