SSLScan
Installation
Sezione intitolata “Installation”Debian/Ubuntu
Sezione intitolata “Debian/Ubuntu”sudo apt-get install sslscan
RHEL/CentOS
Sezione intitolata “RHEL/CentOS”sudo yum install sslscan
brew install sslscan
From Source
Sezione intitolata “From Source”git clone https://github.com/rbsec/sslscan.git
cd sslscan
./configure
make
sudo make install
docker pull nmap/nmap:latest
docker run -it nmap/nmap sslscan example.com:443
Basic Scanning
Sezione intitolata “Basic Scanning”Simple Host Scan
Sezione intitolata “Simple Host Scan”sslscan example.com
sslscan example.com:443
Scan Non-Standard Port
Sezione intitolata “Scan Non-Standard Port”sslscan example.com:8443
Verbose Output
Sezione intitolata “Verbose Output”sslscan --no-failed example.com
sslscan -v example.com
Quiet Mode
Sezione intitolata “Quiet Mode”sslscan -q example.com
Certificate Details
Sezione intitolata “Certificate Details”View Certificate Information
Sezione intitolata “View Certificate Information”sslscan --show-certificate example.com
Extract Certificate Chain
Sezione intitolata “Extract Certificate Chain”sslscan --show-certificate example.com | grep -A 50 "Certificate"
Check Certificate Expiry
Sezione intitolata “Check Certificate Expiry”echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -dates
Validate Certificate Chain
Sezione intitolata “Validate Certificate Chain”sslscan --show-certificate example.com
Certificate Issuer Details
Sezione intitolata “Certificate Issuer Details”openssl s_client -connect example.com:443 </dev/null 2>/dev/null | openssl x509 -text -noout
Cipher Enumeration
Sezione intitolata “Cipher Enumeration”List All Supported Ciphers
Sezione intitolata “List All Supported Ciphers”sslscan example.com
Identify Weak Ciphers
Sezione intitolata “Identify Weak Ciphers”sslscan example.com | grep -i "weak"
Filter by Cipher Strength
Sezione intitolata “Filter by Cipher Strength”sslscan example.com | grep -E "256|128|64"
Export Cipher List
Sezione intitolata “Export Cipher List”sslscan example.com > ciphers.txt
Test Specific Cipher
Sezione intitolata “Test Specific Cipher”openssl s_client -connect example.com:443 -cipher 'DES-CBC3-SHA' 2>/dev/null | head -n 20
Protocol Detection
Sezione intitolata “Protocol Detection”Check SSL/TLS Versions
Sezione intitolata “Check SSL/TLS Versions”sslscan example.com
Test for SSLv2 (Deprecated)
Sezione intitolata “Test for SSLv2 (Deprecated)”sslscan example.com | grep -i "sslv2"
Test for SSLv3 (Deprecated)
Sezione intitolata “Test for SSLv3 (Deprecated)”sslscan example.com | grep -i "sslv3"
Test for TLS 1.0/1.1 (Legacy)
Sezione intitolata “Test for TLS 1.0/1.1 (Legacy)”sslscan example.com | grep -E "TLSv1\.0|TLSv1\.1"
Test for TLS 1.2+
Sezione intitolata “Test for TLS 1.2+”sslscan example.com | grep -E "TLSv1\.[2-3]"
Protocol-Specific Tests
Sezione intitolata “Protocol-Specific Tests”openssl s_client -connect example.com:443 -ssl2 # SSLv2
openssl s_client -connect example.com:443 -ssl3 # SSLv3
openssl s_client -connect example.com:443 -tls1 # TLSv1.0
openssl s_client -connect example.com:443 -tls1_1 # TLSv1.1
openssl s_client -connect example.com:443 -tls1_2 # TLSv1.2
openssl s_client -connect example.com:443 -tls1_3 # TLSv1.3
Vulnerability Detection
Sezione intitolata “Vulnerability Detection”Check for Heartbleed (CVE-2014-0160)
Sezione intitolata “Check for Heartbleed (CVE-2014-0160)”sslscan example.com | grep -i "heartbleed"
Test Heartbleed Directly
Sezione intitolata “Test Heartbleed Directly”echo -n "Q" | openssl s_client -connect example.com:443 2>/dev/null | grep -i heartbeat
Check for POODLE (CVE-2014-3566)
Sezione intitolata “Check for POODLE (CVE-2014-3566)”sslscan example.com | grep -i "poodle\|sslv3"
Check for BEAST (CVE-2011-3389)
Sezione intitolata “Check for BEAST (CVE-2011-3389)”sslscan example.com | grep -E "TLSv1\.0|CBC"
Check for CRIME (CVE-2012-4929)
Sezione intitolata “Check for CRIME (CVE-2012-4929)”sslscan example.com | grep -i "compression"
Check for FREAK (CVE-2015-0204)
Sezione intitolata “Check for FREAK (CVE-2015-0204)”sslscan example.com | grep -i "weak.*key\|512.*rsa"
Check for RC4 (Weak Cipher)
Sezione intitolata “Check for RC4 (Weak Cipher)”sslscan example.com | grep -i "rc4"
Check for DROWN (CVE-2016-0800)
Sezione intitolata “Check for DROWN (CVE-2016-0800)”sslscan example.com | grep -i "sslv2"
Full Vulnerability Report
Sezione intitolata “Full Vulnerability Report”sslscan --no-failed example.com | grep -iE "vulnerable|weak|sslv2|sslv3|heartbleed|poodle"
STARTTLS Support
Sezione intitolata “STARTTLS Support”SMTP (Port 25/587)
Sezione intitolata “SMTP (Port 25/587)”sslscan --starttls example.com:25
sslscan --starttls example.com:587
IMAP (Port 143)
Sezione intitolata “IMAP (Port 143)”sslscan --starttls example.com:143
POP3 (Port 110)
Sezione intitolata “POP3 (Port 110)”sslscan --starttls example.com:110
FTP (Port 21)
Sezione intitolata “FTP (Port 21)”sslscan --starttls example.com:21
LDAP (Port 389)
Sezione intitolata “LDAP (Port 389)”sslscan --starttls example.com:389
XMPP (Port 5222)
Sezione intitolata “XMPP (Port 5222)”sslscan --starttls example.com:5222
Check STARTTLS Availability
Sezione intitolata “Check STARTTLS Availability”echo "EHLO example.com" | nc example.com 25 | grep -i "starttls"
Output Formats
Sezione intitolata “Output Formats”XML Output
Sezione intitolata “XML Output”sslscan --xml=report.xml example.com
Parse XML Report
Sezione intitolata “Parse XML Report”cat report.xml | grep -E "protocol|cipher|certificate"
Human-Readable Output
Sezione intitolata “Human-Readable Output”sslscan example.com > report.txt
JSON-like Format (via grep)
Sezione intitolata “JSON-like Format (via grep)”sslscan example.com | awk '{print $0}' > report.json
Redirect to File
Sezione intitolata “Redirect to File”sslscan example.com 2>&1 | tee report.log
Generate and Compare Reports
Sezione intitolata “Generate and Compare Reports”sslscan example.com > baseline.txt
sslscan example.com > current.txt
diff baseline.txt current.txt
Batch Scanning
Sezione intitolata “Batch Scanning”Scan Multiple Hosts from List
Sezione intitolata “Scan Multiple Hosts from List”cat hosts.txt | while read host; do sslscan "$host" >> results.txt; done
Scan Host List with Ports
Sezione intitolata “Scan Host List with Ports”while IFS=: read -r host port; do sslscan "$host:$port" >> batch-results.txt; done < hosts.txt
Parallel Batch Scanning
Sezione intitolata “Parallel Batch Scanning”cat hosts.txt | xargs -P 5 -I {} sslscan {} > batch-results.txt
Scan Entire CIDR Range (via nmap)
Sezione intitolata “Scan Entire CIDR Range (via nmap)”nmap -p 443 10.0.0.0/24 -oG - | awk '/open/{print $2}' | while read ip; do sslscan "$ip"; done
Store Results in Database
Sezione intitolata “Store Results in Database”for host in $(cat hosts.txt); do
sslscan --xml="$host.xml" "$host"
echo "Scanned: $host"
done
Track Changes Over Time
Sezione intitolata “Track Changes Over Time”timestamp=$(date +%Y%m%d_%H%M%S)
sslscan example.com > "scans/example_$timestamp.txt"
Client Certificate Testing
Sezione intitolata “Client Certificate Testing”Scan with Client Certificate
Sezione intitolata “Scan with Client Certificate”sslscan --client-cert=cert.pem --client-key=key.pem example.com
Test Mutual TLS (mTLS)
Sezione intitolata “Test Mutual TLS (mTLS)”openssl s_client -cert client.pem -key client-key.pem -connect example.com:443
Verify Client Certificate Chain
Sezione intitolata “Verify Client Certificate Chain”openssl verify -CAfile ca-chain.pem client.pem
Extract Client Certificate from File
Sezione intitolata “Extract Client Certificate from File”openssl x509 -in client.pem -text -noout
OCSP Stapling
Sezione intitolata “OCSP Stapling”Check OCSP Stapling Status
Sezione intitolata “Check OCSP Stapling Status”echo | openssl s_client -connect example.com:443 -tlsextdebug 2>/dev/null | grep -A 2 "OCSP"
Verify OCSP Response
Sezione intitolata “Verify OCSP Response”echo | openssl s_client -connect example.com:443 -status 2>/dev/null | grep "OCSP response"
Detailed OCSP Check
Sezione intitolata “Detailed OCSP Check”openssl s_client -connect example.com:443 -tlsextdebug 2>&1 | grep -i "ocsp"
Advanced Options
Sezione intitolata “Advanced Options”Disable SNI (Server Name Indication)
Sezione intitolata “Disable SNI (Server Name Indication)”sslscan --no-sni example.com
Set Custom Timeout
Sezione intitolata “Set Custom Timeout”sslscan --timeout=10 example.com
Specify IP Address
Sezione intitolata “Specify IP Address”sslscan --ip=192.168.1.1 example.com
Skip Host Name Verification
Sezione intitolata “Skip Host Name Verification”sslscan --no-sni example.com
Test All Named Hosts (SNI)
Sezione intitolata “Test All Named Hosts (SNI)”sslscan example.com
sslscan mail.example.com
Comparison: SSLScan vs testssl.sh vs sslyze
Sezione intitolata “Comparison: SSLScan vs testssl.sh vs sslyze”| Feature | SSLScan | testssl.sh | sslyze |
|---|---|---|---|
| Language | C/C++ | Bash | Python |
| Speed | Fast | Medium | Fast |
| Protocols | SSL/TLS | SSL/TLS/HTTP/DNS | SSL/TLS |
| Vulnerability Checks | Basic | Comprehensive | Good |
| STARTTLS Support | Yes | Yes | Yes |
| Output Formats | Text, XML | Text, JSON, CSV | Text, JSON |
| Installation | Easy | No deps | Python required |
| Community | Active | Very Active | Active |
| CVE Coverage | Standard | Extensive | Good |
| Best For | Quick scans | Deep audits | Automated checks |
When to Use SSLScan
Sezione intitolata “When to Use SSLScan”- Quick SSL/TLS configuration checks
- Simple vulnerability screening
- Batch scanning multiple hosts
- Resource-constrained environments
- CI/CD integration
When to Use testssl.sh
Sezione intitolata “When to Use testssl.sh”- Comprehensive security audits
- Deep vulnerability analysis
- Regulatory compliance checks
- Edge case testing
- Maximum CVE coverage
When to Use sslyze
Sezione intitolata “When to Use sslyze”- Automated security testing
- Python integration
- API-based scanning
- CI/CD pipelines
- Large-scale assessments
Real-World Examples
Sezione intitolata “Real-World Examples”Audit Web Server Configuration
Sezione intitolata “Audit Web Server Configuration”sslscan --show-certificate example.com | tee audit.txt
Monitor Certificate Expiry
Sezione intitolata “Monitor Certificate Expiry”echo | openssl s_client -connect example.com:443 2>/dev/null | openssl x509 -noout -dates
Identify Non-Compliant Hosts
Sezione intitolata “Identify Non-Compliant Hosts”sslscan example.com | grep -E "sslv2|sslv3|TLSv1\.0|weak" && echo "Non-compliant" || echo "Compliant"
Generate Compliance Report
Sezione intitolata “Generate Compliance Report”sslscan --no-failed example.com > compliance-report.txt
Test After Configuration Change
Sezione intitolata “Test After Configuration Change”sslscan example.com > before.txt
# Update SSL/TLS config
sslscan example.com > after.txt
diff before.txt after.txt
Find All Weak Ciphers in Environment
Sezione intitolata “Find All Weak Ciphers in Environment”for host in web1 web2 web3; do
echo "=== $host ===" >> weak-ciphers.txt
sslscan "$host" | grep -i "weak" >> weak-ciphers.txt
done