Saturday, January 27, 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.





Related word


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

No comments:

Post a Comment