Thursday, June 1, 2023

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

No comments:

Post a Comment