GithubHelp home page GithubHelp logo

TLS Support? about transparent-proxy HOT 6 CLOSED

gr3p1p3 avatar gr3p1p3 commented on June 14, 2024
TLS Support?

from transparent-proxy.

Comments (6)

 avatar commented on June 14, 2024 1

I believe it would cover a lot more user needs that way :)

from transparent-proxy.

gr3p1p3 avatar gr3p1p3 commented on June 14, 2024

Through the nature of transparent-proxy, data is up/downstreamed as it is (even encrypted).
You could try to implement an sslStrip-Mechanism by capturing/modifyng the session-data before certificates are exchanged.

Honestly, I am still undecided whether to add such a new feature. Any suggestions?

from transparent-proxy.

gr3p1p3 avatar gr3p1p3 commented on June 14, 2024

I added the "isHttps"-Attribute to sessionInstance. Download version 1.6.5 and try something like this:

const server = new ProxyServer({
    verbose: true,
    injectResponse: (data,session) => {
        if(!session.isHttps) {
            console.log('SESSION-DATA', data.toString()) //you can spoof here
            return Buffer.from(data.toString().replace('something', 'replaced_'));
        }
        return data;
    }
});

I will provide this on README.

!!REMEMBER that replaced text should have same length of original!

from transparent-proxy.

 avatar commented on June 14, 2024

Awesome!!!

Can you also do an example of injectRequest before it reaches destination? 😅

from transparent-proxy.

gr3p1p3 avatar gr3p1p3 commented on June 14, 2024

As the same way, try something like:

const uaToSwitch = 'curl/7.55.1';
const switchWith = 'My Super Fucking Spoofed UA!';

const server = new ProxyServer({
    verbose: false,
    injectData: (data, session) => {
        if (!session.isHttps) {
            // console.log('SESSION-DATA', data.toString()) //you can spoof here
            if (data.toString().match(uaToSwitch)) {
                const newData = Buffer.from(data.toString()
                    .replace(uaToSwitch, switchWith));

                // console.log('data', data.toString());
                // console.log('newData', newData.toString());
                return newData;
            }
        }
        return data;
    }
});

I added some new examples. Here is a working example of "injectData":
https://github.com/gr3p1p3/transparent-proxy/blob/master/examples/spoofRequest.js

I'm sure it can help to better understand! :)

from transparent-proxy.

gr3p1p3 avatar gr3p1p3 commented on June 14, 2024

I add a new feature to intercept encrypted-data. The "intercept"-Attribute :) It will break secure-connection (obvious), but it allows to intercept & spoof data.

Here a new example: https://github.com/gr3p1p3/transparent-proxy/blob/master/examples/interceptRequest.js

You need to download @1.7.0 for this ^^

from transparent-proxy.

Related Issues (20)

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.