GithubHelp home page GithubHelp logo

mdibaiee / tlsproxy Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 27 KB

A TLS man-in-the-middle proxy that can replace byte sequences of same length in outbound requests

Rust 97.84% Python 2.16%
proxy rust tls man-in-the-middle

tlsproxy's Introduction

tlsproxy

A most basic TLS man-in-the-middle forward proxy using rustls and Tokio.

This proxy allows you, given you have the certificate chain of the server, to replace byte sequences of length N with another byte sequence of length N in outbound requests. For example, you could replace https://testserver.com/?name=foo with ?name=bar This is a toy, proof of concept project. It is not thoroughly tested and will have issues with a very high probability.

Sample usage:

$ cargo build && cargo run -- \
  --chaincert test-ca/end.fullchain \
  --key test-ca/end.key \
  --cacert test-ca/ca.cert \
  --replace 's/foo/bar' \
  --verbose
  
Listening on 127.0.0.1:8080

Send requests to your destination through this proxy:

curl https://testserver.com:5000 \
  --cacert test-ca/ca.cert \
  -x http://127.0.0.1:8080 --proxytunnel \
  --verbose

Please note this means you need to have a server running at testserver.com:5000, to do so, you can use the sample python server provided:

cd sample-server
pyenv local # 3.6.4 version
pip install flask

python main.py

You will then have a server running on 127.0.0.1:5000. You can then point testserver.com to this server by editing your /etc/hosts:

127.0.0.1 testserver.com

Then you can try sending a request with a replacement:

curl 'https://testserver.com:5000?foo=foo' \
  --cacert test-ca/ca.cert \
  -x http://127.0.0.1:8080 --proxytunnel \
  --verbose

The python server will log:

GET https://testserver.com:5000/?bar=bar

tlsproxy's People

Contributors

mdibaiee avatar

Stargazers

 avatar  avatar Saeed avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.