Get a Pentest and security assessment of your IT network.

Cyber Security

Access Local Web Server via Proxychains

TL;DR

This guide shows you how to access a web server running on your local network but only reachable through a proxy using Proxychains. We’ll configure Firefox to use SOCKS5, which Proxychains will then route through your chosen proxy.

Steps

  1. Verify Proxychains Configuration: First, make sure Proxychains is set up correctly with your proxy details. Check the configuration file (usually /etc/proxychains4.conf).
    • Open the config file with a text editor as root:
      sudo nano /etc/proxychains4.conf
    • Find the line starting with `socks5` and ensure it points to your proxy server’s address and port. For example:
      socks5  192.168.1.100 1080
    • Make sure there are no typos and the proxy is reachable from your machine (you can test this with `ping` or `telnet`).
  2. Start Your Web Server: Ensure your web server is running on your local network. For example, a simple Python HTTP server:
    python3 -m http.server 8000

    This will serve files from the current directory on port 8000.

  3. Configure Firefox to Use SOCKS5: We’ll configure Firefox to use a SOCKS v5 proxy, which Proxychains will then handle.
    • Open Firefox and type about:config in the address bar. Accept the risk warning.
    • Search for `network.proxy.type`. Set its value to 1 (Manual proxy configuration).
    • Search for `network.proxy.socks`. Set its value to your local machine’s IP address (usually 127.0.0.1).
    • Search for `network.proxy.socks_port`. Set its value to the port Proxychains listens on, which is usually 9050.
    • Search for `network.proxy.socks_version`. Set its value to 5 (SOCKS v5).
  4. Run Your Application Through Proxychains: Now, run Firefox through Proxychains.
    proxychains4 firefox
  5. Access the Web Server: In Firefox, type http://localhost:8000 (or whatever port your web server is running on) into the address bar. If everything is configured correctly, you should see the content served by your local web server, even though it’s normally inaccessible directly.
  6. Troubleshooting:
    • Check Proxychains Output: When Firefox makes requests, Proxychains will print information to the terminal. Look for any errors or connection issues.
    • Firewall Rules: Ensure your firewall isn’t blocking connections on port 9050 (or whatever port Proxychains is using).
    • Proxy Server Availability: Double-check that your proxy server is running and accessible.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation