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)





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

0 comments:

Post a Comment

Request Item or Service

Powered by Blogger.