> 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/reconnaissance/network-manual-scan.md).

# 手動ネットワークスキャン

重いスキャナーを使わずに、ホスト探索、ポート確認、バナー取得、サービス検証、素早い列挙を行うための手動ネットワークスキャンのメモ。

{% hint style="info" %}
この文書では、Nmapのような自動化ツールを使わない手動のネットワークスキャン手法を詳しく説明します。シンプルで効果的なコマンド（たとえば `/dev/tcp`, `ping`, `netcat`、など）を使って、アクティブなホストを特定し、開いているポートを確認し、ネットワーク上のサービスを診断する方法を学びます。ネットワーク診断の基礎を理解し、必要に応じて分析をカスタマイズするのに最適です。
{% endhint %}

## 特定のポート（HTTP - ポート80）

```bash
echo '' > /dev/tcp/192.168.1.1/80 && echo "[+] HTTP は開いています" || echo "[-] HTTP は閉じています"
```

## 複数のポート（SSH、HTTP、HTTPS）

ポート一覧をテストするための簡単なコマンド:

```bash
for port in 22 80 443; do
  echo '' > /dev/tcp/192.168.1.1/$port && echo "[+] ポート $port は開いています" || echo "[-] ポート $port は閉じています"
done
```

## IP一覧と単一ポート

指定したポート（たとえば22）が複数のIPで開いているかを確認するには:

```bash
for ip in 192.168.1.1 192.168.1.2 192.168.1.3; do
  echo '' > /dev/tcp/$ip/22 && echo "[+] $ip 上で SSH は開いています" || echo "[-] $ip 上で SSH は閉じています"
done
```

## ポート範囲をスキャンするループ

特定の範囲でマシンのポートをスキャンするには:

```bash
for port in {20..30}; do
  echo '' > /dev/tcp/192.168.1.1/$port && echo "[+] ポート $port は開いています" || echo "[-] ポート $port は閉じています"
done
```

## 複数のIPとポートに対するサービス

一連のIPと複数のポートをテストするには:

```bash
for ip in 192.168.1.1 192.168.1.2; do
  for port in 80 443 8080; do
    echo '' > /dev/tcp/$ip/$port && echo "[+] $ip:$port は開いています" || echo "[-] $ip:$port は閉じています"
  done
done
```

## ネットワークを診断する高度なスクリプト

対象のポートをスキャンし、その結果をファイルに保存する小さなスクリプトを作成します:

```bash
#!/bin/bash

target="192.168.1.1"
output="scan_results.txt"

echo "$target をスキャンしています..." > $output
for port in {1..1024}; do
  if echo '' > /dev/tcp/$target/$port 2>/dev/null; then
    echo "[+] ポート $port は開いています" | tee -a $output
  else
    echo "[-] ポート $port は閉じています" >> $output
  fi
done
echo "スキャンが完了しました。結果は $output に保存されました。"
```


---

# 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/reconnaissance/network-manual-scan.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.
