Obtaining SSL data with SSLsplit

In the previous recipe, we prepared our environment to attack an SSL/TLS connection while, in this recipe, we will use SSLsplit to complement a MITM attack and extract information from an encrypted communication.

Getting ready

We need to have an ARP spoofing attack executing before we start this recipe and have successfully completed the previous recipe Setting up an SSL MITM attack.

How to do it...

  1. Firstly, we need to create the directories in which SSLsplit is going to store the logs. To do that, open a terminal and create two directories, as shown:
    mkdir /tmp/sslsplit
    mkdir /tmp/sslsplit/logdir
    
  2. Now, let's start SSLsplit:
    sslsplit -D -l connections.log -j /tmp/sslsplit -S logdir -k certauth.key -c ca.crt ssl 0.0.0.0 8443 tcp 0.0.0.0 8080
    
    How to do it...
  3. Now that SSLsplit is running and the MITM between the windows client and the vulnerable_vm, go to the client and browse to: https://192.168.56.102/dvwa/.
  4. The browser may ask for confirmation as our CA and certificate are not officially recognized by any web browser. Set the exception and continue.
    How to do it...
  5. Now log in to DVWA using the admin user and password.
  6. Let's see what happened in SSLsplit by going to a new terminal and checking the contents of the logs in the directory we created for SSLsplit:
    ls /tmp/sslsplit/logdir/
    cat /tmp/sslsplit/logdir/*
    
    How to do it...

Now, even if Ettercap and Wireshark only see encrypted data, we can view the communication in clear text with SSLsplit.

How it works...

In this recipe, we continued with the attack on an SSL connection. In the first step, we created the directories in which SSLsplit was going to save the information that was captured.

The second step was the execution of SSLsplit with the following options:

  • -D: This is to run SSLsplit in the foreground, not as a daemon, and with verbose output.
  • -l connections.log: This saves a record of every connection attempt to the connections.log file in the current directory.
  • -j /tmp/sslsplit: This is used to establish the jail directory directory that will contain SSLsplit's environment as root (chroot) to /tmp/sslsplit.
  • -S logdir: This is used to tell SSLsplit to save the content log—all the requests and responses—to logdir (in the jail directory) saving data to separate files.
  • -k and -c: This is used to indicate the private key and the certificate to be used by SSLsplit when acting as CA.
  • ssl 0.0.0.0 8443: This tells SSLsplit where to listen for HTTPS (or other encrypted protocol) connections, remember that this is the port we forwarded from 443 using iptables in the previous recipe.
  • tcp 0.0.0.0 8080: This tells SSLsplit where to listen for HTTP connections, remember that this is the port we forwarded from 80 using iptables in the previous recipe.

After executing the command, we waited for the client to browse to the server's HTTPS page and submit data, then we checked the log files to discover the unencrypted information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.72.245