Resources
- General :
- By scrabingclub : https://www.scraping.club/p/everything-about-proxies
- By geekflare : https://geekflare.com/guides/proxy-server-types/
- By thesocialproxy : https://thesocialproxy.medium.com/proxy-types-and-their-meaning-949bccc3be93
- htpasswd : https://dev.to/iotools/understanding-htpasswd-a-comprehensive-guide-4c31
- install : https://unix.stackexchange.com/questions/94679/what-is-the-purpose-of-the-install-command
- Types : https://www.scrapehero.com/types-of-proxy-servers/
- Transparent :
- Socks :
- Offensive :
Tools
- Free Proxy List : https://free-proxy-list.net/
- Squid : https://github.com/squid-cache/squid
CheatSheet
- thehacker.recipes : https://www.thehacker.recipes/infra/pivoting/socks-proxy
Commands
- Squid
- Setup
apt install squid systemctl status squid # Squid will automatically set up a background service and start after being installed. - Config
- Transparent
- Proxy
cp /etc/squid/squid.conf /etc/squid/squid.conf.stock nano /etc/squid/squid.conf http_port 3128 # Proxy Port acl lab_clients src 192.168.11.0/24 # My Clients Subnet acl SSL_ports port 443 # HTTPS acl Safe_ports port 80 443 21 1025-65535 # Safe ports to connect http_access deny !Safe_ports # Deny if not in SafePorts http_access deny CONNECT !SSL_ports # Deny the Connect if not 443 http_access allow lab_clients # allow all my subnets clients http_access deny all # Deny others visible_hostname proxy.fady # Proxy Name cache deny all # Don't cache access_log /var/log/squid/access.log # Log file squid -k parse && systemctl restart squid && ss -ltnp | grep squid- Username & Password
apt-get install -y apache2-utils htpasswd -c -m /etc/squid/passwd fady chown proxy:proxy /etc/squid/passwd chmod 640 /etc/squid/passwd nano /etc/squid/squid.conf http_port 3128 acl lab_clients src 192.168.11.0/24 acl SSL_ports port 443 acl Safe_ports port 80 443 21 1025-65535 auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd # use ncsa auth and passwd is ur db file auth_param basic children 5 # run 5 workers auth_param basic credentialsttl 2 hours # cache for 2h auth_param basic realm Proxy requires valid user # blok anonymous requests acl authenticated proxy_auth REQUIRED # auth required http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow authenticated lab_clients # aloow lab_clients with auth only http_access deny all cache deny all access_log /var/log/squid/access.log squid -k parse && systemctl restart squid
- Username & Password
- Client
curl -x http://192.168.11.11:3128 http://192.168.22.10/ curl -x http://192.168.11.11:3128 -k https://192.168.22.10/- Username & Password
curl -x http://fady:[email protected]:3128 -k https://192.168.22.10/ # 200 curl -x http://192.168.11.11:3128 -k https://192.168.22.10/ # 407
- Username & Password
- Proxy
- Transparent
- Setup
- 3Proxy
- Socks
- Setup
apt update && apt install -y build-essential git git clone https://github.com/3proxy/3proxy.git make -f Makefile.Linux mkdir -p /opt/3proxy install -m 755 /root/3proxy/bin/3proxy /root/3proxy/bin/3proxy_crypt /opt/3proxy/ # copy the bin (not only copy it's chmod , copy , chown , strip ... ) groupadd -r proxy3 # System Group useradd -r -g proxy3 -d /var/lib/3proxy -s /usr/sbin/nologin proxy3 # system acc , add group , with home dir , with no login mkdir -p /var/lib/3proxy /var/log/3proxy # one for state other for logs chown proxy3:proxy3 /var/lib/3proxy /var/log/3proxy # change the owner install -o root -g proxy3 -m 640 /dev/null /etc/3proxy.cfg # config file nano /etc/3proxy.cfg setgid proxy3 # Group ID setuid proxy3 # User ID nserver 192.168.1.1 # My DNS nscache 65536 # Caching auth iponly # auth with only whitelist IPs allow * 192.168.11.10 # White listed IP deny * # Deny other maxconn 100 # Max connectiosn per user proxy -p3129 -a # HTTP proxy -a anonymous mode [-a1 random client infos] socks -p1080 # start socks proxy nano /etc/systemd/system/3proxy.service # Create a servcie thx for deepseek [Unit] Description=3proxy anonymous HTTP + SOCKS proxy After=network.target [Service] Type=simple # the simplest supervision model. systemd watches that one PID. User=proxy3 # user Group=proxy3 # group ExecStart=/opt/3proxy/3proxy /etc/3proxy.cfg # start command ExecReload=/bin/kill -SIGUSR1 $MAINPID # reload x= restart KillMode=process # kill me Restart=on-failure # restart on failure RestartSec=5 # time LimitNOFILE=1048576 # limite to 1024 files LimitNPROC=infinity TasksMax=infinity NoNewPrivileges=yes # don't assign new ones PrivateTmp=yes # write on tmp PrivateDevices=yes # run on like sandbox to not see other dirs , operations , ... ProtectSystem=strict ProtectHome=yes # don't see any home dirs ProtectKernelTunables=yes ProtectKernelModules=yes ProtectControlGroups=yes RestrictAddressFamilies=AF_INET AF_INET6 # only use IPs RestrictNamespaces=yes LockPersonality=yes ReadWritePaths=/var/log/3proxy # only place to read write CapabilityBoundingSet= AmbientCapabilities= [Install] WantedBy=multi-user.target systemctl daemon-reload # Force the system to read new configuration file systemctl enable --now 3proxy # enable it systemctl status 3proxy --no-pager ss -tulnp | grep -E '3129|1080' # worked- Client
curl -x http://192.168.11.11:3129 http://192.168.22.10/ # Http curl --socks4 192.168.11.11:1080 http://192.168.22.10 # socks4 curl --socks4a 192.168.11.11:1080 http://192.168.22.10/ # socks4a curl --socks5 192.168.11.11:1080 http://192.168.22.10/ # socks5 curl --socks5-hostname 192.168.11.11:1080 http://192.168.22.10/ # socks5h- Dns Leak
tcpdump -i any -n 'udp port 53' # watch dns on client curl --socks5 192.168.11.11:1080 https://fadymoheb.com/ # ask for domain in client tcpdump should fire up curl --socks5-hostname 192.168.11.11:1080 https://fadymoheb.com/ # tcpdump shouldn't show any thing
- Dns Leak
- Client
- Setup
- Socks
- Ngnix
- Reverse Proxy
- Setup
apt update && apt install -y nginx systemctl is-active nginx && ss -tulnp | grep ':80 ' # same as status but it's for scripts curl -s http://192.168.11.11/ | head -4 # check from the client rm -f /etc/nginx/sites-enabled/default # kill the deafult page nano /etc/nginx/sites-available/lab-reverse.conf server { listen 192.168.11.11:80; server_name _; location / { proxy_pass http://192.168.22.10:8001; } } ln -s /etc/nginx/sites-available/lab-reverse.conf /etc/nginx/sites-enabled/ nginx -t systemctl reload nginx ss -tulnp | grep ':80 '- Client
curl -s http://192.168.11.11/ | head -20
- Client
- Setup
- Reverse Proxy
Notes
General
- IPs have a reputation, based on their usage history. If they have been already used in spam attacks or botnets, they don’t have many changes to be considered legit by an anti-bot
- Mobile proxies will always have rotating IPs, if your mobile proxy is not changing IP once in a while, it is definitely not a mobile proxy.
- Standard HTTP requests use plain methods like GET, allowing the proxy to read the full URL and every piece of unencrypted traffic passing through it. In contrast, HTTPS forces the browser to issue an initial CONNECT command, establishing a blind, encrypted tunnel through the proxy where only the destination domain and port are visible.
Squid
- By default, Squid does not allow any clients to connect to it from outside of this server.
- Squid will automatically set up a background service and start after being installed.
- When you install Squid the installer automatically creates a hidden background account named proxy.
- Squid is first-match-wins rules
SOCKS Protocol Matrix & DNS Resolution
SOCKS proxies operate at Layer 5 (Session Layer), routing arbitrary traffic without inspecting payloads. Protocol choice hinges on two orthogonal axes: protocol capabilities (v4 vs. v5) and DNS resolution location (local vs. remote via
a/hextensions).Comparison Matrix
Variant Version DNS Resolution Authentication IPv6 UDP Primary Risk / Limitation SOCKS4 4 Local (Client) ❌ None ❌ ❌ Fails under restricted client DNS; leaks visited domains. SOCKS4a 4 Remote (Proxy) ❌ None ❌ ❌ Bypasses local DNS blocks via 0.0.0.xIP hack; TCP only.SOCKS5 5 Local (Client) ✔️ User/Pass, GSSAPI ✔️ ✔️ DNS Leak: Local resolver (e.g., ISP) sees all hostnames. SOCKS5h 5 Remote (Proxy) ✔️ User/Pass, GSSAPI ✔️ ✔️ Full feature set with zero local DNS exposure.
Key Operational Takeaways
- DNS Leak Surface: Standard
socks5://sends DNS queries through local network interfaces. Always enforcesocks5h://(orsocks4a://on legacy hosts) so the remote proxy resolves domain names inside the tunnel.- Client Syntax Mapping:
- cURL:
--socks5(local DNS) vs.--socks5-hostname/socks5h://(remote DNS).- Python (
urllib3): Usesocks5h://scheme explicitly.- Firefox: Toggle
network.proxy.socks5_remote_dnstotrue.- Selection Rule: Default to SOCKS5h for security and privacy. Fall back to SOCKS4a only for legacy environments lacking SOCKS5 support.
