sábado, 27 de janeiro de 2024

Linux Stack Protection By Default

Modern gcc compiler (v9.2.0) protects the stack by default and you will notice it because instead of SIGSEGV on stack overflow you will get a SIGABRT, but it also generates coredumps.




In this case the compiler adds the variable local_10. This variable helds a canary value that is checked at the end of the function.
The memset overflows the four bytes stack variable and modifies the canary value.



The 64bits canary 0x5429851ebaf95800 can't be predicted, but in specific situations is not re-generated and can be bruteforced or in other situations can be leaked from memory for example using a format string vulnerability or an arbitrary read wihout overflowing the stack.

If the canary doesn't match, the libc function __stack_chck_fail is called and terminates the prorgam with a SIGABORT which generates a coredump, in the case of archlinux managed by systemd and are stored on "/var/lib/systemd/coredump/"


❯❯❯ ./test 
*** stack smashing detected ***: terminated
fish: './test' terminated by signal SIGABRT (Abort)

❯❯❯ sudo lz4 -d core.test.1000.c611b7caa58a4fa3bcf403e6eac95bb0.1121.1574354610000000.lz4
[sudo] password for xxxx: 
Decoding file core.test.1000.c611b7caa58a4fa3bcf403e6eac95bb0.1121.1574354610000000 
core.test.1000.c611b : decoded 249856 bytes 

 ❯❯❯ sudo gdb /home/xxxx/test core.test.1000.c611b7caa58a4fa3bcf403e6eac95bb0.1121.1574354610000000 -q 


We specify the binary and the core file as a gdb parameters. We can see only one LWP (light weight process) or linux thread, so in this case is quicker to check. First of all lets see the back trace, because in this case the execution don't terminate in the segfaulted return.




We can see on frame 5 the address were it would had returned to main if it wouldn't aborted.



Happy Idea: we can use this stack canary aborts to detect stack overflows. In Debian with prevous versions it will be exploitable depending on the compilation flags used.
And note that the canary is located as the last variable in the stack so the previous variables can be overwritten without problems.




More information
  1. Hacking Tools Name
  2. Hacker Tools For Windows
  3. Hacking Tools For Mac
  4. Pentest Tools Kali Linux
  5. World No 1 Hacker Software
  6. Hacker Tools For Ios
  7. Hack Tools For Pc
  8. Pentest Tools Kali Linux
  9. Hacker Techniques Tools And Incident Handling
  10. Hacking Tools For Kali Linux
  11. Pentest Tools Android
  12. Nsa Hack Tools Download
  13. Pentest Tools Nmap
  14. What Is Hacking Tools
  15. Free Pentest Tools For Windows
  16. Pentest Tools Kali Linux
  17. Hack Tools 2019
  18. Ethical Hacker Tools
  19. Hacker Security Tools
  20. New Hack Tools
  21. Hack Tools For Pc
  22. Pentest Box Tools Download
  23. What Are Hacking Tools
  24. Tools 4 Hack
  25. Hacking Tools 2020
  26. Pentest Automation Tools
  27. Hacking Apps
  28. Best Hacking Tools 2019
  29. Hacks And Tools
  30. Hacker Tools Windows
  31. New Hack Tools
  32. Free Pentest Tools For Windows
  33. Hacking App
  34. Hacker Tools 2019
  35. Pentest Automation Tools
  36. Hacker Tools For Pc
  37. Hackrf Tools
  38. Hack Tools Online
  39. Pentest Recon Tools
  40. Best Hacking Tools 2020
  41. What Is Hacking Tools
  42. Hacking Apps
  43. Hak5 Tools
  44. Hacker Tools Software
  45. Game Hacking
  46. Hacking Tools Pc
  47. Growth Hacker Tools
  48. Hack And Tools
  49. Tools For Hacker
  50. Hack App
  51. Pentest Tools Review
  52. Hacking Tools
  53. Tools 4 Hack
  54. Hack Tools Download
  55. Hacker Tools 2019
  56. Hacking Tools Pc
  57. Pentest Tools Port Scanner
  58. Game Hacking
  59. Wifi Hacker Tools For Windows
  60. Best Hacking Tools 2020
  61. Nsa Hacker Tools
  62. How To Hack
  63. Install Pentest Tools Ubuntu
  64. Hack Tools For Games
  65. Pentest Recon Tools
  66. Hack Tools
  67. How To Hack
  68. Pentest Box Tools Download
  69. Hacker Tools For Mac
  70. Easy Hack Tools
  71. Hacking Tools For Windows 7
  72. Hack Tools
  73. Hacking Tools For Kali Linux
  74. Hacker Tools For Windows
  75. Hacking Tools Github
  76. Pentest Tools Bluekeep
  77. Pentest Tools Framework
  78. Nsa Hack Tools Download
  79. Pentest Tools Port Scanner
  80. Hacking Tools 2019
  81. Nsa Hacker Tools
  82. Hack Tools
  83. Hack Tools Pc
  84. Pentest Tools Online
  85. Pentest Tools Framework
  86. Hacking Tools For Beginners
  87. Pentest Reporting Tools
  88. Tools For Hacker
  89. Pentest Tools For Ubuntu
  90. Pentest Tools Framework
  91. Hacking Tools 2020
  92. Best Pentesting Tools 2018
  93. Hack Tools
  94. How To Install Pentest Tools In Ubuntu
  95. Best Pentesting Tools 2018
  96. Pentest Tools Kali Linux
  97. Pentest Tools Url Fuzzer

Airpwn: A Wireless Packet Injector


"Airpwn is a framework for 802.11 (wireless) packet injection. Airpwn listens to incoming wireless packets, and if the data matches a pattern specified in the config files, custom content is injected "spoofed" from the wireless access point. From the perspective of the wireless client, airpwn becomes the server." read more...


Website: http://airpwn.sourceforge.net

Related links
  1. Wifi Hacker Tools For Windows
  2. World No 1 Hacker Software
  3. Usb Pentest Tools
  4. Pentest Tools For Mac
  5. Bluetooth Hacking Tools Kali
  6. Pentest Tools Android
  7. Pentest Tools Android
  8. Black Hat Hacker Tools
  9. Pentest Tools Linux
  10. How To Hack
  11. Hacking Tools For Windows
  12. Hacking Tools Hardware
  13. Pentest Tools Android
  14. Hacker Tools Software
  15. Hacking Tools For Kali Linux
  16. Hacking Tools Windows 10
  17. Pentest Tools Github
  18. Physical Pentest Tools
  19. How To Install Pentest Tools In Ubuntu
  20. Hack Tools Online
  21. Hacker Tools For Pc
  22. Hacking Apps
  23. Pentest Box Tools Download
  24. Hacker Security Tools
  25. Pentest Tools Github
  26. Pentest Tools Find Subdomains
  27. Pentest Tools Website Vulnerability
  28. Hacking Tools Kit
  29. Hack Tools Pc
  30. Hacking Tools Name
  31. Hacker Techniques Tools And Incident Handling
  32. Hacking Tools For Windows 7
  33. Hack Tools Github
  34. Game Hacking
  35. Blackhat Hacker Tools
  36. Hack Tools Online
  37. Kik Hack Tools
  38. Pentest Tools Android
  39. Hacking Tools For Windows Free Download
  40. Hacking Tools Usb
  41. Pentest Recon Tools
  42. Pentest Tools Port Scanner
  43. Hacking Tools For Mac
  44. How To Install Pentest Tools In Ubuntu
  45. Hacking Tools 2019
  46. Hacker Techniques Tools And Incident Handling
  47. Hack Rom Tools
  48. Hacking Tools
  49. Install Pentest Tools Ubuntu
  50. Hack Tools For Games
  51. Pentest Tools For Android
  52. Hack Tools Online
  53. Hacking Tools Kit
  54. Pentest Tools Review
  55. Pentest Tools Alternative
  56. Pentest Tools Website Vulnerability
  57. Usb Pentest Tools
  58. Hack Tool Apk No Root
  59. Hack Tools For Windows
  60. Github Hacking Tools
  61. Tools 4 Hack
  62. Easy Hack Tools
  63. Black Hat Hacker Tools
  64. Pentest Tools Url Fuzzer
  65. Pentest Tools Kali Linux
  66. Hacking Apps
  67. Hack Tools 2019
  68. Hacking Tools For Windows Free Download
  69. Hacker Tools Hardware
  70. Pentest Box Tools Download
  71. Nsa Hack Tools
  72. Hacker Tools For Windows

sexta-feira, 26 de janeiro de 2024

Practical Dictionary Attack On IPsec IKE

We found out that in contrast to public knowledge, the Pre-Shared Key (PSK) authentication method in main mode of IKEv1 is susceptible to offline dictionary attacks. This requires only a single active Man-in-the-Middle attack. Thus, if low entropy passwords are used as PSKs, this can easily be broken.

This week at the USENIX Security conference, Dennis Felsch will present our research paper on IPsec attacksThe Dangers of Key Reuse: Practical Attacks on IPsec IKE. [alternative link to the paper]

In his blog post, Dennis showed how to attack the public key encryption based authentication methods of IKEv1 (PKE & RPKE) and how to use this attack against IKEv2 signature based authentication method. In this blog post, I will focus on another interesting finding regarding IKEv1 and the Pre-Shared Key authentication.

IPsec and Internet Key Exchange (IKE)

IPsec enables cryptographic protection of IP packets. It is commonly used to build VPNs (Virtual Private Networks). For key establishment, the IKE protocol is used. IKE exists in two versions, each with different modes, different phases, several authentication methods, and configuration options. Therefore, IKE is one of the most complex cryptographic protocols in use.

In version 1 of IKE (IKEv1), four authentication methods are available for Phase 1, in which initial authenticated keying material is established: Two public key encryption based methods, one signature based method, and a PSK (Pre-Shared Key) based method.

The relationship between IKEv1 Phase 1, Phase 2, and IPsec ESP. Multiple simultaneous Phase 2 connections can be established from a single Phase 1 connection. Grey parts are encrypted, either with IKE derived keys (light grey) or with IPsec keys (dark grey). The numbers at the curly brackets denote the number of messages to be exchanged in the protocol.

Pre-Shared Key authentication

As shown above, Pre-Shared Key authentication is one of three authentication methods in IKEv1. The authentication is based on the knowledge of a shared secret string. In reality, this is probably some sort of password.

The IKEv1 handshake for PSK authentication looks like the following (simplified version):


In the first two messages, the session identifier (inside HDR) and the cryptographic algorithms (proposals) are selected by initiator and responder. 

In messages 3 and 4, they exchange ephemeral Diffie-Hellman shares and nonces. After that, they compute a key k by using their shared secret (PSK) in a PRF function (e.g. HMAC-SHA1) and the previously exchanged nonces. This key is used to derive additional keys (ka, kd, ke). The key kd is used to compute MACI over the session identifier and the shared diffie-hellman secret gxy. Finally, the key ke is used to encrypt IDI (e.g. IPv4 address of the peer) and MACI

Weaknesses of PSK authentication

It is well known that the aggressive mode of authentication in combination with PSK is insecure and vulnerable against off-line dictionary attacks, by simply eavesedropping the packets. For example, in strongSwan it is necessary to set the following configuration flag in order to use it:
charon.i_dont_care_about_security_and_use_aggressive_mode_psk=yes

For the main mode, we found a similar attack when doing some minor additional work. For that, the attacker needs to waits until a peer A (initiator) tries to connect to another peer B (responder). Then, the attacker acts as a man-in-the middle and behaves like the peer B would, but does not forward the packets to B.

From the picture above it should be clear that an attacker who acts as B can compute (gxy) and receives the necessary public values session ID, nI, nR. However, the attacker does not know the PSK. In order to mount a dictionary attack against this value, he uses the nonces, and computes a candidate for for every entry in the dictionary. It is necessary to make a key derivation for every k with the values of the session identifiers and shared Diffie-Hellmann secret the possible keys ka, kd and ke. Then, the attacker uses ke in order to decrypt the encrypted part of message 5. Due to IDI often being an IP address plus some additional data of the initiator, the attacker can easily determine if the correct PSK has been found.

Who is affected?

This weakness exists in the IKEv1 standard (RFC 2409). Every software or hardware that is compliant to this standard is affected. Therefore, we encourage all vendors, companies, and developers to at least ensure that high-entropy Pre-Shared Keys are used in IKEv1 configurations.

In order to verify the attack, we tested the attack against strongSWAN 5.5.1.

Proof-of-Concept

We have implemented a PoC that runs a dictionary attack against a network capture (pcapng) of a IKEv1 main mode session. As input, it also requires the Diffie-Hellmann secret as described above. You can find the source code at github. We only tested the attack against strongSWAN 5.5.1. If you want to use the PoC against another implementation or session, you have to adjust the idHex value in main.py.

Responsible Disclosure

We reported our findings to the international CERT at July 6th, 2018. We were informed that they contacted over 250 parties about the weakness. The CVE ID for it is CVE-2018-5389 [cert entry].

Credits

On August 10th, 2018, we learned that this attack against IKEv1 main mode with PSKs was previously described by David McGrew in his blog post Great Cipher, But Where Did You Get That Key?. We would like to point out that neither we nor the USENIX reviewers nor the CERT were obviously aware of this.
On August 14th 2018, Graham Bartlett (Cisco) email us that he presented the weakness of PSK in IKEv2 in several public presentations and in his book.
On August 15th 2018, we were informed by Tamir Zegman that John Pliam described the attack on his web page in 1999.

FAQs

  • Do you have a name, logo, any merchandising for the attack?
    No.
  • Have I been attacked?
    We mentioned above that such an attack would require an active man-in-the-middle attack. In the logs this could look like a failed connection attempt or a session timed out. But this is a rather weak indication and no evidence for an attack. 
  • What should I do?
    If you do not have the option to switch to authentication with digital signatures, choose a Pre-Shared Key that resists dictionary attacks. If you want to achieve e.g. 128 bits of security, configure a PSK with at least 19 random ASCII characters. And do not use something that can be found in public databases.
  • Am I safe if I use PSKs with IKEv2?
    No, interestingly the standard also mentions that IKEv2 does not prevent against off-line dictionary attacks.
  • Where can I learn more?
    You can read the paper[alternative link to the paper]
  • What else does the paper contain?
    The paper contains a lot more details than this blogpost. It explains all authentication methods of IKEv1 and it gives message flow diagrams of the protocol. There, we describe a variant of the attack that uses the Bleichenbacher oracles to forge signatures to target IKEv2. 
Continue reading

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