تخطَّ إلى المحتوى

ssldump

ssldump is a network protocol analyzer specifically designed for SSL/TLS traffic. It captures SSL/TLS handshakes, decodes encrypted sessions, and analyzes protocol-level communications between clients and servers.

  • Capture and decode SSL/TLS handshake messages
  • Display certificate information in real-time
  • Analyze encrypted traffic at protocol level
  • Extract cryptographic parameters
  • Debug TLS configuration issues
  • Monitor certificate chain details
  • Support for modern SSL/TLS versions
  • Cross-platform availability
  • SSL/TLS protocol analysis and debugging
  • Certificate validation testing
  • Encryption strength verification
  • Handshake troubleshooting
  • Security testing and penetration testing
  • Protocol compliance verification
  • Vulnerability assessment
sudo apt-get update
sudo apt-get install ssldump
brew install ssldump
sudo yum install ssldump
wget https://sourceforge.net/projects/ssldump/files/ssldump-1.0.1/ssldump-1.0.1.tar.gz
tar xzf ssldump-1.0.1.tar.gz
cd ssldump-1.0.1
./configure
make
sudo make install
CommandPurpose
ssldump -i eth0Capture SSL/TLS traffic on eth0 interface
ssldump -i anyCapture on all available interfaces
ssldump port 443Filter capture to HTTPS traffic (port 443)
ssldump -r capture.pcapAnalyze SSL/TLS from saved PCAP file
ssldump -s 64Show first 64 bytes of decrypted data
ssldump -dPrint detailed decoding
ssldump -hDisplay help information
ssldump -vShow version information

Capture HTTPS Traffic on Default Interface

Section titled “Capture HTTPS Traffic on Default Interface”
sudo ssldump -i eth0 port 443

Shows SSL/TLS handshakes and session information as packets arrive.

sudo ssldump -i any port 443

Useful for multi-interface systems to catch traffic on any active connection.

sudo ssldump host 192.168.1.100

Filter to capture traffic with a specific host.

sudo ssldump 'host 192.168.1.100 and host 10.0.0.50'

Analyze communication between two specific systems.

ssldump -r capture.pcap

Analyze SSL/TLS from previously captured PCAP file without live capture.

ssldump -r capture.pcap -d

Display detailed protocol decoding of captured SSL/TLS sessions.

ssldump -r capture.pcap 'port 443'

Filter PCAP analysis to specific port.

ssldump -r capture.pcap > ssl_analysis.txt

Save SSL/TLS analysis to file for documentation.

Display Certificate Details During Handshake

Section titled “Display Certificate Details During Handshake”
sudo ssldump -i eth0 port 443

Captures and displays certificate information sent during TLS handshake:

New TCP connection #1: 192.168.1.100(55123) <-> 10.0.0.50(443)
1 1  0.0000 (0.0000)  C>S  Handshake
    ClientHello
1 2  0.0050 (0.0050)  S>C  Handshake
    ServerHello
1 3  0.0051 (0.0001)  S>C  Certificate
    Certificate chain:
    Certificate:
      Version: 3 (0x2)
      Serial Number: 0x1234567890abcdef
      Issuer: CN=server.example.com
      Subject: CN=server.example.com
sudo ssldump port 443 > cert_analysis.log

Extract certificate information from capture file for later review.

sudo ssldump -d port 443

Detailed output shows negotiated cipher suites and TLS versions:

ServerHello
  version: TLS 1.2 (0x0303)
  session_id: <hex>
  cipher_suite: ECDHE_RSA_AES_256_GCM_SHA384
  compression_method: NULL
sudo ssldump -d -i eth0 port 443

Shows complete TLS handshake message breakdown:

  • ClientHello with supported cipher suites
  • ServerHello with chosen cipher
  • Certificate exchange
  • Key exchange parameters
  • Finished messages
sudo ssldump -s 256 port 443

Display first 256 bytes of encrypted application data for analysis.

sudo ssldump -d port 443 2>&1 | tee session_analysis.txt

Capture both stdout and stderr to file for complete analysis.

# HTTPS only
sudo ssldump port 443

# SMTP over SSL (port 465)
sudo ssldump port 465

# IMAP over SSL (port 993)
sudo ssldump port 993

# Multiple ports
sudo ssldump 'port 443 or port 465 or port 993'
# Specific source
sudo ssldump src 192.168.1.100

# Specific destination
sudo ssldump dst 10.0.0.50

# Subnet
sudo ssldump net 192.168.1.0/24
# Specific host on specific port
sudo ssldump host 192.168.1.100 and port 443

# Exclude certain traffic
sudo ssldump 'port 443 and not host 192.168.1.50'

# Complex rules
sudo ssldump '(port 443 or port 465) and host 192.168.1.0/24'
# Connect to server and capture handshake
sudo ssldump host targetserver.com and port 443

Monitor certificate presentation and handshake process.

sudo ssldump -d port 443

Detailed output reveals where handshake fails:

ERROR: Alert
  Type: Fatal
  Description: Certificate Unknown
sudo ssldump -d port 443

Check negotiated TLS version in ServerHello:

version: TLS 1.3 (0x0303)    # Modern TLS 1.3
version: TLS 1.2 (0x0303)    # Older TLS 1.2
version: SSL 3.0 (0x0300)    # Deprecated SSL 3.0
sudo ssldump -d port 443 | grep cipher_suite

Verify server is selecting strong cipher suites.

# Capture raw packets then analyze with ssldump
sudo tcpdump -i eth0 'tcp port 443' -w capture.pcap

# Later analyze the capture
ssldump -r capture.pcap -d
# Monitor SSL/TLS while doing connectivity test
sudo ssldump -d port 443 &
DUMP_PID=$!

# Run your test
curl https://example.com

# Stop capture
kill $DUMP_PID
# Capture with timestamps
sudo ssldump port 443 -d > ssl_session_$(date +%Y%m%d_%H%M%S).log

# Review captured session
tail -100 ssl_session_*.log
#!/bin/bash
# Monitor multiple SSL/TLS ports
sudo ssldump '(port 443 or port 465 or port 993 or port 995)' -d | \
    tee multi_service_capture.log
# Capture and analyze
sudo ssldump -d port 443 > cert_details.txt

# Extract certificate from output
grep -A 50 "Certificate:" cert_details.txt
# Monitor connection to self-signed server
sudo ssldump host selfsigned.server.local and port 443

Output will show certificate details including:

Self-signed: Yes
Issuer: CN=selfsigned.server.local
Subject: CN=selfsigned.server.local
# Capture shows certificate validity
sudo ssldump -d port 443

# Output includes:
# Not Before: Jan 1 2023
# Not After: Dec 31 2024
# Monitor mutual TLS (mTLS) handshake
sudo ssldump -d 'host server and port 443'

Will show certificate exchange in both directions.

sudo ssldump -d port 443

Check cipher suite includes ECDHE or DHE:

cipher_suite: ECDHE_RSA_AES_256_GCM_SHA384

Good - uses ephemeral keys for forward secrecy.

cipher_suite: RSA_AES_256_CBC_SHA

Bad - uses static RSA keys, no forward secrecy.

# Make two connections and capture both
sudo ssldump -d port 443

Look for session_id reuse or session ticket in resumed connections.

# Use buffering for high-speed networks
sudo ssldump -B 100000 port 443

Increases internal buffer for less packet loss.

# Limit payload capture to 128 bytes
sudo ssldump -s 128 port 443

Reduces CPU usage when analyzing large volumes.

# Capture with tcpdump for Wireshark analysis
sudo tcpdump -i eth0 'tcp port 443' -w capture.pcap

# Then open in Wireshark with SSL/TLS dissector
wireshark capture.pcap

# Or analyze with ssldump
ssldump -r capture.pcap -d
# Capture traffic while testing with openssl
sudo ssldump port 443 &
DUMP_PID=$!

openssl s_client -connect example.com:443

kill $DUMP_PID
#!/bin/bash
# Analyze SSL/TLS traffic and generate report
INTERFACE="eth0"
DURATION=60

echo "Starting SSL/TLS capture for ${DURATION} seconds..."
sudo timeout $DURATION ssldump -i $INTERFACE port 443 -d > ssl_capture.txt

echo "Analysis:"
echo "========="
echo "Total handshakes:"
grep -c "ClientHello" ssl_capture.txt

echo "TLS versions used:"
grep "version:" ssl_capture.txt | sort | uniq -c

echo "Cipher suites negotiated:"
grep "cipher_suite:" ssl_capture.txt | sort | uniq -c

echo "Hosts contacted:"
grep "New TCP" ssl_capture.txt | awk '{print $7}' | sort | uniq

Issue: ssldump shows no output despite SSL traffic occurring.

Solution:

# Verify interface is correct
ip link show

# Try capturing all traffic first
sudo ssldump -i eth0

# Check if port filter is too restrictive
sudo ssldump 'port 443 or port 465'

Issue: Getting permission error when starting capture.

Solution:

# ssldump requires root or appropriate capabilities
sudo ssldump -i eth0

# Or grant capabilities (if preferred over sudo)
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/ssldump

Issue: Traffic captured but not properly decoded.

Solution:

# Ensure you're using correct TLS version flags
ssldump -r capture.pcap -d

# Check if traffic is actually SSL/TLS
tcpdump -r capture.pcap 'port 443' | head

# Verify with tcpdump first
tcpdump -i eth0 'port 443' -c 10
PracticeReason
Use in controlled environmentsAvoid privacy violations
Document authorizationEnsure proper authorization exists
Protect capture filesContains sensitive protocol data
Don’t store decrypted contentMinimize data retention
Review legal requirementsCheck applicable regulations
# Include timestamps
sudo ssldump port 443 | while read line; do
    echo "$(date '+%Y-%m-%d %H:%M:%S') $line"
done

# Rotate large captures
sudo ssldump -r capture.pcap | split -l 1000 - analysis_

# Archive captures
tar czf ssl_captures_$(date +%Y%m%d).tar.gz *.log
# Live capture on HTTPS
sudo ssldump port 443

# Detailed handshake analysis
sudo ssldump -d port 443

# Analyze saved capture
ssldump -r capture.pcap

# Specific host and detailed output
sudo ssldump -d host example.com

# Show encrypted payload (256 bytes)
sudo ssldump -s 256 port 443

# Save analysis to file
sudo ssldump -d port 443 > analysis.log

# Monitor with timestamps
sudo ssldump port 443 | while read l; do echo "$(date) $l"; done