CipherRun
A Fast, Modular, and Scalable TLS/SSL Security Scanner Written in Rust
CipherRun is a comprehensive TLS/SSL security scanner written in Rust, designed for superior performance, scalability, and modern security testing capabilities.
Author: Marc Rivero (@seifreed)
π’ IMPORTANT: This software is licensed under GPL-3.0. If you use or modify CipherRun:
- You MUST credit the author (Marc Rivero / @seifreed)
- You MUST publish your source code if distributing
- Modifications MUST use GPL-3.0 license
β¨ Features
Protocol Testing
- All SSL/TLS Protocols: SSLv2, SSLv3, TLS 1.0, TLS 1.1, TLS 1.2, TLS 1.3
- Full TLS 1.3 Support: Including 0-RTT and modern extensions
- Legacy Protocol Testing: Complete SSLv2/SSLv3 support for compliance checks
Cipher Suite Analysis
- 400+ Cipher Suites: Comprehensive cipher testing database
- Per-Protocol Analysis: Test ciphers for each TLS version
- Strength Categories: NULL, Export, Low, Medium, High
- Forward Secrecy Detection: ECDHE/DHE cipher identification
- AEAD Support: Modern authenticated encryption detection
π‘Vulnerability Detection (18 Checks)
- Heartbleed (CVE-2014-0160)
- CCS Injection (CVE-2014-0224)
- Ticketbleed
- ROBOT (Return of Bleichenbacher's Oracle Threat)
- POODLE (SSL & TLS variants)
- BEAST (CVE-2011-3389)
- CRIME (CVE-2012-4929)
- BREACH (CVE-2013-3587)
- SWEET32 (CVE-2016-2183)
- FREAK (CVE-2015-0204)
- LOGJAM (CVE-2015-4000)
- DROWN (CVE-2016-0800)
- LUCKY13 (CVE-2013-0169)
- RC4 Biases
- Renegotiation Issues
- TLS_FALLBACK_SCSV
- Winshock
- STARTTLS Injection
Certificate Analysis
- Chain Validation: Against 5 major CA stores (Mozilla, Apple, Linux, Microsoft, Java)
- Revocation Checking: CRL and OCSP support
- Certificate Details: Subject, SAN, validity, key strength, signature algorithms
- Trust Chain Verification: Complete chain analysis
- Extended Validation (EV): EV certificate detection
HTTP Security Headers
- HSTS (HTTP Strict Transport Security)
- HPKP (HTTP Public Key Pinning) - Deprecated, still checked
- CSP (Content Security Policy)
- X-Frame-Options, X-XSS-Protection, X-Content-Type-Options
- Cookie Security: Secure, HttpOnly, SameSite flags
- Server Fingerprinting: Banner and version detection
Client Simulation
- 126+ Client Profiles: Real-world browser and OS handshakes
- Compatibility Testing: Determine which clients can connect
- Protocol & Cipher Negotiation: See what each client would use
SSL Labs Rating
- Complete Implementation: Based on SSL Labs Rating Guide
- Comprehensive Grading: A+ through F ratings
- Smart Capping: Grade limits based on vulnerabilities and weaknesses
STARTTLS Support (14 Protocols)
- SMTP, IMAP, POP3, LMTP
- FTP, LDAP
- PostgreSQL, MySQL
- XMPP (Client & Server), IRC
- NNTP
- ManageSieve (Sieve)
- Telnet
Output Formats
- Terminal: Colorized, formatted output
- JSON: Flat and Pretty variants
- CSV: Spreadsheet-compatible
- HTML: Rich, styled reports
- Log Files: Complete session logs
Mass Scanning
- Parallel Mode: Test multiple hosts concurrently
- Serial Mode: Sequential testing
- Configurable Workers: Control parallelism level
- MX Record Testing: Scan all mail servers for a domain
π¦ Installation
From Source
# Clone the repository
# Build with cargo
# The binary will be in target/release/cipherrun
Using Cargo
π Quick Start
Basic Usage
# Scan a single host
# Scan with specific port
# Scan HTTPS URL
Protocol Testing
# Test all protocols
# Test cipher suites
Vulnerability Scanning
# All vulnerabilities
# Specific vulnerabilities
STARTTLS Testing
# SMTP
# IMAP
# Test all MX records for a domain
Output Formats
# JSON output
# JSON (pretty-printed)
# CSV output
# HTML report
# All formats at once
Mass Scanning
# Create targets file (one target per line)
# Scan serially
# Scan in parallel (default: 20 concurrent)
# Custom parallelism
# Export results
Usage Examples
PCI DSS Compliance Check
# Check PCI DSS requirements:
# - No SSLv2/SSLv3
# - No TLS 1.0/1.1
# - No weak ciphers
# - Strong certificate
Mail Server Security Audit
# Test SMTP with STARTTLS
API Endpoint Testing
# Test multiple API endpoints in parallel
Continuous Security Monitoring
#!/bin/bash
# Weekly security scan script
DATE=
REPORT_DIR="./reports/"
# Scan critical hosts
# Check for vulnerabilities and alert
if ; then
|
fi
πArchitecture
CipherRun is built with a modular architecture:
cipherrun/
βββ src/
β βββ cli/ # Command-line interface
β βββ protocols/ # TLS/SSL protocol handling
β βββ ciphers/ # Cipher suite management
β βββ vulnerabilities/ # Vulnerability tests (18 checks)
β βββ certificates/ # Certificate analysis
β βββ http/ # HTTP header testing
β βββ client_sim/ # Client simulation
β βββ rating/ # SSL Labs rating
β βββ starttls/ # STARTTLS protocols (14 types)
β βββ output/ # Output formatters
β βββ scanner/ # Main scanning engine
β βββ data/ # Data file parsing
β βββ utils/ # Utilities
βββ data/ # Reference data
β βββ cipher-mapping.txt # 400+ cipher definitions
β βββ client-simulation.txt # 126+ client profiles
β βββ Mozilla.pem # Mozilla CA store
β βββ Apple.pem # Apple CA store
β βββ Linux.pem # Linux CA store
β βββ Microsoft.pem # Microsoft CA store
β βββ Java.pem # Java CA store
βββ tests/ # Integration tests
Key Design Principles
- Modularity: Each feature is encapsulated in its own module
- Performance: Async/await with Tokio for efficient concurrency
- Scalability: Designed to scan thousands of hosts efficiently
- Accuracy: Precise implementation of security checks
- Maintainability: Clear code structure, comprehensive tests
β‘ Performance
CipherRun is optimized for speed:
- Async I/O: Built on Tokio runtime
- Parallel Testing: Multiple hosts and checks concurrently
- Minimal Allocations: Low memory footprint
- Smart Caching: DNS, certificate chains, protocol results
- Connection Reuse: Efficient connection management
Benchmarks
On a typical modern system:
- Single Host Scan: ~1-3 seconds (full test suite)
- Parallel Scanning: 100+ hosts per minute
- Memory Usage: < 50MB per scan
- CPU Usage: Scales with available cores
Command-Line Options
Usage: cipherrun [OPTIONS] [URI]
Arguments:
[URI] Target URI (host:port or URL)
Options:
-f, --file <FILE> Input file with multiple targets
--mx <DOMAIN> Test MX records for a domain
-t, --starttls <PROTOCOL> STARTTLS protocol (smtp, imap, pop3, etc.)
-p, --protocols Test all protocols
-e, --each-cipher Test all ciphers
-E, --cipher-per-proto Test ciphers per protocol
-s, --std Test standard cipher categories
--fs, --fs-only Forward secrecy ciphers only
-U, --vulnerable Test all vulnerabilities
-H, --heartbleed Test Heartbleed
-I, --ccs, --ccs-injection Test CCS injection
--ticketbleed Test Ticketbleed
--robot Test ROBOT
-O, --poodle Test POODLE (SSL)
-B, --beast Test BEAST
-C, --crime Test CRIME
--breach Test BREACH
--sweet32 Test SWEET32
-F, --freak Test FREAK
-J, --logjam Test LOGJAM
-D, --drown Test DROWN
-4 Use IPv4 only
-6 Use IPv6 only
-9, --full Include tests that take a while
--json <FILE> JSON output file
--json-pretty Pretty-print JSON
--csv <FILE> CSV output file
--html <FILE> HTML output file
-q, --quiet Quiet mode (no banner)
-v, --verbose Verbose output
--parallel Parallel scanning mode
--max-parallel <N> Max parallel workers [default: 20]
-h, --help Print help
-V, --version Print version
Docker Testing Environment
CipherRun includes a complete Docker testing environment with network analysis tools for debugging and development:
Quick Start with Docker
# Build and start environment
# Test a domain
# Compare ClientHello packets (for debugging TLS issues)
# Run batch tests
# Enter container for manual testing
Tools Included
- Network Analysis: tcpdump, tshark, nmap
- SSL/TLS Tools: openssl, sslscan, testssl.sh
- CipherRun: Built in release mode
- Automated Scripts: Traffic capture, ClientHello comparison, batch testing
Docker Commands
See docs/DOCKER.md for complete Docker documentation.
π§ͺ Testing
CipherRun includes comprehensive test coverage:
Unit Tests
# Run all unit tests
# Run with output
Integration Tests
# Run integration tests (requires network)
Real Server Testing
CipherRun's integration tests use real servers:
- badssl.com: Various TLS misconfigurations
- Gmail SMTP/IMAP: STARTTLS testing
- Major websites: Google, GitHub, Cloudflare
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
# Install Rust (if not already installed)
|
# Clone and build
# Run tests
# Run with logging
RUST_LOG=debug
License
CipherRun is licensed under the GNU General Public License v3.0.
What This Means
You CAN:
- β Use CipherRun for personal or commercial purposes
- β Modify the source code
- β Distribute copies of the software
- β Distribute your modifications
Summary:
- Free to use - No cost, for any purpose
- Attribution required - You must credit the author
- Open source required - Modifications must be published
- Copyleft - Derivative works must use GPL-3.0
Why GPL-3.0?
This license ensures that:
- The software remains free and open source forever
- Contributors get proper credit
- Improvements benefit the entire community
- No one can make a closed-source derivative
See LICENSE for full legal text.
β Support the Project
If you find CipherRun useful, consider supporting its development:
Your support helps maintain and improve CipherRun. Thank you! π