Tuesday, May 30, 2023

inBINcible Writeup - Golang Binary Reversing

This file is an 32bits elf binary, compiled from go language (i guess ... coded by @nibble_ds ;)
The binary has some debugging symbols, which is very helpful to locate the functions and api calls.

GO source functions:
-  main.main
-  main.function.001

If the binary is executed with no params, it prints "Nope!", the bad guy message.

~/ncn$ ./inbincible 
Nope!

Decompiling the main.main function I saw two things:

1. The Argument validation: Only one 16 bytes long argument is needed, otherwise the execution is finished.

2. The key IF, the decision to dexor and print byte by byte the "Nope!" string OR dexor and print "Yeah!"


The incoming channel will determine the final message.


Dexor and print each byte of the "Nope!" message.


This IF, checks 16 times if the go channel reception value is 0x01, in this case the app show the "Yeah!" message.

Go channels are a kind of thread-safe queue, a channel_send is like a push, and channel_receive is like a pop.

If we fake this IF the 16 times, we got the "Yeah!" message:

(gdb) b *0x8049118
(gdb) commands
>set {char *}0xf7edeef3 = 0x01
>c
>end

(gdb) r 1234567890123456
tarting program: /home/sha0/ncn/inbincible 1234567890123456
...
Yeah!


Ok, but the problem is not in main.main, is main.function.001 who must sent the 0x01 via channel.
This function xors byte by byte the input "1234567890123456" with a byte array xor key, and is compared with another byte array.

=> 0x8049456:       xor    %ebp,%ecx
This xor,  encode the argument with a key byte by byte

The xor key can be dumped from memory but I prefer to use this macro:

(gdb) b *0x8049456
(gdb) commands
>i r  ecx
>c
>end
(gdb) c

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x45 69

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x33 51

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x87 135

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x65 101

Breakpoint 2, 0x08049456 in main.func ()
ecx            0x12 18

The result of the xor will compared with another array byte,  each byte matched, a 0x01 will be sent.

The cmp of the xored argument byte,
will determine if the channel send 0 or 1


(gdb) b *0x0804946a
(gdb) commands
>i r al
>c
>end

At this point we have the byte array used to xor the argument, and the byte array to be compared with, if we provide an input that xored with the first byte array gets the second byte array, the code will send 0x01 by the channel the 16 times.


Now web have:

xorKey=[0x12,0x45,0x33,0x87,0x65,0x12,0x45,0x33,0x87,0x65,0x12,0x45,0x33,0x87,0x65,0x12]

mustGive=[0x55,0x75,0x44,0xb6,0x0b,0x33,0x06,0x03,0xe9,0x02,0x60,0x71,0x47,0xb2,0x44,0x33]


Xor is reversible, then we can get the input needed to dexor to the expected values in order to send 0x1 bytes through the go channel.

>>> x=''
>>> for i in range(len(xorKey)):
...     x+= chr(xorKey[i] ^ mustGive[i])
... 
>>> print x

G0w1n!C0ngr4t5!!


And that's the key :) let's try it:

~/ncn$ ./inbincible 'G0w1n!C0ngr4t5!!'
Yeah!

Got it!! thanx @nibble_ds for this funny crackme, programmed in the great go language. I'm also a golang lover.


More information


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

No comments: