> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/proxys-squid-attack/proxys-squid-techniques-pentesting-web.md).

# Squid 代理技术

## SQUID 代理：

如果我们对 80 端口进行扫描，它表明它是 **被过滤** 而不是关闭：

<figure><img src="/files/e16af9f309cfef1e2f3a9daff130b9cce67cb198" alt="" width="563"><figcaption></figcaption></figure>

### 使用 FoxyProxy 的方法

这是正常的网站，其中 **什么也没有出现**:

<figure><img src="/files/b587b9f7472a36f54bf297b5a9835d466a900517" alt="" width="560"><figcaption></figcaption></figure>

我们使用……创建一个新代理 **机器的 IP** 和端口 **3128**:

<figure><img src="/files/f94e6e407fa8b91a4645d74619d1ff8703d6f0fe" alt="" width="563"><figcaption></figcaption></figure>

使用 **FoxyProxy**，内容会显示：

<figure><img src="/files/d56b312fa01875951b7528b74279a1c46db214be" alt="" width="563"><figcaption></figcaption></figure>

### 命令行方法：

我们使用机器的代理通过端口向 Web 服务器发送一个 curl 请求 **3128**:

<figure><img src="/files/69c23c302daa68e0cd3f0221b86251b2019f0785" alt="" width="562"><figcaption></figcaption></figure>

如果它要求 **认证**，请按如下方式进行：

<figure><img src="/files/fabf50eeaaa8f0d3a24d4a4b17dbdb07b272e094" alt="" width="563"><figcaption></figcaption></figure>

## 路径侦察（通过代理）：

有时， **路径只会出现** 只有通过代理才能看到，下面是查看它们的示例：

```bash
gobuster dir -u http://192.168.71.131/ --proxy http://192.168.71.131:3128 -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 20

```

<figure><img src="/files/4cd9d1a8840215a41ba7d325b1f808d1c8dfe256" alt="" width="563"><figcaption></figcaption></figure>

## 自动化 Python 脚本：

```python
#!/usr/bin/python3
import sys, signal, requests
def def_handler(sig, frame):
    print("/n/n[!] 正在退出.../n")
    sys.exit(1)
# Squid 代理技术
signal.signal(signal.SIGINT, def_handler)
main_url = "http://127.0.0.1"
squid_proxy = {'http': 'http://192.168.71.131:3128'}
def portDiscovery():
    common_tcp_port= {21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 443, 445, 993, 995, 1723, 3306, 3389, 5900, 8080, 8443, 8888, 5900, 6666, 6667, 6668, 6669, 7000, 10000, 32768, 32769, 32770, 32771, 32772, 32773, 32774, 32775, 32776, 32777, 32778, 32779, 49152, 49153, 49154, 49155, 49156, 49157, 49158, 49159, 49160, 49161, 49162}
    for tcp_port in common_tcp_port:
        r = requests.get(main_url + ':' + str(tcp_port), proxies=squid_proxy)
        if r.status_code != 503:
            print("/n[+] Port " + str(tcp_port) + "- OPEN")
if __name__ == '__main__':
    portDiscovery()

```

<figure><img src="/files/350a57fd106b4161979332a5d7f586c9b914e6ba" alt="" width="563"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/zh/web-vulnerabilities/proxys-squid-attack/proxys-squid-techniques-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
