--- title: "3128/tcp - Pentesting Squid" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/3128-pentesting-squid.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/3128-pentesting-squid.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0" --- # 3128/tcp - Pentesting Squid ## Basic Information **Squid** is a caching and forwarding HTTP proxy. Deployments use it for outbound access control, caching, reverse-proxy acceleration, and traffic filtering. It is an HTTP proxy rather than a SOCKS proxy, and TCP tunnelling is controlled through HTTP `CONNECT` and Squid ACLs. Port **3128** is conventional, but `http_port` is configurable.[[5]](#references) **Default port:** 3128 ```text PORT STATE SERVICE VERSION 3128/tcp open http-proxy Squid http proxy 4.11 ``` ## Enumeration ### Web Proxy You can configure the discovered service as an HTTP proxy in your browser. If it requires proxy authentication, the client will prompt for a username and password. ```bash # Try to proxify curl curl --proxy http://10.10.11.131:3128 http://10.10.11.131 ``` ### Open-proxy / egress validation First verify whether it is really behaving as a forward proxy and whether outbound Internet access is allowed. ```bash # Fast open-proxy detection nmap -Pn -sV -p 3128 --script http-open-proxy # Confirm egress and learn the public IP used by the proxy curl -x http://:3128 https://ifconfig.me # If authentication is required, curl will usually show 407 Proxy Authentication Required curl -x http://:3128 http://example.com -v curl -x http://user:pass@:3128 http://example.com -v ``` If the proxy is reachable but Internet egress is blocked, it may still be useful as an **internal pivot**. ### Nmap proxified You can also try to use the proxy to **scan internal TCP ports through Nmap**.\ Configure proxychains to use the Squid proxy by adding the following line at the end of the `proxychains.conf` file: `http 10.10.10.10 3128` For proxies requiring authentication, append credentials to the configuration by including the username and password at the end: `http 10.10.10.10 3128 username passw0rd`. Then run Nmap with proxychains to scan from the proxy's perspective: `proxychains nmap -sT -Pn -n -p- localhost`. Proxychains only intercepts compatible TCP `connect()` calls, so avoid SYN/UDP scans and validate results manually because proxy errors can produce misleading port states. ### SPOSE Scanner Alternatively, the Squid Pivoting Open Port Scanner ([spose.py](https://github.com/aancw/spose)) can be used.[[1]](#references) ```bash python spose.py --proxy http://10.10.11.131:3128 --target 10.10.11.131 ``` ### Cache Manager enumeration Misconfigured Squid deployments sometimes expose the **Cache Manager**, which can leak version info, counters, ACL hints, peer configuration, and sometimes the full running configuration.[[2]](#references) On modern Squid versions this is usually exposed below `/squid-internal-mgr/`: ```bash # Enumerate available manager actions curl http://:3128/squid-internal-mgr/menu # Common high-value pages curl http://:3128/squid-internal-mgr/info curl http://:3128/squid-internal-mgr/counters curl http://:3128/squid-internal-mgr/active_requests # If cachemgr_passwd is configured and HTTP Basic auth is accepted curl -u any:PASSWORD http://:3128/squid-internal-mgr/config ``` Older installations may also expose the historical `cache_object://` scheme through `squidclient`/`curl`; that scheme was removed during the Squid 6 series. If manager ACLs are weak, treat this as a sensitive administrative surface.[[2]](#references) ### ACL bypass / internal reachability tests A common win is finding that `http_access`, `Safe_ports`, `SSL_ports`, `to_localhost`, or `manager` ACLs were relaxed too much. Test both plain HTTP proxying and `CONNECT` tunneling. ```bash # Direct HTTP requests to RFC1918 / loopback targets through the proxy curl -x http://:3128 http://127.0.0.1:8080/ -v curl -x http://:3128 http://[::1]:8080/ -v curl -x http://:3128 http://169.254.169.254/latest/meta-data/ -v curl -x http://:3128 http://192.168.1.10:8000/ -v # Force a CONNECT tunnel and perform a TLS handshake with an internal TLS service openssl s_client -proxy :3128 -connect 127.0.0.1:443 -quiet openssl s_client -proxy :3128 -connect 10.10.10.20:8443 -quiet ``` This is especially useful when Squid is installed on a bastion, printer server, CI runner, or appliance that can reach sensitive loopback-only services. ### Pivot & tooling configuration *Use Squid as a discovery pivot and a transparent upstream hop for CLI and browser tools.*[[4]](#references) - **Scan “from” the proxy:** run SPOSE through Squid to enumerate ports reachable from the proxy host/loopback. With [uv](https://github.com/astral-sh/uv) you can install deps and scan all TCP ports directly: ```bash uv add --script spose.py -r requirements.txt uv run spose.py --proxy http://SQUID_IP:3128 --target localhost --allports ``` - **Proxychains for HTTP interaction:** append a strict HTTP entry at the bottom of `/etc/proxychains.conf`: ```ini [ProxyList] http SQUID_IP 3128 ``` Then interact with internal listeners (e.g., a web UI bound to 127.0.0.1) transparently through Squid: ```bash proxychains curl http://127.0.0.1:9191 -v ``` - **Chaining Burp/Browser → Squid:** configure Burp *Proxy → Settings → Network → Connections → Upstream proxy servers* to point to `http://SQUID_IP:3128`. Requests to internal hosts such as `http://127.0.0.1:9191` will traverse Browser → Burp → Squid → target, enabling full interception of services otherwise not reachable externally. For more generic tunnel and pivot techniques, see [Tunneling and Port Forwarding](https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/generic-hacking/tunneling-and-port-forwarding.md). ### Notes for proxy security reviews If you are **auditing Squid itself** (not just using it as a pivot), include these checks in scope: - **Open proxy exposure:** confirm whether unauthenticated users can relay traffic externally or into internal address space. - **Manager exposure:** `/squid-internal-mgr/menu` and related pages often disclose enough information to accelerate lateral movement. - **CONNECT restrictions:** weak `SSL_ports` / `Safe_ports` handling can turn Squid into a generic TCP tunnel to arbitrary ports. - **Parser/cache poisoning tests on outdated builds:** recent advisories and public research show that request smuggling, lenient chunked decoding, and cache-poisoning style bugs have affected Squid repeatedly. If you are testing an older or vendor-patched appliance, add controlled TE/CL desync and cache-variant poisoning checks to the test plan.[[3]](#references) ## References - [1] [SPOSE – Squid Pivoting Open Port Scanner](https://github.com/aancw/spose) - [2] [The Cache Manager - Squid Web Cache wiki](https://wiki.squid-cache.org/Features/CacheManager/Index) - [3] [Squid Caching Proxy Security Audit: 55 vulnerabilities and 35 0days](https://megamansec.github.io/Squid-Security-Audit/) - [4] [HTB Bamboo walkthrough (Squid pivoting example)](https://0xdf.gitlab.io/2026/02/03/htb-bamboo.html) - [5] [Squid Web Cache wiki - configuring browsers and the default proxy port](https://wiki.squid-cache.org/SquidFaq/ConfiguringBrowsers)