Friday, January 19, 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 posts


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

No comments:

Post a Comment