Translate

sábado, 27 de janeiro de 2024

Introduction To Reversing Golang Binaries


Golang binaries are a bit hard to analyze but there are some tricks to locate the things and view what is doing the code.






Is possible to list all the go files compiled in the binary even in an striped binaries, in this case we have only one file gohello.go this is a good clue to guess what is doing the program.


On stripped binaries the runtime functions are not resolved so is more difficult to locate the user algorithms:


If we start from the entry point, we will found this mess:

The golang string initialization are encoded and is not displayed on the strings window.


How to locate main?  if its not stripped just bp on [package name].main for example bp main.main, (you can locate the package-name searching strings with ".main")


And here is our main.main:


The code is:

So in a stripped binary we cant find the string "hello world" neither the initialization 0x1337 nor the comparator 0x1337, all this is obfuscated.

The initialization sequence is:


The procedure for locating main.main in stripped binaries is:
1. Click on the entry point and locate the runtime.mainPC pointer:



2. click on runtime.main function (LAB_0042B030):


3. locate the main.main call after the zero ifs:



4. click on it and here is the main:




The runtime is not obvious for example the fmt.Scanf() call perform several internal calls until reach the syscall, and in a stripped binary there are no function names.



In order to identify the functions one option is compile another binary with symbols and make function fingerprinting.

In Ghidra we have the script golang_renamer.py which is very useful:


After applying this plugin the main looks like more clear:




This script is an example of function fingerprinting, in this case all the opcodes are included on the crc hashing:
# This script fingerprints the functions
#@author: sha0coder
#@category fingerprinting

print "Fingerprinting..."

import zlib


# loop through program functions
function = getFirstFunction()
while function is not None:
name = str(function.getName())
entry = function.getEntryPoint()
body = function.getBody()
addresses = body.getAddresses(True)

if not addresses.hasNext():
# empty function
continue

ins = getInstructionAt(body.getMinAddress())
opcodes = ''
while ins and ins.getMinAddress() <= body.getMaxAddress():
for b in ins.bytes:
opcodes += chr(b & 0xff)
ins = getInstructionAfter(ins)
crchash = zlib.crc32(opcodes) & 0xffffffff

print name, hex(crchash)


function = getFunctionAfter(function)





More info


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

Arquivo do blog