Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

My personal weblog for sharing and storing some of my activities related to computer science over the internet

Navid Malekghaini's Personal Blog

Navid Malekghaini

Software Engineer @ Intelligent Cloud Infrastructure Laboratory
Prev. ML Researcher @ University of Waterloo x Orange Telecom

University of Waterloo
Department of computer science
200 University Ave W, Waterloo, ON N2L 3G1, Canada
cs.uwaterloo.ca

contact me
navidmalekedu (AT) gmail (DOT) com [ Primary Email ]
nmalekgh (AT) uwaterloo (DOT) ca

Transparently Proxy All Traffic Through TOR

Saturday, 10 August 2019، 12:00 AM

In this post we will learn how to proxy all the network's traffic (TCP and UDP) transparently through TOR with least difficulty.

Download full tutorial from here

Requirements:

  • Linux OS (tested on alpine and ubuntu)

  • iptables (Linux firewall)

  • RedSocks

What is RedSocks?

Reference: https://github.com/darkk/redsocks

Redsocks is the tool that allows you to proxify(redirect) network traffic through a SOCKS4, SOCKS5 or HTTPs proxy server. It works on the lowest level, the kernel level (iptables). The other possible way is to use application level proxy, when the proxy client is implemented in the same language as an application is written in. Redsocks operates on the lowest system level, that’s why all running application don’t even have an idea that network traffic is sent through a proxy server, as a result it is called a transparent proxy redirector.

System’s Architecture and Setup for TCP Connections

So this is the big image, almost every tcp packet will be redirected to port 12345 which redsocks service listens for incoming packets; after that, redsocks will redirect the received traffic to another ip and port in socks protocol format.

Also have in mind that for iptables in docker, you have to use docker run --privileged flag

Download full tutorial from here