hudsucker
Hudsucker is a MITM HTTP/S proxy written in Rust.
Features
- Modify HTTP/S requests
- Modify HTTP/S responses
- Modify websocket messages
Usage
For usage, refer to the provided examples.
Hudsucker is a MITM HTTP/S proxy written in Rust.
For usage, refer to the provided examples.
Hi man, thank you for your project first.
But I'm stucked when running the log.rs in your examples directory.
I just copy src/example/log.rs to src/main.rs and src/example/ca to src/ca and add env_logger = "0.9" to [denpendencies] and then cargo run.
After install the hudsucker.pem to my computer ( Trusted Root Certification Authorities ) and setting my web proxy to 127.0.0.1:3000 , I got the error log:
thread 'tokio-runtime-worker' panicked at 'Failed to establish TLS connection with client: Custom { kind: InvalidData, error: AlertReceived(CertificateUnknown) }', C:\Users\forti\IdeaProjects\hudsucker\src\proxy.rs:137:30 [2021-11-03T05:46:55Z ERROR rustls::session] TLS alert received: Message { typ: Alert, version: TLSv1_3, payload: Alert( AlertMessagePayload { level: Fatal, description: CertificateUnknown, }, ), }
Waiting for your response, thank you.
Could you please tell me how to modify the response?
I tried to get the specific content of the body in the closure and convert it to a string, but now I can't await
it in the closure.
Hello, your crate is amazing! Love it! I am providing user pass for the proxy i.e http://user:pass@localhost:3000/some/random/path Is it possible to parse URI of the proxy /some/random/path and basic auth user:pass ? Stuck here, need some help to figure this out...
Firefox seems to block certificates if they use an already seen serial number.
This generates a random serial number for each certificate generated by OpenSSL.
Sometimes we need to determine the request
and then modify the response
.
In this case, there is a need to have a context
to synchronize some data that is obtained from the request
and then use them when modifying response
.
I think we can add a context
struct to struct Proxy
, and pass its borrow to both requestHandler
and responseHandler
closures along with the req
or res
.
Is there an example for MITMing HTTPS requests without ever hitting the original web server? If I just create a new response in the handle_request
I get a generic "connection closed" error. I did a bit of digging through your code and I tried returning an empty response for CONNECT
requests but that also didn't help. I'm assuming I'm missing something simple.
Thanks!
Hey there @omjadas, thank you for this! I'm totally planning on using this in a project of mine and will report back. Perhaps this is just useless noise, but IDK I often like to know if stuff I'm making out of the goodness of my heart is being used...so now you know! Just a hobby project mind you, but still. Super cool that you built/are building something like this!
Hello, @omjadas ! I maintain my own open source project, you can find it here. My project relies on your library, so, first of all, I want to express my gratitude to you for this cool library. I would like to offer you to refer my project in readme of yours (or in any other way) as example of software that uses your library. You also can find that I have already referred your project in readme of mine. I believe that this can help me to find some contributors and keep improving the project. I would appreciate any feedback.
Hello!
The issue is pretty simple. If certificate for a site created with OpensslAuthority
, this authority sets CN to DNS name of site: https://github.com/omjadas/hudsucker/blob/main/src/certificate_authority/openssl_authority.rs#L74
But RcgenAuthority
does not do that, it places DNS name only in Alt Names
: https://github.com/omjadas/hudsucker/blob/main/src/certificate_authority/rcgen_authority.rs#L85
This issue leads to browsers reject certificates signed with RcgenAuthority, because there is no appropriate CN.
I would like to request a fix for this, please. Probably, I could do a pull-request, but I have not enough free time :(
Thanks for your crate
My use case is that when I usewith_http_handler/with_incoming_message_handler/with_outgoing_message_handler
, I want to store the request & response. In the current case, it looks like the only way to store it is to create global mutables using something like lazy_static. Switching to anonymous functions we can easily create Arc<Mutex<>>
in any context to store the data. what do you think about this?
⚠️ Dependabot is rebasing this PR ⚠️
Rebasing might not happen immediately, so don't worry if this takes some time.
Note: if you make any changes to this PR yourself, they will take precedence over the rebase.
Updates the requirements on hyper-tungstenite to permit the latest version.
Sourced from hyper-tungstenite's changelog.
v0.6.0 - 2022-02-20
- Update to
tungstenite
0.17.v0.5.0 - 2021-11-19
- Update to
tungstenite
0.16.v0.4.2 - 2021-11-19
- Fix link in documentation for re-exported
tungstenite
crate.v0.4.1 - 2021-10-17
- Update the example to a full server application.
v0.4.0 - 2021-08-28
- Upgrade to
tokio-tungstenite
0.15.v0.3.3 - 2021-06-11
- Remove
sha-1
andbase64
dependency by using upstreamderive_accept_key
.v0.3.2 - 2021-04-11
- Derive
Debug
forHyperWebsocket
to facilitate debugging.v0.3.1 - 2021-04-03
- Replace unsafe code with
pin-project
andtokio::pin!()
.v0.3.0 - 2021-03-02
- Publicly re-export the
hyper
crate.- Upgrade to
tokio-tungstenite
0.14 andtungstenite
0.13.v0.2.1 - 2021-02-12
- Inspect all
Connection
andUpgrade
headers inis_upgrade_request()
.- Inspect all comma separated values in
Connection
headers inis_upgrade_request()
(this was already done forUpgrade
headers).v0.2.0 - 2021-02-06
- Rename
upgrade_requested
tois_upgrade_request
.v0.1.1 - 2021-02-06
- Fix category slug in Cargo manifest.
v0.1.0 - 2021-02-06
- Initial release.
d38997f
Bump version to 0.6.0.c7ac330
Merge pull request #9 from omjadas/chore/tungstenite-updatef221de6
Update to tungstenite 0.17.Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)This is a noob question, not really an issue. I'm trying to stream a response and then do stuff after that finishes. Specifically (for now) I'm computing a sha256 of the response body, and need to call finalize()
. Here's one attempt to do that: https://github.com/nlevitt/warcprox-rs/blob/master/src/main.rs
You can run this with cargo run
and in another terminal execute for example curl -k -gvsS --proxy http://127.0.0.1:8000 https://example.com/
.
The problem is that the None
case in poll_next()
is never called.
It would be even nicer to be be able to chain some sort of finally
to the end of the body stream, but I'm not sure if that's possible. https://github.com/nlevitt/warcprox-rs/blob/stream-combinators/src/main.rs#L63
hi, i'm sorry but i'm very noob with rust so i think that this is a stupid question
i'm trying to use hudsucker; i put hudsucker = "0.18.0"
on my Cargo.toml, but running cargo build
i get
Updating crates.io index
error: failed to select a version for the requirement `hudsucker = "^0.18.0"`
candidate versions found which didn't match: 0.16.1, 0.16.0, 0.15.0, ...
location searched: crates.io index
it works using 0.16.1
what am i doing wrong?
thanks in advance
CN
for certificates generated using RcgenAuthority
CONNECT
requestFrom<Request<Body>>
and From<Response<Body>>
impls for RequestOrResponse
non_exhaustive
hyper-tungstenite
tokio-tungstenite
tokio_tungstenite::Connector
s to be specifieddecoder
feature when full
feature is enabledopenssl-certs
feature to openssl-ca
rcgen-certs
feature to rcgen-ca
CONNECT
requests through request handlerNot Before
by -60 seconds for generated certificatesdecoder
feature for decode_request
and decode_response
moka
hyper-tungstenite
tokio-tungstenite
tokio-util
Error
as non_exhaustive
rcgen
moka
Proxy
when calling start
full
featurehyper-rustls
featureProxy
, ProxyBuilder
structsHyper
clients to be usedrcgen-certs
feature enabledhyper-rustls
tokio-rustls
hyper-tungstenite
tokio-tungstenite
decode_request
functionContent-Encoding: identity
Proxyswarm Proxyswarm is a lightweight proxy that allows redirect HTTP(S) traffic through a proxy. WARNING: This app isn't recomended for download lar
?? TCP over HTTP ?? The Questions ?? What does it do? You can proxy TCP traffic over HTTP. A basic setup would be: [Your TCP target] <--TCP-- [Exit No
tokio-vmess an Asynchronous proxy implement with http / socks5 in-bound and vmess out-bound, written in Rust and tokio Run example first, Fill out the
September A simple and efficient Gemini-to-HTTP proxy written in Rust. Usage Docker $ docker run -d [ -e ROOT="gemini://fuwn.me" ] [ -e PORT="8080"] [
The of-watchdog implements an HTTP server listening on port 8080, and acts as a reverse proxy for running functions and microservices. It can be used independently, or as the entrypoint for a container with OpenFaaS.
Sentry Tunnel This is a proxy that forwards tunneled sentry requests to the real sentry server. The implementation is based on the explanation provide
udppp UDP proxy with Proxy Protocol and mmproxy support. Features Async Support Proxy Protocol V2 SOCKET preserve client IP addresses in L7 proxies(mm
web3-proxy Web3-proxy is a fast caching and load balancing proxy for web3 (Ethereum or similar) JsonRPC servers. Signed transactions (eth_sendRawTrans
Docker registry server and proxy (I'm bad at creating catchy names, but this one is good enough.) This project aims to implement a Docker Registry HTT
Autobahn A remote shell, TCP tunnel and HTTP proxy for Replit. Hybrid SSH/HTTP server for Replit. Based on leon332157/replish. Autobahn runs a WebSock
ptproxy Motivation What's this? Why do I need this? What's a sensitive network link? What's wrong with a VPN? What's wrong with HTTP[S]? What's wrong
CthulhuRs A high performance http proxy server A browser extensions platform A net packet capture tool Demonstration Main features of CthulhuRs Inject
rathole A fast and stable reverse proxy for NAT traversal, written in Rust rathole, like frp, can help to expose the service on the device behind the
RCProxy - a lightweight, fast but powerful Redis Cluster Proxy written in Rust
server-security-proxy server security proxy write by Rust how to use config toml file
Fourth 这一波在第四层。 English Fourth是一个Rust实现的Layer 4代理,用于监听指定端口TCP流量,并根据规则转发到指定目标。 功能 监听指定端口代理到本地或远端指定端口 监听指定端口,通过TLS ClientHello消息中的SNI进行分流 安装方法 为了确保获得您架构
rsocx A high performence Socks5 proxy server with bind/reverse support implementation by Rust Features Async-std No unsafe code Single executable Linu
Brachyura A reverse proxy, which I am primarily using as a Rust / Hyper learning project. I utilize Nginx as part of my home lab providing reverse pro
rok A minimal ngrok implementation in Rust, for educational purpose. This work is largely based on rathole, especially the very first commit. Other ho