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

No comments:

Post a Comment