> 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/ja/web-vulnerabilities/proxys-squid-attack/proxys-squid-techniques-pentesting-web.md).

# Squid プロキシ手法

Squid プロキシ手法に関する、Webアプリケーションのペネトレーションテスト、エクスプロイトのワークフロー、ペイロード検証、影響評価、修正の文脈でのメモ。

## SQUIDプロキシ:

ポート80でこれをスキャンすると、それは〜であることを示します **フィルタリングされている** そして閉じられていない：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-db58c68757c2777200414a0084ef758adbe6ecfc%2FPasted%20image%2020231022221232.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### FoxyProxyを使う方法

これは通常のサイトで、そこで **何も表示されない**:

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-1e7b7f545535f0f897f8413d0868d510a83dcf73%2FPasted%20image%2020231022221450.png?alt=media" alt="" width="560"><figcaption></figcaption></figure>

次の設定で新しいプロキシを作成します **マシンのIP** およびポート **3128**:

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-23822b806e5bc12870b6c8ddd7b7dd81b7d65147%2FPasted%20image%2020231022221312.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

次の **FoxyProxy**すると、コンテンツが表示されます：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-40d345b6f2f00dd59dba19a23b2fea8402c51296%2FPasted%20image%2020231022221530.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

### コマンドラインでの方法：

curlで、マシンのプロキシを使ってWebサーバーにリクエストを送ります。ポート **3128**:

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-59e246722f01be3f306fdb667e82e49da7ee7174%2FPasted%20image%2020231022221049.png?alt=media" alt="" width="562"><figcaption></figcaption></figure>

もし求められたら **認証**、次のようにします：

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d83d4bb98e7853c78d0cbe0894e5f1dc8624ac18%2FPasted%20image%2020231022224025.png?alt=media" 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="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a66c8d09b69185e7af7549763a68d697b53e0c7d%2FPasted%20image%2020231022222001.png?alt=media" 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[+] ポート " + str(tcp_port) + "- OPEN")
if __name__ == '__main__':
    portDiscovery()

```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9cd22ca343642d9cf4c4a4d68cb9e69bf30e6c25%2FPasted%20image%2020231022223604.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
