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

lintasberita
Jangan Lupa di Share yaaa... !!!! Klik tombol dibawah ini

Related Posts Plugin for WordPress, Blogger...

0 komentar:

Posting Komentar