Saturday, August 22, 2020

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 articles

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

No comments:

Post a Comment