Ask coding questions

← Back to all posts
How would I make this?
AzureScripts (166)

Linux has a thing called proxychains, how would I make my own in Python? Works by jumping to different proxies, making it hard to track

Commentshotnewtop
SixBeeps (3083)

Think about how these things work. Let's say you want to connect to a server with a domain name of www.xyz.co.uk (just an example). You would first send a GET request to the server with some headers and a bit of data to tell you who you are. The server then returns the data as per the request to the computer that sent it. A proxychain just does that, but with some middleman steps.
You might be able to keep some kind of DB to keep track of valid IPs that have your proxychain program. If you do, you'd access this DB in your program, then map out a set of IPs to pass through with your request. Once you find a path, encrypt your data some amount of times, then pass the encrypted data to the first middleman system. They will then un-encrypt the data a single time, then pass that to the next. Rinse and repeat until the request reaches the last middleman. That last one will actually call the request to the website, then pass the contents back down the line until it reaches your machine.
LTT video here

AzureScripts (166)

@niorg2606 So i just need to connect to multiple proxies ? :/ The amount of proxies i go on changes nothing.

SixBeeps (3083)

@AzureScripts Not quite. You need to encrypt/decrypt the response each proxy you connect to. This makes things safe and secure.

AzureScripts (166)

@niorg2606 But Wouldn't only the last proxy matter? Because connecting to previous proxies don't change anything

AzureScripts (166)

@AzureScripts so i should only need to connect to one

SixBeeps (3083)

@AzureScripts Besides the literal data being passed between them, no.
The entire point of a proxy is to connect to multiple of them at once.

AzureScripts (166)

@niorg2606 can you even connect to multiple proxies at the same time?

SixBeeps (3083)

@AzureScripts You could, but what I'm talking about is connecting from one to another one at a time.

AzureScripts (166)

@niorg2606 So you're saying... Connect to Proxy > Another Proxy > Another Proxy > Target Site

AzureScripts (166)

@niorg2606 but what effect does connecting to the proxies before the last one have?

SixBeeps (3083)

@AzureScripts Connecting to multiple makes your request harder to track.

AzureScripts (166)

@niorg2606 and like the real proxychains, am i able to make it work on all my stuff? like Open browser google.com Proxy Proxy Proxy Reach Site

AzureScripts (166)

So i can leave it run in the background

SixBeeps (3083)

@AzureScripts That's an entire thing called a "background process" and it requires a lot of machine-level stuff. Idk if Python is the best choice for making a background process, but it might be possible. You'd leave it running and intercept all outgoing HTTP requests.