Blog | G5 Cyber Security

Bettercap: TLS Handshake Details

TL;DR

This guide shows you how to get more detailed information about the TLS handshake phase when using Bettercap, helping you understand what’s happening during a secure connection. We’ll focus on enabling verbose logging and interpreting the output.

1. Enable Verbose Logging

By default, Bettercap doesn’t show all the details of the TLS handshake. You need to turn on verbose logging to see more information. Use the -v or --verbose flag when starting Bettercap.

bettercap -v

2. Start Your Capture

Start your capture as usual, targeting the network interface you want to monitor. For example:

bettercap -v --iface eth0

3. Run TLS Interception (If Applicable)

If you’re intercepting TLS traffic (e.g., with tls.spoof), make sure it’s running. This guide applies to both passive monitoring and active interception.

net.sniff on
tls.spoof on

4. Observe the Output

With verbose logging enabled, Bettercap will print a lot more information to the console as TLS handshakes occur. Look for lines that start with ‘TLS Handshake’. These lines contain key details.

5. Understanding the TLS Handshake Phases

The TLS handshake involves several phases. Here’s what you might see and what it means:

Bettercap will show you these phases as they happen.

6. Identifying Key Information

Pay attention to these details in the output:

7. Filtering Output

If you’re capturing a lot of traffic, it can be hard to find specific TLS handshakes. You can use tools like grep to filter the output:

bettercap -v --iface eth0 | grep 'TLS Handshake'

8. Saving Output to a File

To analyze the handshake details later, you can redirect Bettercap’s output to a file:

bettercap -v --iface eth0 > tls_handshakes.log

9. Using Wireshark for Deeper Analysis

For even more detailed analysis, you can save the capture in PCAP format and open it with Wireshark. Wireshark provides a graphical interface to inspect all the TLS messages.

bettercap -v --iface eth0 --dump tcp_capture.pcap
Exit mobile version