Crate slinger_mitm

Crate slinger_mitm 

Source
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§

CertificateAuthority
Certificate Authority for generating certificates
CertificateManager
Manager for caching generated server certificates
Interceptor
Default pass-through interceptor
InterceptorHandler
Combined interceptor handler for both HTTP and TCP traffic
LoggingInterceptor
Logging interceptor implementation that handles both HTTP and TCP traffic
MitmConfig
Configuration for MITM proxy
MitmProxy
MITM Proxy main struct
MitmRequest
MITM Request wrapper that wraps slinger::Request with connection metadata. Used for both HTTP and non-HTTP (raw TCP) traffic interception.
MitmResponse
MITM Response wrapper that wraps slinger::Response with connection metadata. Used for both HTTP and non-HTTP (raw TCP) traffic interception.
ProxyServer
Proxy server implementation
ProxyServerBuilder
Builder for ProxyServer.
Socks5Server
SOCKS5 server for MITM proxy

Enums§

Error
Error types for MITM proxy operations
TargetAddr
SOCKS5 target address

Traits§

RequestInterceptor
Trait for intercepting and modifying requests (both HTTP and raw TCP)
ResponseInterceptor
Trait for intercepting and modifying responses (both HTTP and raw TCP)

Type Aliases§

Result
Result type for MITM operations