Proxies: Difference between revisions

From Irregularpedia
Jump to navigation Jump to search
categories
Tag: 2017 source edit
No edit summary
Tag: wikieditor
 
Line 13: Line 13:
=== Benefits ===
=== Benefits ===


Routing all traffic through Tor provides several benefits: - '''Anonymity''': Tor hides your IP address by routing your traffic through multiple nodes. - '''Privacy''': Your internet service provider (ISP) and other third parties cannot easily monitor your online activities. - '''Access to Restricted Content''': You can access content that may be blocked or restricted in your region.
Routing all traffic through Tor provides several benefits:
* '''Anonymity''': Tor hides your IP address by routing your traffic through multiple nodes.
* '''Privacy''': Your internet service provider (ISP) and other third parties cannot easily monitor your online activities.
* '''Access to Restricted Content''': You can access content that may be blocked or restricted in your region.


<span id="tor-vs.-vpn"></span>
<span id="tor-vs.-vpn"></span>
=== Tor vs. VPN ===
=== Tor vs. VPN ===


'' '''Tor''': Tor is a free, decentralized network that anonymizes your traffic by routing it through multiple volunteer-operated nodes. It is particularly effective for high privacy needs but may be slower due to multiple hops.
* '''Tor''': Tor is a free, decentralized network that anonymizes your traffic by routing it through multiple volunteer-operated nodes. It is particularly effective for high privacy needs but may be slower due to multiple hops.
'' '''VPN''': A VPN provides encryption and routes your traffic through a server operated by the VPN provider. VPNs can offer faster speeds and are easier to use but require trust in the VPN provider.
* '''VPN''': A VPN provides encryption and routes your traffic through a server operated by the VPN provider. VPNs can offer faster speeds and are easier to use but require trust in the VPN provider.


<span id="proxy-vs.-vpn"></span>
<span id="proxy-vs.-vpn"></span>
=== Proxy vs. VPN ===
=== Proxy vs. VPN ===


'' '''Proxy''': A proxy routes your internet traffic through a single server, hiding your IP address but not necessarily encrypting your data. Proxies are useful for accessing geo-restricted content but offer less security than VPNs or Tor.
* '''Proxy''': A proxy routes your internet traffic through a single server, hiding your IP address but not necessarily encrypting your data. Proxies are useful for accessing geo-restricted content but offer less security than VPNs or Tor.
'' '''VPN''': A VPN encrypts all your traffic and routes it through a secure server, providing both privacy and security. VPNs are generally faster than Tor but require trust in the VPN provider.
* '''VPN''': A VPN encrypts all your traffic and routes it through a secure server, providing both privacy and security. VPNs are generally faster than Tor but require trust in the VPN provider.


<span id="privacy-and-security-considerations"></span>
<span id="privacy-and-security-considerations"></span>
Line 33: Line 36:
==== Serving a Proxy ====
==== Serving a Proxy ====


When setting up a proxy server, consider the following: - '''Security''': Ensure the server is secured to prevent unauthorized access. Use strong passwords and consider setting up a firewall. - '''Privacy''': Be aware that the server can log all traffic passing through it. If privacy is critical, configure the server to avoid logging or encrypt logs.
When setting up a proxy server, consider the following:
* '''Security''': Ensure the server is secured to prevent unauthorized access. Use strong passwords and consider setting up a firewall.
* '''Privacy''': Be aware that the server can log all traffic passing through it. If privacy is critical, configure the server to avoid logging or encrypt logs.


<span id="using-a-proxy"></span>
<span id="using-a-proxy"></span>
==== Using a Proxy ====
==== Using a Proxy ====


When using a proxy server, consider the following: - '''Anonymity''': Your traffic is routed through the proxy, masking your IP address but not necessarily encrypting your data. - '''Trust''': Ensure you trust the proxy server you are using, as it can potentially log your traffic and access sensitive information.
When using a proxy server, consider the following:
* '''Anonymity''': Your traffic is routed through the proxy, masking your IP address but not necessarily encrypting your data.
* '''Trust''': Ensure you trust the proxy server you are using, as it can potentially log your traffic and access sensitive information.


<span id="routing-all-traffic-through-tor-using-privoxy"></span>
<span id="routing-all-traffic-through-tor-using-privoxy"></span>
Line 51: Line 58:
First, we need to install both Tor and Privoxy using Homebrew.
First, we need to install both Tor and Privoxy using Homebrew.


<ol style="list-style-type: decimal;">
# '''Install Homebrew''' (if not already installed):
<li><p>'''Install Homebrew''' (if not already installed):</p>
<pre>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</pre>
<syntaxhighlight lang="sh">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</syntaxhighlight></li>
 
<li><p>'''Install Tor''':</p>
# '''Install Tor''':
<syntaxhighlight lang="sh">brew install tor</syntaxhighlight></li>
<pre>brew install tor</pre>
<li><p>'''Install Privoxy''':</p>
 
<syntaxhighlight lang="sh">brew install privoxy</syntaxhighlight></li></ol>
# '''Install Privoxy''':
<pre>brew install privoxy</pre>


<span id="step-2-configure-privoxy-to-use-tor"></span>
<span id="step-2-configure-privoxy-to-use-tor"></span>
Line 64: Line 72:
Edit the Privoxy configuration file to route traffic through Tor.
Edit the Privoxy configuration file to route traffic through Tor.


<ol style="list-style-type: decimal;">
# '''Open Privoxy’s Configuration File''':
<li><p>'''Open Privoxy’s Configuration File''':</p>
<pre>nano /opt/homebrew/etc/privoxy/config</pre>
<syntaxhighlight lang="sh">nano /opt/homebrew/etc/privoxy/config</syntaxhighlight></li>
 
<li><p>'''Add Tor Configuration''': Add the following line to the configuration file:</p>
# '''Add Tor Configuration''': Add the following line to the configuration file:
<pre>forward-socks5t / 127.0.0.1:9050 .</pre></li>
<pre>forward-socks5t / 127.0.0.1:9050 .</pre>
<li><p>'''Save and Exit''':</p>
 
<ul>
# '''Save and Exit''':
<li>Press <code>CTRL + X</code> to exit.</li>
* Press <code>CTRL + X</code> to exit.
<li>Press <code>Y</code> to confirm saving the changes.</li>
* Press <code>Y</code> to confirm saving the changes.
<li>Press <code>Enter</code> to save the file.</li></ul>
* Press <code>Enter</code> to save the file.
</li></ol>


<span id="step-3-start-privoxy"></span>
<span id="step-3-start-privoxy"></span>
Line 81: Line 88:
Start Privoxy as a background service.
Start Privoxy as a background service.


<ol style="list-style-type: decimal;">
# '''Start Privoxy''':
<li><p>'''Start Privoxy''':</p>
<pre>brew services start privoxy</pre>
<syntaxhighlight lang="sh">brew services start privoxy</syntaxhighlight></li></ol>


<span id="step-4-configure-macos-to-use-privoxy-as-a-system-proxy"></span>
<span id="step-4-configure-macos-to-use-privoxy-as-a-system-proxy"></span>
Line 90: Line 96:
Configure your macOS network settings to use Privoxy.
Configure your macOS network settings to use Privoxy.


= '''Open System Preferences''': =
= '''Open System Preferences''':
#'' Go to <code>System Preferences</code> &gt; <code>Network</code>.
# Go to <code>System Preferences</code> &gt; <code>Network</code>.
= '''Select the Network Interface''': =
 
#'' Select the network interface you are using (e.g., Wi-Fi or Ethernet).
= '''Select the Network Interface''':
= '''Configure Proxies''': =
# Select the network interface you are using (e.g., Wi-Fi or Ethernet).
#'' Click on <code>Advanced</code>.
 
#'' Go to the <code>Proxies</code> tab.
= '''Configure Proxies''':
#'' Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</code>.
# Click on <code>Advanced</code>.
#'' Set both to <code>127.0.0.1</code> and <code>8118</code> (Privoxy’s default port).
# Go to the <code>Proxies</code> tab.
= '''Apply Changes''': =
# Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</code>.
#'' Click <code>OK</code> and <code>Apply</code>.
# Set both to <code>127.0.0.1</code> and <code>8118</code> (Privoxy’s default port).
 
= '''Apply Changes''':
# Click <code>OK</code> and <code>Apply</code>.


<span id="step-5-verify-the-configuration"></span>
<span id="step-5-verify-the-configuration"></span>
Line 107: Line 116:
Ensure that your traffic is being routed through Tor.
Ensure that your traffic is being routed through Tor.


<ol style="list-style-type: decimal;">
# '''Check IP Address''': Open a web browser and navigate to <code>http://check.torproject.org</code>. This page should confirm that your traffic is being routed through the Tor network.
<li><p>'''Check IP Address''': Open a web browser and navigate to <code>http://check.torproject.org</code>. This page should confirm that your traffic is being routed through the Tor network.</p></li>
# '''Test Connection''': Use <pre>curl -L --proxy http://127.0.0.1:8118 http://check.torproject.org</pre> to verify the connection.
<li><p>'''Test Connection''': Use <code>curl</code> to verify the connection:</p>
<syntaxhighlight lang="sh">curl -L --proxy http://127.0.0.1:8118 http://check.torproject.org</syntaxhighlight></li></ol>


<span id="example-privoxy-configuration"></span>
<span id="example-privoxy-configuration"></span>
Line 119: Line 126:
<pre># Forward all traffic through Tor
<pre># Forward all traffic through Tor
forward-socks5t / 127.0.0.1:9050 .</pre>
forward-socks5t / 127.0.0.1:9050 .</pre>
<span id="for-linux"></span>
<span id="for-linux"></span>
=== For Linux ===
=== For Linux ===
Line 127: Line 135:
First, we need to install both Tor and Privoxy.
First, we need to install both Tor and Privoxy.


<ol style="list-style-type: decimal;">
# '''Update Package List''':
<li><p>'''Update Package List''':</p>
<pre>sudo apt update</pre>
<syntaxhighlight lang="sh">sudo apt update</syntaxhighlight></li>
 
<li><p>'''Install Tor''':</p>
# '''Install Tor''':
<syntaxhighlight lang="sh">sudo apt install tor</syntaxhighlight></li>
<pre>sudo apt install tor</pre>
<li><p>'''Install Privoxy''':</p>
 
<syntaxhighlight lang="sh">sudo apt install privoxy</syntaxhighlight></li></ol>
# '''Install Privoxy''':
<pre>sudo apt install privoxy</pre>


<span id="step-2-configure-privoxy-to-use-tor-1"></span>
<span id="step-2-configure-privoxy-to-use-tor-1"></span>
Line 140: Line 149:
Edit the Privoxy configuration file to route traffic through Tor.
Edit the Privoxy configuration file to route traffic through Tor.


<ol style="list-style-type: decimal;">
# '''Open Privoxy’s Configuration File''':
<li><p>'''Open Privoxy’s Configuration File''':</p>
<pre>sudo nano /etc/privoxy/config</pre>
<syntaxhighlight lang="sh">sudo nano /etc/privoxy/config</syntaxhighlight></li>
 
<li><p>'''Add Tor Configuration''': Add the following line to the configuration file:</p>
# '''Add Tor Configuration''': Add the following line to the configuration file:
<pre>forward-socks5t / 127.0.0.1:9050 .</pre></li>
<pre>forward-socks5t / 127.0.0.1:9050 .</pre>
<li><p>'''Save and Exit''':</p>
 
<ul>
# '''Save and Exit''':
<li>Press <code>CTRL + X</code> to exit.</li>
* Press <code>CTRL + X</code> to exit.
<li>Press <code>Y</code> to confirm saving the changes.</li>
* Press <code>Y</code> to confirm saving the changes.
<li>Press <code>Enter</code> to save the file.</li></ul>
* Press <code>Enter</code> to save the file.
</li></ol>


<span id="step-3-start-privoxy-1"></span>
<span id="step-3-start-privoxy-1"></span>
Line 157: Line 165:
Start Privoxy as a background service.
Start Privoxy as a background service.


<ol style="list-style-type: decimal;">
# '''Start Privoxy''':
<li><p>'''Start Privoxy''':</p>
<pre>sudo systemctl start privoxy
<syntaxhighlight lang="sh">sudo systemctl start privoxy
sudo systemctl enable privoxy</pre>
sudo systemctl enable privoxy</syntaxhighlight></li></ol>


<span id="step-4-configure-linux-to-use-privoxy-as-a-system-proxy"></span>
<span id="step-4-set-up-port-forwarding-1"></span>
==== Step 4: Configure Linux to Use Privoxy as a System Proxy ====
 
Configure your Linux network settings to use Privoxy.
 
= '''Open Network Settings''': =
#'' Go to <code>Settings</code> &gt; <code>Network</code>.
= '''Select the Network Interface''': =
#'' Select the network interface you are using (e.g., Wired or Wi-Fi).
= '''Configure Proxies''': =
#'' Click on <code>Settings</code> (gear icon) for the network interface.
#'' Go to the <code>Proxy</code> tab.
#'' Set the proxy method to <code>Manual</code>.
#'' Enter <code>127.0.0.1</code> and <code>8118</code> for HTTP and HTTPS proxies.
= '''Apply Changes''': =
#'' Click <code>Apply</code>.
 
<span id="step-5-verify-the-configuration-1"></span>
==== Step 5: Verify the Configuration ====
 
Ensure that your traffic is being routed through Tor.
 
<ol style="list-style-type: decimal;">
<li><p>'''Check IP Address''': Open a web browser and navigate to <code>http://check.torproject.org</code>. This page should confirm that your traffic is being routed through the Tor network.</p></li>
<li><p>'''Test Connection''': Use <code>curl</code> to verify the connection:</p>
<syntaxhighlight lang="sh">curl -L --proxy http://127.0.0.1:8118 http://check.torproject.org</syntaxhighlight></li></ol>
 
<span id="example-privoxy-configuration-1"></span>
=== Example Privoxy Configuration ===
 
Here is an example of what your Privoxy configuration might look like after editing:
 
<pre># Forward all traffic through Tor
forward-socks5t / 127.0.0.1:9050 .</pre>
<span id="serving-a-proxy-from-macos-or-linux-system"></span>
== Serving a Proxy from macOS or Linux System ==
 
<span id="for-macos-1"></span>
=== For macOS ===
 
<span id="step-1-install-privoxy"></span>
==== Step 1: Install Privoxy ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Install Homebrew''' (if not already installed):</p>
<syntaxhighlight lang="sh">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</syntaxhighlight></li>
<li><p>'''Install Privoxy''':</p>
<syntaxhighlight lang="sh">brew install privoxy</syntaxhighlight></li></ol>
 
<span id="step-2-configure-privoxy-to-allow-remote-connections"></span>
==== Step 2: Configure Privoxy to Allow Remote Connections ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Open Privoxy’s Configuration File''':</p>
<syntaxhighlight lang="sh">nano /opt/homebrew/etc/privoxy/config</syntaxhighlight></li>
<li><p>'''Add Remote Access Configuration''': Add the following lines to the configuration file to allow remote connections:</p>
<pre>listen-address  0.0.0.0:8118</pre></li>
<li><p>'''Save and Exit''':</p>
<ul>
<li>Press <code>CTRL + X</code> to exit.</li>
<li>Press <code>Y</code> to confirm saving the changes.</li>
<li>Press <code>Enter</code> to save the file.</li></ul>
</li></ol>
 
<span id="step-3-start-privoxy-2"></span>
==== Step 3: Start Privoxy ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Start Privoxy''':</p>
<syntaxhighlight lang="sh">brew services start privoxy</syntaxhighlight></li></ol>
 
<span id="step-4-set-up-port-forwarding"></span>
==== Step 4: Set Up Port Forwarding ====
==== Step 4: Set Up Port Forwarding ====


<ol style="list-style-type: decimal;">
# '''Configure Your Router''': Ensure your router forwards external traffic on port <code>8118</code> to your Linux machine’s IP address. You can find your IP address using:
<li><p>'''Configure Your Router''': Ensure your router forwards external traffic on port <code>8118</code> to your macOS machine’s IP address. You can find your IP address using:</p>
<pre>PUBLIC_IP=$(curl -s ifconfig.me)
<syntaxhighlight lang="sh">PUBLIC_IP=$(curl -s ifconfig.me)
echo $PUBLIC_IP</pre>
echo $PUBLIC_IP</syntaxhighlight></li></ol>


<span id="step-5-secure-remote-access-with-ssh-tunneling"></span>
<span id="step-5-secure-remote-access-with-ssh-tunneling-1"></span>
==== Step 5: Secure Remote Access with SSH Tunneling ====
==== Step 5: Secure Remote Access with SSH Tunneling ====


<ol style="list-style-type: decimal;">
# '''Create SSH Tunnel Script''': Create a script to automate the creation of an SSH tunnel. Replace <code>your_linux_username</code> with your actual Linux username.
<li><p>'''Create SSH Tunnel Script''': Create a script to automate the creation of an SSH tunnel. Replace <code>your_macOS_username</code> with your actual macOS username.</p>
<pre>PUBLIC_IP=$(curl -s ifconfig.me)
<syntaxhighlight lang="sh">PUBLIC_IP=$(curl -s ifconfig.me)
echo "ssh -L 8118:localhost:8118 $(whoami)@$PUBLIC_IP" > connect_proxy.sh
echo "ssh -L 8118:localhost:8118 $(whoami)@$PUBLIC_IP" > connect_proxy.sh
chmod +x connect_proxy.sh</syntaxhighlight></li>
chmod +x connect_proxy.sh</pre>
<li><p>'''Run the Script on the Remote Machine''': On your remote machine, run the script to create an SSH tunnel:</p>
<syntaxhighlight lang="sh">./connect_proxy.sh</syntaxhighlight></li>
<li><p>'''Configure Remote Device to Use Proxy''': On your remote device, configure your web browser or system settings to use the proxy:</p>
<ul>
<li>HTTP Proxy: <code>127.0.0.1</code></li>
<li>Port: <code>8118</code></li></ul>
</li></ol>
 
<span id="for-linux-1"></span>
=== For Linux ===
 
<span id="step-1-install-privoxy-1"></span>
==== Step 1: Install Privoxy ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Update Package List''':</p>
<syntaxhighlight lang="sh">sudo apt update</syntaxhighlight></li>
<li><p>'''Install Privoxy''':</p>
<syntaxhighlight lang="sh">sudo apt install privoxy</syntaxhighlight></li></ol>
 
<span id="step-2-configure-privoxy-to-allow-remote-connections-1"></span>
==== Step 2: Configure Privoxy to Allow Remote Connections ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Open Privoxy’s Configuration File''':</p>
<syntaxhighlight lang="sh">sudo nano /etc/privoxy/config</syntaxhighlight></li>
<li><p>'''Add Remote Access Configuration''': Add the following lines to the configuration file to allow remote connections:</p>
<pre>listen-address  0.0.0.0:8118</pre></li>
<li><p>'''Save and Exit''':</p>
<ul>
<li>Press <code>CTRL + X</code> to exit.</li>
<li>Press <code>Y</code> to confirm saving the changes.</li>
<li>Press <code>Enter</code> to save the file.</li></ul>
</li></ol>
 
<span id="step-3-start-privoxy-3"></span>
==== Step 3: Start Privoxy ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Start Privoxy''':</p>
<syntaxhighlight lang="sh">sudo systemctl start privoxy
sudo systemctl enable privoxy</syntaxhighlight></li></ol>
 
<span id="step-4-set-up-port-forwarding-1"></span>
==== Step 4: Set Up Port Forwarding ====
 
<ol style="list-style-type: decimal;">
<li><p>'''Configure Your Router''': Ensure your router forwards external traffic on port <code>8118</code> to your Linux machine’s IP address. You can find your IP address using:</p>
<syntaxhighlight lang="sh">PUBLIC_IP=$(curl -s ifconfig.me)
echo $PUBLIC_IP</syntaxhighlight></li></ol>


<span id="step-5-secure-remote-access-with-ssh-tunneling-1"></span>
# '''Run the Script on the Remote Machine''': On your remote machine, run the script to create an SSH tunnel:
==== Step 5: Secure Remote Access with SSH Tunneling ====
<pre>./connect_proxy.sh</pre>


<ol style="list-style-type: decimal;">
# '''Configure Remote Device to Use Proxy''': On your remote device, configure your web browser or system settings to use the proxy:
<li><p>'''Create SSH Tunnel Script''': Create a script to automate the creation of an SSH tunnel. Replace <code>your_linux_username</code> with your actual Linux username.</p>
* HTTP Proxy: <code>127.0.0.1</code>
<syntaxhighlight lang="sh">PUBLIC_IP=$(curl -s ifconfig.me)
* Port: <code>8118</code>
echo "ssh -L 8118:localhost:8118 $(whoami)@$PUBLIC_IP" > connect_proxy.sh
chmod +x connect_proxy.sh</syntaxhighlight></li>
<li><p>'''Run the Script on the Remote Machine''': On your remote machine, run the script to create an SSH tunnel:</p>
<syntaxhighlight lang="sh">./connect_proxy.sh</syntaxhighlight></li>
<li><p>'''Configure Remote Device to Use Proxy''': On your remote device, configure your web browser or system settings to use the proxy:</p>
<ul>
<li>HTTP Proxy: <code>127.0.0.1</code></li>
<li>Port: <code>8118</code></li></ul>
</li></ol>


<span id="connecting-to-the-proxy-from-a-remote-system"></span>
<span id="connecting-to-the-proxy-from-a-remote-system"></span>
Line 325: Line 200:
==== Step 1: Create SSH Tunnel ====
==== Step 1: Create SSH Tunnel ====


<ol style="list-style-type: decimal;">
# '''Run the SSH Tunnel Script''': On your macOS remote machine, run the script created previously to establish an SSH tunnel:
<li><p>'''Run the SSH Tunnel Script''': On your macOS remote machine, run the script created previously to establish an SSH tunnel:</p>
<pre>./connect_proxy.sh</pre>
<syntaxhighlight lang="sh">./connect_proxy.sh</syntaxhighlight></li></ol>


<span id="step-2-configure-macos-to-use-the-proxy"></span>
<span id="step-2-configure-macos-to-use-the-proxy"></span>
==== Step 2: Configure macOS to Use the Proxy ====
==== Step 2: Configure macOS to Use the Proxy ====


= '''Open System Preferences''': =
= '''Open System Preferences''':
#'' Go to <code>System Preferences</code> &gt; <code>Network</code>.
# Go to <code>System Preferences</code> &gt; <code>Network</code>.
= '''Select the Network Interface''': =
 
#'' Select the network interface you are using (e.g., Wi-Fi or Ethernet).
= '''Select the Network Interface''':
= '''Configure Proxies''': =
# Select the network interface you are using (e.g., Wi-Fi or Ethernet).
#'' Click on <code>Advanced</code>.
 
#'' Go to the <code>Proxies</code> tab.
= '''Configure Proxies''':
#'' Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</code>.
# Click on <code>Advanced</code>.
#'' Set both to <code>127.0.0.1</code> and <code>8118</code>.
# Go to the <code>Proxies</code> tab.
= '''Apply Changes''': =
# Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</code>.
#'' Click <code>OK</code> and <code>Apply</code>.
# Set both to <code>127.0.0.1</code> and <code>8118</code>.
 
= '''Apply Changes''':
# Click <code>OK</code> and <code>Apply</code>.


<span id="for-windows"></span>
<span id="for-windows"></span>
Line 350: Line 227:
==== Step 1: Create SSH Tunnel ====
==== Step 1: Create SSH Tunnel ====


= '''Install PuTTY''' (if not already installed): =
= '''Install PuTTY''' (if not already installed):
#'' Download and install PuTTY from [https://www.putty.org/ here].
# Download and install PuTTY from [https://www.putty.org/ here].
= '''Configure SSH Tunnel''': =
 
#'' Open PuTTY.
= '''Configure SSH Tunnel''':
#'' Enter the hostname or IP address of your proxy server.
# Open PuTTY.
#'' In the left-hand menu, go to <code>Connection &gt; SSH &gt; Tunnels</code>.
# Enter the hostname or IP address of your proxy server.
#'' Add a new forwarded port:
# In the left-hand menu, go to <code>Connection &gt; SSH &gt; Tunnels</code>.
#''' Source port: <code>8118</code>
# Add a new forwarded port:
#''' Destination: <code>localhost:8118</code>
# '''Source port: <code>8118</code>
#'' Click <code>Add</code>.
# '''Destination: <code>localhost:8118</code>
#'' Go back to the <code>Session</code> category.
# Click <code>Add</code>.
#'' Click <code>Open</code> to start the SSH session.
# Go back to the <code>Session</code> category.
# Click <code>Open</code> to start the SSH session.


<span id="step-2-configure-windows-to-use-the-proxy"></span>
<span id="step-2-configure-windows-to-use-the-proxy"></span>
==== Step 2: Configure Windows to Use the Proxy ====
==== Step 2: Configure Windows to Use the Proxy ====


= '''Open Internet Options''': =
= '''Open Internet Options''':
#'' Go to <code>Control Panel</code> &gt; <code>Internet Options</code>.
# Go to <code>Control Panel</code> &gt; <code>Internet Options</code>.
= '''Configure LAN Settings''': =
 
#'' Go to the <code>Connections</code> tab and click on <code>LAN settings</code>.
= '''Configure LAN Settings''':
#'' Check <code>Use a proxy server for your LAN</code>.
# Go to the <code>Connections</code> tab and click on <code>LAN settings</code>.
#'' Enter <code>127.0.0.1</code> for the address and <code>8118</code> for the port.
# Check <code>Use a proxy server for your LAN</code>.
#'' Click <code>OK</code> to apply the changes.
# Enter <code>127.0.0.1</code> for the address and <code>8118</code> for the port.
# Click <code>OK</code> to apply the changes.


<span id="for-ios"></span>
<span id="for-ios"></span>
Line 380: Line 259:
==== Step 1: Create SSH Tunnel ====
==== Step 1: Create SSH Tunnel ====


= '''Install an SSH Client''': =
= '''Install an SSH Client''':
#'' Install an SSH client like Termius from the App Store.
# Install an SSH client like Termius from the App Store.
= '''Configure SSH Tunnel''': =
 
#'' Open Termius.
= '''Configure SSH Tunnel''':
#'' Add a new host with the IP address of your proxy server.
# Open Termius.
#'' Go to the <code>Port Forwarding</code> section and add a new rule:
# Add a new host with the IP address of your proxy server.
#''' Local port: <code>8118</code>
# Go to the <code>Port Forwarding</code> section and add a new rule:
#''' Remote host: <code>localhost</code>
# '''Local port: <code>8118</code>
#*'' Remote port: <code>8118</code>
# '''Remote host: <code>localhost</code>
#'' Connect to the host to start the tunnel.
# '''Remote port: <code>8118</code>
# Connect to the host to start the tunnel.


<span id="step-2-configure-ios-to-use-the-proxy"></span>
<span id="step-2-configure-ios-to-use-the-proxy"></span>
==== Step 2: Configure iOS to Use the Proxy ====
==== Step 2: Configure iOS to Use the Proxy ====


= '''Configure Wi-Fi Proxy''': =
= '''Configure Wi-Fi Proxy''':
#'' Go to <code>Settings</code> &gt; <code>Wi-Fi</code>.
# Go to <code>Settings</code> &gt; <code>Wi-Fi</code>.
#'' Tap the information icon (i) next to your Wi-Fi network.
# Tap the information icon (i) next to your Wi-Fi network.
#'' Scroll down to <code>HTTP Proxy</code> and select <code>Manual</code>.
# Scroll down to <code>HTTP Proxy</code> and select <code>Manual</code>.
#'' Enter <code>127.0.0.1</code> for the Server and <code>8118</code> for the Port.
# Enter <code>127.0.0.1</code> for the Server and <code>8118</code> for the Port.
#'' Save the settings.
# Save the settings.


<span id="for-android"></span>
<span id="for-android"></span>
Line 407: Line 287:
==== Step 1: Create SSH Tunnel ====
==== Step 1: Create SSH Tunnel ====


= '''Install an SSH Client''': =
= '''Install an SSH Client''':
#'' Install an SSH client like ConnectBot from the Google Play Store.
# Install an SSH client like ConnectBot from the Google Play Store.
= '''Configure SSH Tunnel''': =
 
#'' Open ConnectBot.
= '''Configure SSH Tunnel''':
#'' Add a new host with the IP address of your proxy server.
# Open ConnectBot.
#'' Go to the port forwarding section and add a new rule:
# Add a new host with the IP address of your proxy server.
#''' Type: Local
# Go to the port forwarding section and add a new rule:
#''' Source port: <code>8118</code>
# '''Type: Local
#'''' Destination: <code>localhost:8118</code>
# '''Source port: <code>8118</code>
#'' Connect to the host to start the tunnel.
# '''Destination: <code>localhost:8118</code>
# Connect to the host to start the tunnel.


<span id="step-2-configure-android-to-use-the-proxy"></span>
<span id="step-2-configure-android-to-use-the-proxy"></span>
==== Step 2: Configure Android to Use the Proxy ====
==== Step 2: Configure Android to Use the Proxy ====


= '''Configure Wi-Fi Proxy''': =
= '''Configure Wi-Fi Proxy''':
#'' Go to <code>Settings</code> &gt; <code>Network &amp; Internet</code> &gt; <code>Wi-Fi</code>.
# Go to <code>Settings</code> &gt; <code>Network &amp; Internet</code> &gt; <code>Wi-Fi</code>.
#'' Long-press your connected Wi-Fi network and select <code>Modify network</code>.
# Long-press your connected Wi-Fi network and select <code>Modify network</code>.
#'' Scroll down and select <code>Advanced options</code>.
# Scroll down and select <code>Advanced options</code>.
#'' Set <code>Proxy</code> to <code>Manual</code>.
# Set <code>Proxy</code> to <code>Manual</code>.
#'' Enter <code>127.0.0.1</code> for the Hostname and <code>8118</code> for the Port.
# Enter <code>127.0.0.1</code> for the Hostname and <code>8118</code> for the Port.
#'' Save the settings.
# Save the settings.


[[Category:Guides]]
[[Category:Guides]]
[[Category:Network]]
[[Category:Network]]
[[Category:Remote]]
[[Category:Remote]]

Latest revision as of 07:31, 23 September 2024

Proxies: Serving, Using, and TOR

Context

Outcome

This guide will help you configure your system to route all network traffic through the Tor network using Privoxy. By the end of this guide, your internet traffic will be anonymized, enhancing your privacy and security.

Benefits

Routing all traffic through Tor provides several benefits:

  • Anonymity: Tor hides your IP address by routing your traffic through multiple nodes.
  • Privacy: Your internet service provider (ISP) and other third parties cannot easily monitor your online activities.
  • Access to Restricted Content: You can access content that may be blocked or restricted in your region.

Tor vs. VPN

  • Tor: Tor is a free, decentralized network that anonymizes your traffic by routing it through multiple volunteer-operated nodes. It is particularly effective for high privacy needs but may be slower due to multiple hops.
  • VPN: A VPN provides encryption and routes your traffic through a server operated by the VPN provider. VPNs can offer faster speeds and are easier to use but require trust in the VPN provider.

Proxy vs. VPN

  • Proxy: A proxy routes your internet traffic through a single server, hiding your IP address but not necessarily encrypting your data. Proxies are useful for accessing geo-restricted content but offer less security than VPNs or Tor.
  • VPN: A VPN encrypts all your traffic and routes it through a secure server, providing both privacy and security. VPNs are generally faster than Tor but require trust in the VPN provider.

Privacy and Security Considerations

Serving a Proxy

When setting up a proxy server, consider the following:

  • Security: Ensure the server is secured to prevent unauthorized access. Use strong passwords and consider setting up a firewall.
  • Privacy: Be aware that the server can log all traffic passing through it. If privacy is critical, configure the server to avoid logging or encrypt logs.

Using a Proxy

When using a proxy server, consider the following:

  • Anonymity: Your traffic is routed through the proxy, masking your IP address but not necessarily encrypting your data.
  • Trust: Ensure you trust the proxy server you are using, as it can potentially log your traffic and access sensitive information.

Routing All Traffic Through Tor Using Privoxy

For macOS

Step 1: Install Tor and Privoxy

First, we need to install both Tor and Privoxy using Homebrew.

  1. Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install Tor:
brew install tor
  1. Install Privoxy:
brew install privoxy

Step 2: Configure Privoxy to Use Tor

Edit the Privoxy configuration file to route traffic through Tor.

  1. Open Privoxy’s Configuration File:
nano /opt/homebrew/etc/privoxy/config
  1. Add Tor Configuration: Add the following line to the configuration file:
forward-socks5t / 127.0.0.1:9050 .
  1. Save and Exit:
  • Press CTRL + X to exit.
  • Press Y to confirm saving the changes.
  • Press Enter to save the file.

Step 3: Start Privoxy

Start Privoxy as a background service.

  1. Start Privoxy:
brew services start privoxy

Step 4: Configure macOS to Use Privoxy as a System Proxy

Configure your macOS network settings to use Privoxy.

= Open System Preferences:

  1. Go to System Preferences > Network.

= Select the Network Interface:

  1. Select the network interface you are using (e.g., Wi-Fi or Ethernet).

= Configure Proxies:

  1. Click on Advanced.
  2. Go to the Proxies tab.
  3. Check Web Proxy (HTTP) and Secure Web Proxy (HTTPS).
  4. Set both to 127.0.0.1 and 8118 (Privoxy’s default port).

= Apply Changes:

  1. Click OK and Apply.

Step 5: Verify the Configuration

Ensure that your traffic is being routed through Tor.

  1. Check IP Address: Open a web browser and navigate to http://check.torproject.org. This page should confirm that your traffic is being routed through the Tor network.
  2. Test Connection: Use
    curl -L --proxy http://127.0.0.1:8118 http://check.torproject.org
    to verify the connection.

Example Privoxy Configuration

Here is an example of what your Privoxy configuration might look like after editing:

# Forward all traffic through Tor
forward-socks5t / 127.0.0.1:9050 .

For Linux

Step 1: Install Tor and Privoxy

First, we need to install both Tor and Privoxy.

  1. Update Package List:
sudo apt update
  1. Install Tor:
sudo apt install tor
  1. Install Privoxy:
sudo apt install privoxy

Step 2: Configure Privoxy to Use Tor

Edit the Privoxy configuration file to route traffic through Tor.

  1. Open Privoxy’s Configuration File:
sudo nano /etc/privoxy/config
  1. Add Tor Configuration: Add the following line to the configuration file:
forward-socks5t / 127.0.0.1:9050 .
  1. Save and Exit:
  • Press CTRL + X to exit.
  • Press Y to confirm saving the changes.
  • Press Enter to save the file.

Step 3: Start Privoxy

Start Privoxy as a background service.

  1. Start Privoxy:
sudo systemctl start privoxy
sudo systemctl enable privoxy

Step 4: Set Up Port Forwarding

  1. Configure Your Router: Ensure your router forwards external traffic on port 8118 to your Linux machine’s IP address. You can find your IP address using:
PUBLIC_IP=$(curl -s ifconfig.me)
echo $PUBLIC_IP

Step 5: Secure Remote Access with SSH Tunneling

  1. Create SSH Tunnel Script: Create a script to automate the creation of an SSH tunnel. Replace your_linux_username with your actual Linux username.
PUBLIC_IP=$(curl -s ifconfig.me)
echo "ssh -L 8118:localhost:8118 $(whoami)@$PUBLIC_IP" > connect_proxy.sh
chmod +x connect_proxy.sh
  1. Run the Script on the Remote Machine: On your remote machine, run the script to create an SSH tunnel:
./connect_proxy.sh
  1. Configure Remote Device to Use Proxy: On your remote device, configure your web browser or system settings to use the proxy:
  • HTTP Proxy: 127.0.0.1
  • Port: 8118

Connecting to the Proxy from a Remote System

For macOS

Step 1: Create SSH Tunnel

  1. Run the SSH Tunnel Script: On your macOS remote machine, run the script created previously to establish an SSH tunnel:
./connect_proxy.sh

Step 2: Configure macOS to Use the Proxy

= Open System Preferences:

  1. Go to System Preferences > Network.

= Select the Network Interface:

  1. Select the network interface you are using (e.g., Wi-Fi or Ethernet).

= Configure Proxies:

  1. Click on Advanced.
  2. Go to the Proxies tab.
  3. Check Web Proxy (HTTP) and Secure Web Proxy (HTTPS).
  4. Set both to 127.0.0.1 and 8118.

= Apply Changes:

  1. Click OK and Apply.

For Windows

Step 1: Create SSH Tunnel

= Install PuTTY (if not already installed):

  1. Download and install PuTTY from here.

= Configure SSH Tunnel:

  1. Open PuTTY.
  2. Enter the hostname or IP address of your proxy server.
  3. In the left-hand menu, go to Connection > SSH > Tunnels.
  4. Add a new forwarded port:
  5. Source port: 8118
  6. Destination: localhost:8118
  7. Click Add.
  8. Go back to the Session category.
  9. Click Open to start the SSH session.

Step 2: Configure Windows to Use the Proxy

= Open Internet Options:

  1. Go to Control Panel > Internet Options.

= Configure LAN Settings:

  1. Go to the Connections tab and click on LAN settings.
  2. Check Use a proxy server for your LAN.
  3. Enter 127.0.0.1 for the address and 8118 for the port.
  4. Click OK to apply the changes.

For iOS

Step 1: Create SSH Tunnel

= Install an SSH Client:

  1. Install an SSH client like Termius from the App Store.

= Configure SSH Tunnel:

  1. Open Termius.
  2. Add a new host with the IP address of your proxy server.
  3. Go to the Port Forwarding section and add a new rule:
  4. Local port: 8118
  5. Remote host: localhost
  6. Remote port: 8118
  7. Connect to the host to start the tunnel.

Step 2: Configure iOS to Use the Proxy

= Configure Wi-Fi Proxy:

  1. Go to Settings > Wi-Fi.
  2. Tap the information icon (i) next to your Wi-Fi network.
  3. Scroll down to HTTP Proxy and select Manual.
  4. Enter 127.0.0.1 for the Server and 8118 for the Port.
  5. Save the settings.

For Android

Step 1: Create SSH Tunnel

= Install an SSH Client:

  1. Install an SSH client like ConnectBot from the Google Play Store.

= Configure SSH Tunnel:

  1. Open ConnectBot.
  2. Add a new host with the IP address of your proxy server.
  3. Go to the port forwarding section and add a new rule:
  4. Type: Local
  5. Source port: 8118
  6. Destination: localhost:8118
  7. Connect to the host to start the tunnel.

Step 2: Configure Android to Use the Proxy

= Configure Wi-Fi Proxy:

  1. Go to Settings > Network & Internet > Wi-Fi.
  2. Long-press your connected Wi-Fi network and select Modify network.
  3. Scroll down and select Advanced options.
  4. Set Proxy to Manual.
  5. Enter 127.0.0.1 for the Hostname and 8118 for the Port.
  6. Save the settings.