This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
session:extra:heartbleed-poc [2014/07/31 11:16] vladum [Exploit] |
session:extra:heartbleed-poc [2020/07/19 12:49] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | = Extra - Heartbleed | + | ====== 0x0Cb. |
- | == Information Leak Attacks | + | ===== Information Leak ===== |
- | == Environment Setup | + | In the context of binary exploitation, |
- | We are going to setup a minimal vulnerable environment to experiment with the exploit. We need a vulnerable OpenSSL version and a webserver. We also need to configure a basic website | + | More generally, this class of attacks includes any method that leads to the exposure of secret information (e.g., documents, keys). Besides software bugs, things like too much logging can also count as information leakage. For example, leaving the debug logging output of your web application can result in leaking paths on the hosting machine |
- | === Download Nginx & OpenSSL | + | A very famous and recent bug that leaks memory content is Heartbleed. The vulnerability was discovered in OpenSSL' |
+ | * encryption keys | ||
+ | * passwords | ||
+ | * session cookies | ||
+ | * personal identifiable information (e.g., credit card numbers) | ||
+ | |||
+ | This section will go through a Proof-of-Concept exploit that will enable us to leak a normal user's session cookie for a vulnerable server (localhost). | ||
+ | ===== Environment Setup ===== | ||
+ | |||
+ | To setup a minimal environment, | ||
+ | |||
+ | ==== Download Nginx & OpenSSL | ||
* [[https:// | * [[https:// | ||
* [[http:// | * [[http:// | ||
- | === Compile Nginx & vulnerable OpenSSL | + | ==== Compile Nginx & vulnerable OpenSSL |
<code bash> | <code bash> | ||
Line 40: | Line 51: | ||
**Continue from here if your Perl version is older than 5.18.X.** | **Continue from here if your Perl version is older than 5.18.X.** | ||
+ | |||
+ | Note that we are only building Nginx, which will take care of running '' | ||
<code text> | <code text> | ||
Line 59: | Line 72: | ||
</ | </ | ||
- | === Basic SSL website | + | ==== Basic SSL website |
Prepare a self-signed certificate: | Prepare a self-signed certificate: | ||
Line 107: | Line 120: | ||
sudo chown vladum: / | sudo chown vladum: / | ||
echo “Hello” > / | echo “Hello” > / | ||
+ | </ | ||
+ | |||
+ | Start the server: | ||
+ | |||
+ | <code bash> | ||
+ | ~$ ~/ | ||
</ | </ | ||
You should see the page live at https:// | You should see the page live at https:// | ||
- | == Vulnerability | + | ===== Vulnerability |
General information about this vulnerability can be obtained from [[http:// | General information about this vulnerability can be obtained from [[http:// | ||
- | The TLS Heartbeat protocol extension (see [[http:// | + | The TLS Heartbeat protocol extension (see [[http:// |
<code text> | <code text> | ||
Line 161: | Line 180: | ||
If the attacker sends a '' | If the attacker sends a '' | ||
- | == Exploit | + | ===== Exploit |
A TLS channel is established after the initial handshake part of the protocol. Since the Heartbeat RFC specifies the a Heartbeat Request can be send at any time, we simply have to initiate a TLS connection with a '' | A TLS channel is established after the initial handshake part of the protocol. Since the Heartbeat RFC specifies the a Heartbeat Request can be send at any time, we simply have to initiate a TLS connection with a '' |