### ProxyChains-NG Configuration Example Source: https://context7.com/rofl0r/proxychains-ng/llms.txt An example of how to configure a proxy server in the ProxyChains-NG configuration file. ```plaintext # Use case: Forward through TCP relay/bouncer raw bouncer.example.com 12345 ``` -------------------------------- ### Manage proxychains4-daemon Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Commands to start and configure the proxychains4-daemon for external DNS resolution. This is useful for async-unsafe applications. ```bash proxychains4-daemon -i 127.0.0.1 -p 1053 -r 224 proxychains4-daemon -i 127.0.0.1 -p 5353 proxychains4-daemon --help ``` -------------------------------- ### Debug ProxyChains-NG Connectivity and DNS Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Commands to test proxy connectivity, run ProxyChains-NG with verbose output, check external IP, and verify DNS leak prevention. Includes GDB debugging examples. ```bash # Test proxy connectivity directly nc -zv proxy.example.com 1080 # Run with verbose output (disable quiet mode) proxychains4 curl -v https://example.com 2>&1 # Check your external IP through proxy proxychains4 curl ifconfig.me proxychains4 curl https://api.ipify.org # Verify DNS isn't leaking (should show proxy's DNS) proxychains4 curl https://dnsleaktest.com # Debug with GDB gdb --args proxychains4 -f ./proxychains.conf program args # Alternative GDB method without wrapper # (gdb) set exec-wrapper env 'LD_PRELOAD=libproxychains4.so' ``` -------------------------------- ### Resolve DNS via proxyresolv Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Uses the legacy proxyresolv script to perform DNS lookups through the proxy chain. Requires dig or drill installed on the system. ```bash proxyresolv example.com DNS_SERVER=1.1.1.1 proxyresolv example.com proxychains4 dig example.com @8.8.8.8 +tcp ``` -------------------------------- ### Build ProxyChains-NG for macOS Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Instructions for compiling ProxyChains-NG on macOS, including support for different architectures and hook methods. It also shows how to use the tool with SIP enabled. ```bash # Build for macOS (auto-detects appropriate settings) ./configure make # Build fat binary for Intel and Apple Silicon ./configure --fat-binary-m1 make # Build for M2+ Macs (arm64, arm64e, x86_64) ./configure --fat-binary-m2 make # Force specific hook method (auto is recommended) ./configure --hookmethod=dyld # For macOS 12+ (Monterey) ./configure --hookmethod=dlsym # Legacy method # SIP workaround: Copy system binary to home directory cp /usr/bin/curl ~/curl-proxy proxychains4 ~/curl-proxy https://example.com ``` -------------------------------- ### Runtime Configuration via Environment Variables Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Override configuration file settings dynamically using environment variables to control proxy behavior without file modification. ```bash export PROXYCHAINS_CONF_FILE=/path/to/custom.conf export PROXYCHAINS_QUIET_MODE=1 PROXYCHAINS_CONF_FILE=./my.conf proxychains4 ssh user@host ``` -------------------------------- ### Proxy Authentication Configuration Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Configure authentication for SOCKS5 and HTTP proxies. Supports standard credentials and URL-based authentication strings. ```ini [ProxyList] socks5 proxy.example.com 1080 username password http proxy.example.com 8080 username password socks4 proxy.example.com 1080 userid socks5://myuser:mypass@proxy.example.com:1080 http://webuser:webpass@proxy.example.com:8080 ``` -------------------------------- ### TOR Integration and Usage Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Configure ProxyChains-NG to route traffic through the TOR network and execute commands via the proxychain wrapper. ```ini strict_chain proxy_dns remote_dns_subnet 224 [ProxyList] socks5 127.0.0.1 9050 ``` ```bash sudo systemctl start tor proxychains4 curl https://check.torproject.org proxychains4 curl http://example.onion proxychains4 firefox proxychains4 ssh user@hostname ``` -------------------------------- ### Configure DNS Resolution Methods Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Configures how DNS queries are handled to prevent leaks. Methods include built-in proxy resolution, legacy script-based resolution, and daemon-based resolution. ```ini proxy_dns remote_dns_subnet 224 proxy_dns_old proxy_dns_daemon 127.0.0.1:1053 ``` -------------------------------- ### Configure Network Exclusions Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Define local network subnets and specific host/port combinations that should bypass the proxy chain. This is essential for maintaining connectivity to local services. ```ini localnet 127.0.0.0/255.0.0.0 localnet 192.168.1.0/255.255.255.0 localnet 192.168.1.0:80/255.255.255.0 localnet 0.0.0.0:22/0.0.0.0 localnet ::1/128 localnet [fe80::]:80/10 ``` -------------------------------- ### Raw Proxy Forwarding Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Forward TCP traffic directly to a proxy without protocol-specific negotiation, useful for custom protocols. ```ini [ProxyList] raw 192.168.1.100 8888 socks5 first.proxy.com 1080 user pass raw middle.relay.com 9000 ``` -------------------------------- ### Configure ProxyChains-NG Chain Types Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Defines the four primary proxy chaining strategies in proxychains.conf. These settings dictate how traffic is routed and how the system handles proxy failures. ```ini strict_chain dynamic_chain random_chain chain_len = 2 round_robin_chain chain_len = 2 ``` -------------------------------- ### Transparent Destination NAT (DNAT) Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Redirect traffic intended for a specific destination IP and port to a different target. Useful for service redirection or testing environments. ```ini dnat 1.1.1.1:443 10.0.0.1:8443 dnat 1.1.1.1 10.0.0.1:443 dnat 1.1.1.1:80 1.1.1.1:8080 dnat 8.8.8.8 192.168.1.1 dnat 93.184.216.34:443 127.0.0.1:8443 dnat 10.0.0.50:5432 10.0.1.50:5432 ``` -------------------------------- ### Define Local Network Exclusions Source: https://context7.com/rofl0r/proxychains-ng/llms.txt Configures the localnet directive to bypass proxy routing for specific IP ranges. This ensures local resources remain accessible while external traffic is proxied. ```ini localnet 10.0.0.0/8 localnet 172.16.0.0/12 localnet 192.168.0.0/16 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.