Friday, January 19, 2024

Koppeling - Adaptive DLL Hijacking / Dynamic Export Forwarding


This project is a demonstration of advanced DLL hijack techniques. It was released in conjunction with the "Adaptive DLL Hijacking" blog post. I recommend you start there to contextualize this code.

This project is comprised of the following elements:

  • Harness.exe: The "victim" application which is vulnerable to hijacking (static/dynamic)
  • Functions.dll: The "real" library which exposes valid functionality to the harness
  • Theif.dll: The "evil" library which is attempting to gain execution
  • NetClone.exe: A C# application which will clone exports from one DLL to another
  • PyClone.py: A python 3 script which mimics NetClone functionality

The VS solution itself supports 4 build configurations which map to 4 different methods of proxying functionality. This should provide a nice scalable way of demonstrating more techniques in the future.

  • Stc-Forward: Forwards export names during the build process using linker comments
  • Dyn-NetClone: Clones the export table from functions.dll onto theif.dll post-build using NetClone
  • Dyn-PyClone: Clones the export table from functions.dll onto theif.dll post-build using PyClone
  • Dyn-Rebuild: Rebuilds the export table and patches linked import tables post-load to dynamically prepare for function proxying

The goal of each technique is to successfully capture code execution while proxying functionality to the legitimate DLL. Each technique is tested to ensure static and dynamic sink situations are handled. This is by far not every primitive or technique variation. The post above goes into more detail.


Example

Prepare a hijack scenario with an obviously incorrect DLL

> copy C:\windows\system32\whoami.exe .\whoami.exe
1 file(s) copied.

> copy C:\windows\system32\kernel32.dll .\wkscli.dll
1 file(s) copied.

Executing in the current configuration should result in an error

> whoami.exe 

"Entry Point Not Found"

Convert kernel32 to proxy functionality for wkscli

> NetClone.exe --target C:\windows\system32\kernel32.dll --reference C:\windows\system32\wkscli.dll --output wkscli.dll
[+] Done.

> whoami.exe
COMPUTER\User



Related links
  1. Pentest Tools Github
  2. Hacker Tools 2020
  3. How To Hack
  4. Pentest Tools Bluekeep
  5. Pentest Reporting Tools
  6. Hacking Tools Online
  7. Hacking Tools Windows
  8. Hacking Tools Usb
  9. Pentest Reporting Tools
  10. Hack Tools 2019
  11. Hack Website Online Tool
  12. Black Hat Hacker Tools
  13. Pentest Tools Nmap
  14. Hacking Tools For Mac
  15. Pentest Tools For Windows
  16. Hack Tools
  17. Hack Tools For Games
  18. Hack Tools Pc
  19. Pentest Tools Framework
  20. Hacking Tools 2019
  21. Game Hacking
  22. Hacking Tools For Beginners
  23. Hack Tools Github
  24. Hacker Tools Mac
  25. Hacker Tool Kit
  26. Hacker Tools For Ios
  27. Github Hacking Tools
  28. Hacker Tools 2019
  29. Nsa Hack Tools
  30. Pentest Reporting Tools
  31. Hack Tools For Windows
  32. Hack Tools Pc
  33. Pentest Tools Online
  34. Hacker Techniques Tools And Incident Handling
  35. Ethical Hacker Tools
  36. Hacker Tools Linux
  37. Hacker Tool Kit
  38. Hak5 Tools
  39. Pentest Tools Windows
  40. How To Install Pentest Tools In Ubuntu
  41. Hacks And Tools
  42. Hacking Tools
  43. Hacking Tools Usb
  44. Pentest Tools Find Subdomains
  45. Hacker Tools Online
  46. Hacks And Tools
  47. Pentest Tools Review
  48. Hacking Tools Kit
  49. What Is Hacking Tools
  50. How To Hack
  51. Pentest Tools Download
  52. How To Hack
  53. Hacking Tools Windows 10
  54. Hack App
  55. Pentest Tools For Windows
  56. Pentest Tools List
  57. Hack Website Online Tool
  58. Pentest Tools Open Source
  59. Hacking Tools Kit
  60. Pentest Tools Open Source
  61. Hacker Tools Hardware
  62. Hacking Apps
  63. Pentest Tools Nmap
  64. Wifi Hacker Tools For Windows
  65. Hak5 Tools
  66. Hacker Tools List
  67. Hacking Tools 2019
  68. Hacker Tools 2020
  69. Usb Pentest Tools
  70. Beginner Hacker Tools
  71. Hacking Tools Windows 10
  72. Hacker Tools Apk
  73. Hack Tools 2019
  74. Pentest Tools Windows
  75. Hack Tools 2019
  76. Hacker Tools 2019
  77. Hacker Tools List
  78. Hacking Tools Mac
  79. Pentest Recon Tools
  80. Install Pentest Tools Ubuntu
  81. Hacker Techniques Tools And Incident Handling
  82. Hacking Tools Windows 10
  83. Ethical Hacker Tools
  84. Hacking Tools Kit
  85. Hacking Tools Usb
  86. Hacker Tools For Pc
  87. Hack Tools For Games
  88. Pentest Tools
  89. Tools 4 Hack
  90. Hacker Tools
  91. Hacker Tool Kit
  92. What Are Hacking Tools
  93. Underground Hacker Sites
  94. Hackrf Tools
  95. Pentest Tools Url Fuzzer
  96. Install Pentest Tools Ubuntu
  97. Install Pentest Tools Ubuntu
  98. Hacking Tools Name
  99. Hacker Tools Free Download
  100. Hacking Tools Download
  101. Hacker Tools 2019
  102. Hacking Apps
  103. Hacking Tools For Pc

No comments: