A powerful Man-In-The-Middle proxy utility for intercepting, inspecting, and modifying HTTP/HTTPS traffic.
- Intercepts and modifies both HTTP and HTTPS traffic
- Dynamic TLS certificate generation for HTTPS connections
- Rule-based system for conditional traffic modification
- Support for custom Go scripts to modify requests and responses
- WebSocket connection handling
- Environment variable integration
- Go 1.18 or higher
- OpenSSL (for generating CA certificates)
-
Clone the repository:
git clone https://github.com/eugene-ivanov-hash/mitm-proxy.git cd mitm-proxy
-
Generate CA certificate and key:
openssl genrsa -out ca.key 2048 openssl req -new -x509 -days 3650 -key ca.key -out ca.crt -subj "/CN=MITM Proxy CA"
-
Build the application:
go build -o mitm-proxy
-
Add the CA certificate to your system's trusted certificates (see Installation Guide)
Start the proxy:
./mitm-proxy -cacertfile ca.crt -cakeyfile ca.key
Configure your client to use the proxy (default: 127.0.0.1:9999
).
For more options:
./mitm-proxy -help
Rules are defined in YAML files in the proxy_rules
directory:
enabled: true
rules:
- name: "Add Custom Header"
enabled: true
change: "request"
rule: "req.URL.Host == 'example.com'"
action: "script"
script: |
req.Header.Add("X-Custom-Header", "CustomValue")
return nil
For detailed documentation, see the docs directory:
See the LICENSE file for details.