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

CEH: Fundamentals Of Social Engineering


Social engineering is a nontechnical method of breaking into a system or network. It's the process of deceiving users of a system and convincing them to perform acts useful to the hacker, such as giving out information that can be used to defeat or bypass security mechanisms. Social engineering is important to understand because hackers can use it to attack the human element of a system and circumvent technical security measures. This method can be used to gather information before or during an attack.

A social engineer commonly uses the telephone or Internet to trick people into revealing sensitive information or to get them to do something that is against the security policies of the organization. By this method, social engineers exploit the natural tendency of a person to trust their word, rather than exploiting computer security holes. It's generally agreed that users are the weak link in security; this principle is what makes social engineering possible.

The most dangerous part of social engineering is that companies with authentication processes, firewalls, virtual private networks, and network monitoring software are still wide open to attacks, because social engineering doesn't assault the security measures directly. Instead, a social-engineering attack bypasses the security measures and goes after the human element in an organization.

Types of Social Engineering-Attacks

There are two types of Social Engineering attacks

Human-Based 

Human-based social engineering refers to person-to-person interaction to retrieve the desired information. An example is calling the help desk and trying to find out a password.

Computer-Based 

​Computer-based social engineering refers to having computer software that attempts to retrieve the desired information. An example is sending a user an email and asking them to reenter a password in a web page to confirm it. This social-engineering attack is also known as phishing.

Human-Based Social Engineering

Human-Based further categorized as follow:

Impersonating an Employee or Valid User

In this type of social-engineering attack, the hacker pretends to be an employee or valid user on the system. A hacker can gain physical access by pretending to be a janitor, employee, or contractor. Once inside the facility, the hacker gathers information from trashcans, desktops, or computer systems.

Posing as an Important User

In this type of attack, the hacker pretends to be an important user such as an executive or high-level manager who needs immediate assistance to gain access to a computer system or files. The hacker uses intimidation so that a lower-level employee such as a help desk worker will assist them in gaining access to the system. Most low-level employees won't question someone who appears to be in a position of authority.

Using a Third Person

Using the third-person approach, a hacker pretends to have permission from an authorized source to use a system. This attack is especially effective if the supposed authorized source is on vacation or can't be contacted for verification.

Calling Technical Support

Calling tech support for assistance is a classic social-engineering technique. Help desk and technical support personnel are trained to help users, which makes them good prey for social-engineering attacks.

Shoulder Surfing 

Shoulder surfing is a technique of gathering passwords by watching over a person's shoulder while they log in to the system. A hacker can watch a valid user log in and then use that password to gain access to the system.

Dumpster Diving

Dumpster diving involves looking in the trash for information written on pieces of paper or computer printouts. The hacker can often find passwords, filenames, or other pieces of confidential information.

Computer-Based Social Engineering

Computer-based social-engineering attacks can include the following:
  • Email attachments
  • Fake websites
  • Pop-up windows


Insider Attacks

If a hacker can't find any other way to hack an organization, the next best option is to infiltrate the organization by getting hired as an employee or finding a disgruntled employee to assist in the attack. Insider attacks can be powerful because employees have physical access and are able to move freely about the organization. An example might be someone posing as a delivery person by wearing a uniform and gaining access to a delivery room or loading dock. Another possibility is someone posing as a member of the cleaning crew who has access to the inside of the building and is usually able to move about the offices. As a last resort, a hacker might bribe or otherwise coerce an employee to participate in the attack by providing information such as passwords.

Identity Theft

A hacker can pose as an employee or steal the employee's identity to perpetrate an attack. Information gathered in dumpster diving or shoulder surfing in combination with creating fake ID badges can gain the hacker entry into an organization. Creating a persona that can enter the building unchallenged is the goal of identity theft.

Phishing Attacks

Phishing involves sending an email, usually posing as a bank, credit card company, or other financial organization. The email requests that the recipient confirm banking information or reset passwords or PINs. The user clicks the link in the email and is redirected to a fake website. The hacker is then able to capture this information and use it for financial gain or to perpetrate other attacks. Emails that claim the senders have a great amount of money but need your help getting it out of the country are examples of phishing attacks. These attacks prey on the common person and are aimed at getting them to provide bank account access codes or other confidential information to the hacker.

Online Scams

Some websites that make free offers or other special deals can lure a victim to enter a username and password that may be the same as those they use to access their work system.
The hacker can use this valid username and password once the user enters the information in the website form. Mail attachments can be used to send malicious code to a victim's system, which could automatically execute something like a software keylogger to capture passwords. Viruses, Trojans, and worms can be included in cleverly crafted emails to entice a victim to open the attachment. Mail attachments are considered a computer-based social-engineering attack.

Read more


Thursday, January 18, 2024

Hackerhubb.blogspot.com

Hackerhubb.blogspot.comRead more

Emulating Shellcodes - Chapter 1

 There are many basic shellcodes that can be emulated from the beginning from the end providing IOC like where is connecting and so on. But what can we do when the emulation get stuck at some point?

The console has many tools to interact with the emulator like it was a debugger but the shellcode really is not being executed so is safer than a debugger.

target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin -vv 


In some shellcodes the emulator emulates millions of instructions without problem, but in this case at instruction number 176 there is a crash, the [esp + 30h] contain an unexpected 0xffffffff.

There are two ways to trace the memory, tracing all memory operations with -m or inspecting specific place with -i which allow to use registers to express the memory location:

target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin  -i 'dword ptr [esp + 0x30]'


Now we know that in position 174 the value 0xffffffff is set.

But we have more control if we set the console at first instruction with -c 1 and set a memory breakpoint on write.




This "dec" instruction changes the zero for the 0xffffffff, and the instruction 90 is what actually is changing the stack value.

Lets trace the eax register to see if its a kind of counter or what is doing.


target/release/scemu -f ~/Downloads/shellcodes_matched/drv_shellcode.bin  --reg eax 


Eax is not a counter, is getting hardcoded values which is probably an API name:


In this case this shellcode depend on previous states and crash also in the debugger because of  register values. this is just an example of how to operate in cases where is not fully emulated.

In next chapter will see how to unpack and dump to disk using the emulator.


Related articles