Name:
Location: Winnipeg, Manitoba, Canada

The Wholefood Farmacy makes eating healthy easy, convenient and affordable. We offer pure, nutrient-dense, ready-to-eat, whole food meals, snacks, soups, smoothie mixes and treats for the children. All of our foods are vegetarian, most are raw and vegan as well. We also offer many gluten-free and nut-free whole food choices for those with food sensitivities - see our FAQ section of the Whole Food Farmacy Website for more information.

Thursday, May 25, 2023

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

0 Comments:

Post a Comment

<< Home