Monday, 22 January 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.





More info

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

No comments:

Post a Comment