hacktricks/network-services-pentesting/3128-pentesting-squid.md

75 lines
3.9 KiB
Markdown
Raw Normal View History

2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}
2022-04-28 16:01:33 +00:00
2022-05-01 12:49:36 +00:00
# Basic Information
2021-04-02 11:54:47 +00:00
2024-02-08 21:36:50 +00:00
From [Wikipedia](https://en.wikipedia.org/wiki/Squid\_\(software\)):
> **Squid** is a caching and forwarding HTTP web proxy. It has a wide variety of uses, including speeding up a web server by caching repeated requests, caching web, DNS and other computer network lookups for a group of people sharing network resources, and aiding security by filtering traffic. Although primarily used for HTTP and FTP, Squid includes limited support for several other protocols including Internet Gopher, SSL, TLS and HTTPS. Squid does not support the SOCKS protocol, unlike Privoxy, with which Squid can be used in order to provide SOCKS support.
2021-04-02 11:54:47 +00:00
**Default port:** 3128
2022-02-03 02:15:45 +00:00
```
2021-04-02 11:54:47 +00:00
PORT STATE SERVICE VERSION
3128/tcp open http-proxy Squid http proxy 4.11
```
2022-05-01 12:49:36 +00:00
# Enumeration
2021-04-02 11:54:47 +00:00
2022-05-01 12:49:36 +00:00
## Web Proxy
2021-04-02 11:54:47 +00:00
You can try to set this discovered service as proxy in your browser. However, if it's configured with HTTP authentication you will be prompted for usernames and password.
2022-02-03 02:15:45 +00:00
```bash
# Try to proxify curl
2022-02-03 02:15:45 +00:00
curl --proxy http://10.10.11.131:3128 http://10.10.11.131
```
2022-05-01 12:49:36 +00:00
## Nmap proxified
2021-04-02 11:54:47 +00:00
2022-02-03 02:15:45 +00:00
You can also try to abuse the proxy to **scan internal ports proxifying nmap**.\
2021-04-02 11:54:47 +00:00
Configure proxychains to use the squid proxy adding he following line at the end of the proxichains.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`.
2021-04-02 11:54:47 +00:00
Then run nmap with proxychains to **scan the host from local**: `proxychains nmap -sT -n -p- localhost`
2022-09-01 00:21:26 +00:00
## SPOSE Scanner
2022-04-28 16:01:33 +00:00
2022-09-01 01:14:37 +00:00
Alternatively, the Squid Pivoting Open Port Scanner ([spose.py](https://github.com/aancw/spose)) can be used.
2022-09-01 00:21:26 +00:00
```bash
python spose.py --proxy http://10.10.11.131:3128 --target 10.10.11.131
```
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}
2022-04-28 16:01:33 +00:00