Sunday, January 28, 2024

Vlang Binary Debugging

Why vlang? V is a featured, productive, safe and confortable language highly compatible with c, that generates neat binaries with c-speed, the decompilation also seems quite clear as c code.
https://vlang.io/

After open the binary with radare in debug mode "-d" we proceed to do the binary recursive analysis with "aaaa" the more a's the more deep analys.



The function names are modified when the binary is crafted, if we have a function named hello in a module named main we will have the symbol main__hello, but we can locate them quicly thanks to radare's grep done with "~" token in this case applied to the "afl" command which lists all the symbols.


Being in debug mode we can use "d*" commands, for example "db" for breakpointing the function and then "dc" to start or continue execution.


Let's dissasemble the function with "pD" command, it also displays the function variables and arguments as well, note also the xref "call xref from main"


Let's take a look to the function arguments, radare detect's this three 64bits registers used on the function.


Actually the function parameter is rsi that contains a testing html to test the href extraction algorithm.


The string structure is quite simple and it's plenty of implemented methods.




With F8 we can step over the code as we were in ollydbg on linux.


Note the rip marker sliding into the code.


We can recognize the aray creations, and the s.index_after() function used to find substrings since a specific position.


If we take a look de dissasembly we sill see quite a few calls to tos3() functions.
Those functions are involved in string initialization, and implements safety checks.

  • tos(string, len)
  • tos2(byteptr)
  • tos3(charptr)

In this case I have a crash in my V code and I want to know what is crashing, just continue the execution with "dc" and see what poits the rip register.



In visual mode "V" we can see previous instructions to figure out the arguments and state.


We've located the crash on the substring operation which is something like "s2 := s1[a..b]" probably one of the arguments of the substring is out of bounds but luckily the V language has safety checks and is a controlled termination:



Switching the basic block view "space" we can see the execution flow, in this case we know the loops and branches because we have the code but this view also we can see the tos3 parameter "href=" which is useful to locate the position on the code.



When it reach the substr, we can see the parameters with "tab" command.



Looking the implementation the radare parameter calculation is quite exact.


Let's check the param values:


so the indexes are from 0x0e to 0x24 which are inside the buffer, lets continue to next iteration,
if we set a breakpoint and check every iteration, on latest iteration before the crash we have the values 0x2c to 0x70 with overflows the buffer and produces a controlled termination of the v compiled process.





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

No comments:

Post a Comment