Expand description
MITM Proxy with Transparent Traffic Interception
This crate provides a man-in-the-middle (MITM) proxy implementation similar to Burp Suite, allowing transparent interception and modification of HTTP/HTTPS traffic.
§Features
- Automatic CA certificate generation
- Transparent HTTPS interception using rustls backend
- Traffic interception and modification interfaces
- Reuses slinger’s Socket implementation
§Example
use slinger_mitm::{MitmProxy, MitmConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = MitmConfig::default();
let proxy = MitmProxy::new(config).await?;
proxy.start("127.0.0.1:8080").await?;
Ok(())
}Structs§
- Certificate
Authority - Certificate Authority for generating certificates
- Certificate
Manager - Manager for caching generated server certificates
- Interceptor
Factory - Factory for creating pre-built interceptors
- Interceptor
Handler - Combined interceptor handler for both HTTP and TCP traffic Manages automatic correlation between requests and responses via session IDs
- Logging
Interceptor - Logging interceptor implementation that handles both HTTP and TCP traffic
- Mitm
Config - Configuration for MITM proxy
- Mitm
Proxy - MITM Proxy main struct
- Mitm
Request - MITM Request wrapper that wraps slinger::Request with connection metadata. Used for both HTTP and non-HTTP (raw TCP) traffic interception.
- Mitm
Response - MITM Response wrapper that wraps slinger::Response with connection metadata. Used for both HTTP and non-HTTP (raw TCP) traffic interception.
- Proxy
Server - Proxy server implementation
- Proxy
Server Builder - Builder for
ProxyServer. - Socks5
Server - SOCKS5 server for MITM proxy
Enums§
- Error
- Error types for MITM proxy operations
- Target
Addr - SOCKS5 target address
Traits§
- Interceptor
- Unified trait for intercepting both requests and responses with automatic correlation This trait is recommended over separate RequestInterceptor and ResponseInterceptor as it provides automatic session correlation between requests and responses.
Type Aliases§
- Result
- Result type for MITM operations