jueves, 18 de enero 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)





Related articles


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

No hay comentarios:

Publicar un comentario