Wednesday, May 31, 2023

C++ Std::String Buffer Overflow And Integer Overflow

Interators are usually implemented using signed integers like the typical "for (int i=0; ..." and in fact is the type used indexing "cstr[i]", most of methods use the signed int, int by default is signed.
Nevertheless, the "std::string::operator[]" index is size_t which is unsigned, and so does size(), and same happens with vectors.
Besides the operator[] lack of negative index control, I will explain this later.

Do the compilers doesn't warn about this?


If his code got a large input it would index a negative numer, let see g++ and clang++ warnings:



No warnings so many bugs out there...

In order to reproduce the crash we can load a big string or vector from file, for example:


I've implemented a loading function, getting the file size with tellg() and malloc to allocate the buffer, then in this case used as a string.
Let see how the compiler write asm code based on this c++ code.



So the string constructor, getting size and adding -2 is clear. Then come the operator<< to concat the strings.
Then we see the operator[] when it will crash with the negative index.
In assembly is more clear, it will call operator[] to get the value, and there will hapen the magic dereference happens. The operator[] will end up returning an invalid address that will crash at [RAX]



In gdb the operator[] is a  allq  0x555555555180 <_znst7__cxx1112basic_stringicst11char_traitsicesaiceeixem plt="">

(gdb) i r rsi
rsi            0xfffffffffffefffe  -65538


The implmementation of operator ins in those functions below:

(gdb) bt
#0  0x00007ffff7feebf3 in strcmp () from /lib64/ld-linux-x86-64.so.2
#1  0x00007ffff7fdc9a5 in check_match () from /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fdce7b in do_lookup_x () from /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fdd739 in _dl_lookup_symbol_x () from /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7fe1eb7 in _dl_fixup () from /lib64/ld-linux-x86-64.so.2
#5  0x00007ffff7fe88ee in _dl_runtime_resolve_xsavec () from /lib64/ld-linux-x86-64.so.2
#6  0x00005555555554b3 in main (argc=2, argv=0x7fffffffe118) at main.cpp:29

Then crashes on the MOVZX EAX, byte ptr [RAX]

Program received signal SIGSEGV, Segmentation fault.
0x00005555555554b3 in main (argc=2, argv=0x7fffffffe118) at main.cpp:29
29     cout << "penultimate byte is " << hex << s[i] << endl;
(gdb)


What about negative indexing in std::string::operator[] ?
It's exploitable!

In a C char array is known that having control of the index, we can address memory.
Let's see what happens with C++ strings:






The operator[] function call returns the address of string plus 10, and yes, we can do abitrary writes.



Note that gdb displays by default with at&t asm format wich the operands are in oposite order:


And having a string that is in the stack, controlling the index we can perform a write on the stack.



To make sure we are writing outside the string, I'm gonna do 3 writes:


 See below the command "i r rax" to view the address where the write will be performed.


The beginning of the std::string object is 0x7fffffffde50.
Write -10 writes before the string 0x7fffffffde46.
And write -100 segfaults because is writting in non paged address.



So, C++ std::string probably is not vulnerable to buffer overflow based in concatenation, but the std::string::operator[] lack of negative indexing control and this could create vulnerable and exploitable situations, some times caused by a signed used of the unsigned std::string.size()










More info
  1. Pentest Recon Tools
  2. Hacking Tools Kit
  3. Pentest Tools Url Fuzzer
  4. Hacking Tools 2020
  5. Pentest Tools Kali Linux
  6. Hacker Tools For Windows
  7. Tools 4 Hack
  8. Pentest Tools Alternative
  9. Hackrf Tools
  10. Pentest Box Tools Download
  11. Termux Hacking Tools 2019
  12. Android Hack Tools Github
  13. Hacking Tools Download
  14. Hak5 Tools
  15. Hacking Tools For Mac
  16. Hacker Security Tools
  17. Hacker Tools 2019
  18. Pentest Tools Bluekeep
  19. Hacker Tools For Mac
  20. Hacking Tools For Beginners
  21. Hack Tools 2019
  22. How To Install Pentest Tools In Ubuntu
  23. Pentest Tools For Ubuntu
  24. Hack Tools For Ubuntu
  25. Pentest Tools Framework
  26. Beginner Hacker Tools
  27. Hacking Tools For Windows
  28. Hack Tools Mac
  29. Hack Tools Pc
  30. Hak5 Tools
  31. Tools 4 Hack
  32. Pentest Tools For Mac
  33. Hack Tools Pc
  34. Pentest Tools Linux
  35. Hacking Tools For Pc
  36. Install Pentest Tools Ubuntu
  37. Pentest Tools Linux
  38. What Are Hacking Tools
  39. Pentest Tools Tcp Port Scanner
  40. Hacking Tools For Games
  41. Hacker Tools Online
  42. Pentest Tools
  43. Pentest Tools For Android
  44. Pentest Tools Subdomain
  45. Hacker Hardware Tools
  46. Hacking Tools Online
  47. New Hack Tools
  48. Hacking Tools For Windows
  49. Hacker Tools Hardware
  50. Hack Apps
  51. Hack Tools For Mac
  52. Pentest Tools For Android
  53. Black Hat Hacker Tools
  54. Hacker Tools Windows
  55. Hack App
  56. Hacking Tools Free Download
  57. Hacking Tools For Windows Free Download
  58. Hacking Apps
  59. Hacking Tools Hardware

Networking | Routing And Switching | Tutorial 4 | 2018


Welcome to my 4th new tutorial of the series of networking. In this blog you'll the content about network switches. You'll learn about how to make a communication successful and secure in the same network (LAN) by using STP. As Spanning tree protocol (STP) we used in multi-switched networks. Why we use this protocol in multi-switched network etc.

What is Switch? 

A switch is an intelligent device used to connect multiple devices within the same network. The intelligence of is that it requires Media Access Control (MAC) address for communication and doesn't allow broadcast.  Let's understand the whole thing by a little example, consider there is a network having 3 end devices name Device-A, Device-B,Device-C connected with each other respectively with the help of switch. When a Device-A sends data to Device-C so that data will only forwarded by switch to Device-C not to Device-B.

What is Media Access Control (MAC) address?

A Media Access Control (MAC) address is 48-bit unique physical address given to network interface controller (NIC) or network adapter, for communication within the same network which is given by its manufacturer. It is made up of hexadecimal numbers like a1:b1:cc:ac:2e:f1.

What is STP?


STP stands for Spanning tree protocol which is basically used in bridge and switches to prevent loops when you have a redundant links in the Ethernet networks. If the loop is present in the Ethernet network so the whole network will suffer because there will MAC instability in the MAC table,  duplicate frames generation and so on. Let's move to the video for further detail.


Related links


BurpSuite Introduction & Installation



What is BurpSuite?
Burp Suite is a Java based Web Penetration Testing framework. It has become an industry standard suite of tools used by information security professionals. Burp Suite helps you identify vulnerabilities and verify attack vectors that are affecting web applications. Because of its popularity and breadth as well as depth of features, we have created this useful page as a collection of Burp Suite knowledge and information.

In its simplest form, Burp Suite can be classified as an Interception Proxy. While browsing their target application, a penetration tester can configure their internet browser to route traffic through the Burp Suite proxy server. Burp Suite then acts as a (sort of) Man In The Middle by capturing and analyzing each request to and from the target web application so that they can be analyzed.











Everyone has their favorite security tools, but when it comes to mobile and web applications I've always found myself looking BurpSuite . It always seems to have everything I need and for folks just getting started with web application testing it can be a challenge putting all of the pieces together. I'm just going to go through the installation to paint a good picture of how to get it up quickly.

BurpSuite is freely available with everything you need to get started and when you're ready to cut the leash, the professional version has some handy tools that can make the whole process a little bit easier. I'll also go through how to install FoxyProxy which makes it much easier to change your proxy setup, but we'll get into that a little later.

Requirements and assumptions:

Mozilla Firefox 3.1 or Later Knowledge of Firefox Add-ons and installation The Java Runtime Environment installed

Download BurpSuite from http://portswigger.net/burp/download.htmland make a note of where you save it.

on for Firefox from   https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/


If this is your first time running the JAR file, it may take a minute or two to load, so be patient and wait.


Video for setup and installation.




You need to install compatible version of java , So that you can run BurpSuite.

More info


  1. Hack Tools For Games
  2. Nsa Hack Tools Download
  3. Termux Hacking Tools 2019
  4. Pentest Tools List
  5. Hack Tools
  6. Hack And Tools
  7. Pentest Tools Android
  8. Pentest Tools Find Subdomains
  9. Hacking Tools For Windows 7
  10. Hacking Tools Github
  11. What Is Hacking Tools
  12. Nsa Hack Tools Download
  13. Hacker Tools Github
  14. Hacking Tools 2019
  15. Hacker Tools Linux
  16. Hacking Tools Windows
  17. Hacker Tools 2019
  18. Hack Tools For Ubuntu
  19. Hacking Tools Kit
  20. Pentest Box Tools Download
  21. Hacker Tools Hardware
  22. Hack Tools Online
  23. Pentest Tools Website
  24. Top Pentest Tools
  25. Hack App
  26. Hacker Tools For Ios
  27. Pentest Tools Android
  28. Hacker Tools 2019
  29. Hacking Tools Software
  30. Pentest Tools Tcp Port Scanner
  31. Tools 4 Hack
  32. Pentest Tools Free
  33. Hack App
  34. Hacking Tools 2019
  35. Best Hacking Tools 2020
  36. Hacker Techniques Tools And Incident Handling
  37. Pentest Automation Tools
  38. Hacker Search Tools
  39. Hacking Tools For Mac
  40. Android Hack Tools Github
  41. Hack Tool Apk
  42. New Hacker Tools
  43. New Hacker Tools
  44. Hacking Tools Windows 10
  45. Pentest Tools
  46. Beginner Hacker Tools
  47. Github Hacking Tools
  48. Hacker Tools 2019
  49. Blackhat Hacker Tools
  50. Pentest Tools Find Subdomains
  51. Hack Tools
  52. World No 1 Hacker Software
  53. Hackers Toolbox
  54. Termux Hacking Tools 2019
  55. Hacking Tools For Windows
  56. Hacker
  57. Hack Tools Online
  58. Tools For Hacker
  59. Black Hat Hacker Tools
  60. Pentest Tools Apk
  61. Hack Tools
  62. Pentest Automation Tools
  63. Termux Hacking Tools 2019
  64. Hack Tools For Mac
  65. Hacking Tools Hardware
  66. Hacker Tools Software
  67. Tools Used For Hacking
  68. Pentest Tools Download
  69. Pentest Tools Online
  70. Hack Tools For Pc
  71. Pentest Tools Port Scanner
  72. Pentest Tools Website Vulnerability
  73. Hack Tools Github
  74. Hacker Tools Free
  75. Pentest Tools Linux
  76. Hacker Tools Online
  77. Hacking Tools For Mac
  78. Pentest Tools List
  79. Pentest Tools Kali Linux
  80. Hacker Tools Free Download
  81. Pentest Tools Free
  82. Hacking Tools For Windows Free Download
  83. Hack Tools Github
  84. Hacker Security Tools
  85. Pentest Reporting Tools
  86. Hacking Tools For Windows Free Download
  87. Hacking Tools Usb
  88. Tools For Hacker
  89. Hacker Tools For Ios
  90. Pentest Tools For Mac
  91. Hack Tools Mac
  92. Hacker Tools Apk
  93. Install Pentest Tools Ubuntu
  94. Hacking Tools Free Download
  95. Free Pentest Tools For Windows
  96. Pentest Tools Kali Linux
  97. Pentest Tools Framework
  98. Hacker Tools Mac
  99. Hacker Techniques Tools And Incident Handling
  100. Hack Tools For Ubuntu
  101. Hacker Tools Hardware
  102. Tools For Hacker
  103. Pentest Tools Framework
  104. Pentest Tools Url Fuzzer
  105. Tools Used For Hacking
  106. Hacking Tools For Windows
  107. Hacking Tools Usb
  108. Hack Tools
  109. Pentest Tools Website Vulnerability
  110. Hacker Tools Apk
  111. Wifi Hacker Tools For Windows
  112. Pentest Tools Url Fuzzer
  113. Hack Tools For Games
  114. World No 1 Hacker Software
  115. Hacker Tools List
  116. Hak5 Tools
  117. Hacking Tools Windows
  118. Nsa Hack Tools Download
  119. Hack Tools Pc
  120. Nsa Hack Tools Download
  121. Hacker Tools 2019
  122. Free Pentest Tools For Windows
  123. Hack Tools Mac
  124. Hacker Tools 2019
  125. Hack Tools Pc
  126. Hacking Tools Software

Tuesday, May 30, 2023

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.More articles