Proxies: Difference between revisions
Initial |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
=== Benefits === | === Benefits === | ||
Routing all traffic through Tor provides several 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. | |||
<span id="tor-vs.-vpn"></span> | <span id="tor-vs.-vpn"></span> | ||
=== Tor vs. | === 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. | |||
<span id="proxy-vs.-vpn"></span> | <span id="proxy-vs.-vpn"></span> | ||
=== Proxy vs. | === 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. | |||
<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: | 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: | 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. | ||
# '''Install Homebrew''' (if not already installed): | |||
<pre>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</pre> | |||
< | |||
# '''Install Tor''': | |||
< | <pre>brew install tor</pre> | ||
< | # '''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. | ||
# '''Open Privoxy’s Configuration File''': | |||
<pre>nano /opt/homebrew/etc/privoxy/config</pre> | |||
< | |||
# '''Add Tor Configuration''': Add the following line to the configuration file: | |||
<pre>forward-socks5t / 127.0.0.1:9050 .</pre> | <pre>forward-socks5t / 127.0.0.1:9050 .</pre> | ||
# '''Save and Exit''': | |||
* Press <code>CTRL + X</code> to exit. | |||
* Press <code>Y</code> to confirm saving the changes. | |||
* Press <code>Enter</code> to save the file. | |||
<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. | ||
# '''Start Privoxy''': | |||
<pre>brew services start privoxy</pre> | |||
< | |||
<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> > <code>Network</code>. | ||
= '''Select the Network Interface''': | |||
# | = '''Select the Network Interface''': | ||
= '''Configure Proxies''': | # Select the network interface you are using (e.g., Wi-Fi or Ethernet). | ||
# | |||
# | = '''Configure Proxies''': | ||
# | # Click on <code>Advanced</code>. | ||
# | # Go to the <code>Proxies</code> tab. | ||
= '''Apply Changes''': | # Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</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. | ||
# '''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. | |||
# '''Test Connection''': Use <pre>curl -L --proxy http://127.0.0.1:8118 http://check.torproject.org</pre> to verify the connection. | |||
<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. | ||
# '''Update Package List''': | |||
<pre>sudo apt update</pre> | |||
< | |||
# '''Install Tor''': | |||
< | <pre>sudo apt install tor</pre> | ||
< | # '''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. | ||
# '''Open Privoxy’s Configuration File''': | |||
<pre>sudo nano /etc/privoxy/config</pre> | |||
< | |||
# '''Add Tor Configuration''': Add the following line to the configuration file: | |||
<pre>forward-socks5t / 127.0.0.1:9050 .</pre> | <pre>forward-socks5t / 127.0.0.1:9050 .</pre> | ||
# '''Save and Exit''': | |||
* Press <code>CTRL + X</code> to exit. | |||
* Press <code>Y</code> to confirm saving the changes. | |||
* Press <code>Enter</code> to save the file. | |||
<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. | ||
# '''Start Privoxy''': | |||
<pre>sudo systemctl start privoxy | |||
< | sudo systemctl enable privoxy</pre> | ||
sudo systemctl enable privoxy</ | |||
<span id="step-4-set-up-port-forwarding-1"></span> | |||
<span id="step-4-set-up-port-forwarding"></span> | |||
==== Step 4: Set Up Port Forwarding ==== | ==== Step 4: Set Up Port Forwarding ==== | ||
# '''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: | |||
<pre>PUBLIC_IP=$(curl -s ifconfig.me) | |||
< | echo $PUBLIC_IP</pre> | ||
echo $PUBLIC_IP</ | |||
<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 ==== | ||
# '''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. | |||
<pre>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</ | chmod +x connect_proxy.sh</pre> | ||
< | # '''Run the Script on the Remote Machine''': On your remote machine, run the script to create an SSH tunnel: | ||
<pre>./connect_proxy.sh</pre> | |||
# '''Configure Remote Device to Use Proxy''': On your remote device, configure your web browser or system settings to use the proxy: | |||
* HTTP Proxy: <code>127.0.0.1</code> | |||
* Port: <code>8118</code> | |||
<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 ==== | ||
# '''Run the SSH Tunnel Script''': On your macOS remote machine, run the script created previously to establish an SSH tunnel: | |||
<pre>./connect_proxy.sh</pre> | |||
< | |||
<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> > <code>Network</code>. | ||
= '''Select the Network Interface''': | |||
# | = '''Select the Network Interface''': | ||
= '''Configure Proxies''': | # Select the network interface you are using (e.g., Wi-Fi or Ethernet). | ||
# | |||
# | = '''Configure Proxies''': | ||
# | # Click on <code>Advanced</code>. | ||
# | # Go to the <code>Proxies</code> tab. | ||
= '''Apply Changes''': | # Check <code>Web Proxy (HTTP)</code> and <code>Secure Web Proxy (HTTPS)</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]. | ||
= '''Configure SSH Tunnel''': | |||
# | = '''Configure SSH Tunnel''': | ||
# | # Open PuTTY. | ||
# | # Enter the hostname or IP address of your proxy server. | ||
# | # In the left-hand menu, go to <code>Connection > SSH > Tunnels</code>. | ||
#''' Source port: <code>8118</code> | # Add a new forwarded port: | ||
#''' Destination: <code>localhost:8118</code> | # '''Source port: <code>8118</code> | ||
# | # '''Destination: <code>localhost:8118</code> | ||
# | # Click <code>Add</code>. | ||
# | # 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> > <code>Internet Options</code>. | ||
= '''Configure LAN Settings''': | |||
# | = '''Configure LAN Settings''': | ||
# | # Go to the <code>Connections</code> tab and click on <code>LAN settings</code>. | ||
# | # Check <code>Use a proxy server for your LAN</code>. | ||
# | # 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. | ||
= '''Configure SSH Tunnel''': | |||
# | = '''Configure SSH Tunnel''': | ||
# | # Open Termius. | ||
# | # 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 host: <code>localhost</code> | ||
# | # '''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> > <code>Wi-Fi</code>. | ||
# | # Tap the information icon (i) next to your Wi-Fi network. | ||
# | # 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. | ||
# | # 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. | ||
= '''Configure SSH Tunnel''': | |||
# | = '''Configure SSH Tunnel''': | ||
# | # Open ConnectBot. | ||
# | # 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 | ||
# | # '''Source port: <code>8118</code> | ||
# | # '''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> > <code>Network & Internet</code> > <code>Wi-Fi</code>. | ||
# | # Long-press your connected Wi-Fi network and select <code>Modify network</code>. | ||
# | # Scroll down and select <code>Advanced options</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. | ||
# | # Save the settings. | ||
[[Category:Guides]] | |||
[[Category:Network]] | |||
[[Category:Remote]] |