Security Scanning Tools について
ネットワーク、脆弱性、Web、無線、クラウド、コンプライアンスのスキャンツール選定と利用手順をまとめたスキルです。許可を得て評価を行うセキュリティ担当者を対象とします。
主な機能
- 01ネットワークとポートの検出
- 02脆弱性・コンプライアンス評価
- 03Webアプリケーションテスト
- 04無線ネットワークスキャン
- 05クラウドセキュリティ監査
- 06スキャン手順とレポート
活用シーン
- 01ネットワークのホスト、ポート、サービスの把握
- 02脆弱性と設定リスクの評価
- 03Webアプリケーションのセキュリティ確認
- 04クラウド環境やコンプライアンスの監査
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill security-scanning-toolsインストール後、Claude Code で/security-scanning-toolsを入力して読み込まれたか確認します。
詳細
セキュリティスキャンツール
目的
ネットワーク探索、脆弱性評価、Webアプリケーションテスト、無線セキュリティ、コンプライアンス検証に必要な主要セキュリティスキャンツールを習得します。このスキルでは、スキャンのカテゴリごとにツールの選定、設定、実践的な使い方を扱います。
前提条件
必要な環境
- Linuxベースのシステム(Kali Linux推奨)
- 対象システムへのネットワークアクセス
- スキャン活動に対する適切な許可
必要な知識
- ネットワークの基本概念(TCP/IP、ポート、プロトコル)
- 一般的な脆弱性の理解
- コマンドラインインターフェースへの精通
出力と成果物
- ネットワーク探索レポート - 特定されたホスト、ポート、サービス
- 脆弱性評価レポート - CVE、設定ミス、リスク評価
- Webアプリケーションセキュリティレポート - OWASP Top 10 の検出結果
- コンプライアンスレポート - CISベンチマーク、PCI-DSS、HIPAA のチェック
コアワークフロー
フェーズ1: ネットワークスキャンツール
Nmap(Network Mapper)
ネットワーク探索とセキュリティ監査のための主要ツール:
# Host discovery
nmap -sn 192.168.1.0/24 # Ping scan (no port scan)
nmap -sL 192.168.1.0/24 # List scan (DNS resolution)
nmap -Pn 192.168.1.100 # Skip host discovery
# Port scanning techniques
nmap -sS 192.168.1.100 # TCP SYN scan (stealth)
nmap -sT 192.168.1.100 # TCP connect scan
nmap -sU 192.168.1.100 # UDP scan
nmap -sA 192.168.1.100 # ACK scan (firewall detection)
# Port specification
nmap -p 80,443 192.168.1.100 # Specific ports
nmap -p- 192.168.1.100 # All 65535 ports
nmap -p 1-1000 192.168.1.100 # Port range
nmap --top-ports 100 192.168.1.100 # Top 100 common ports
# Service and OS detection
nmap -sV 192.168.1.100 # Service version detection
nmap -O 192.168.1.100 # OS detection
nmap -A 192.168.1.100 # Aggressive (OS, version, scripts)
# Timing and performance
nmap -T0 192.168.1.100 # Paranoid (slowest, IDS evasion)
nmap -T4 192.168.1.100 # Aggressive (faster)
nmap -T5 192.168.1.100 # Insane (fastest)
# NSE Scripts
nmap --script=vuln 192.168.1.100 # Vulnerability scripts
nmap --script=http-enum 192.168.1.100 # Web enumeration
nmap --script=smb-vuln* 192.168.1.100 # SMB vulnerabilities
nmap --script=default 192.168.1.100 # Default script set
# Output formats
nmap -oN scan.txt 192.168.1.100 # Normal output
nmap -oX scan.xml 192.168.1.100 # XML output
nmap -oG scan.gnmap 192.168.1.100 # Grepable output
nmap -oA scan 192.168.1.100 # All formats
Masscan
大規模ネットワーク向けの高速ポートスキャン:
# Basic scanning
masscan -p80 192.168.1.0/24 --rate=1000
masscan -p80,443,8080 192.168.1.0/24 --rate=10000
# Full port range
masscan -p0-65535 192.168.1.0/24 --rate=5000
# Large-scale scanning
masscan 0.0.0.0/0 -p443 --rate=100000 --excludefile exclude.txt
# Output formats
masscan -p80 192.168.1.0/24 -oG results.gnmap
masscan -p80 192.168.1.0/24 -oJ results.json
masscan -p80 192.168.1.0/24 -oX results.xml
# Banner grabbing
masscan -p80 192.168.1.0/24 --banners
フェーズ2: 脆弱性スキャンツール
Nessus
エンタープライズグレードの脆弱性評価:
# Start Nessus service
sudo systemctl start nessusd
# Access web interface
# https://localhost:8834
# Command-line (nessuscli)
nessuscli scan --create --name "Internal Scan" --targets 192.168.1.0/24
nessuscli scan --list
nessuscli scan --launch <scan_id>
nessuscli report --format pdf --output report.pdf <scan_id>
Nessusの主な機能:
- 包括的なCVE検出
- コンプライアンスチェック(PCI-DSS、HIPAA、CIS)
- カスタムスキャンテンプレート
- より詳細な分析のための認証付きスキャン
- 定期的なプラグイン更新
OpenVAS(Greenbone)
オープンソースの脆弱性スキャン:
# Install OpenVAS
sudo apt install openvas
sudo gvm-setup
# Start services
sudo gvm-start
# Access web interface (Greenbone Security Assistant)
# https://localhost:9392
# Command-line operations
gvm-cli socket --xml "<get_version/>"
gvm-cli socket --xml "<get_tasks/>"
# Create and run scan
gvm-cli socket --xml '
<create_target>
<name>Test Target</name>
<hosts>192.168.1.0/24</hosts>
</create_target>'
フェーズ3: Webアプリケーションスキャンツール
Burp Suite
包括的なWebアプリケーションテスト:
# Proxy configuration
1. Set browser proxy to 127.0.0.1:8080
2. Import Burp CA certificate for HTTPS
3. Add target to scope
# Key modules:
- Proxy: Intercept and modify requests
- Spider: Crawl web applications
- Scanner: Automated vulnerability detection
- Intruder: Automated attacks (fuzzing, brute-force)
- Repeater: Manual request manipulation
- Decoder: Encode/decode data
- Comparer: Compare responses
コアテストワークフロー:
- プロキシとスコープを設定する
- アプリケーションをスパイダリングする
- サイトマップを分析する
- アクティブスキャナーを実行する
- Repeater/Intruderを使って手動テストを行う
- 検出結果を確認し、レポートを生成する
OWASP ZAP
オープンソースのWebアプリケーションスキャナー:
# Start ZAP
zaproxy
# Automated scan from CLI
zap-cli quick-scan https://target.com
# Full scan
zap-cli spider https://target.com
zap-cli active-scan https://target.com
# Generate report
zap-cli report -o report.html -f html
# API mode
zap.sh -daemon -port 8080 -config api.key=<your_key>
ZAPの自動化:
# Docker-based scanning
docker run -t owasp/zap2docker-stable zap-full-scan.py \
-t https://target.com -r report.html
# Baseline scan (passive only)
docker run -t owasp/zap2docker-stable zap-baseline.py \
-t https://target.com -r report.html
Nikto
Webサーバーの脆弱性スキャナー:
# Basic scan
nikto -h https://target.com
# Scan specific port
nikto -h target.com -p 8080
# Scan with SSL
nikto -h target.com -ssl
# Multiple targets
nikto -h targets.txt
# Output formats
nikto -h target.com -o report.html -Format html
nikto -h target.com -o report.xml -Format xml
nikto -h target.com -o report.csv -Format csv
# Tuning options
nikto -h target.com -Tuning 123456789 # All tests
nikto -h target.com -Tuning x # Exclude specific tests
フェーズ4: 無線スキャンツール
Aircrack-ng スイート
無線ネットワークのペネトレーションテスト:
# Check wireless interface
airmon-ng
# Enable monitor mode
sudo airmon-ng start wlan0
# Scan for networks
sudo airodump-ng wlan0mon
# Capture specific network
sudo airodump-ng -c <channel> --bssid <target_bssid> -w capture wlan0mon
# Deauthentication attack
sudo aireplay-ng -0 10 -a <bssid> wlan0mon
# Crack WPA handshake
aircrack-ng -w wordlist.txt -b <bssid> capture*.cap
# Crack WEP
aircrack-ng -b <bssid> capture*.cap
Kismet
パッシブな無線検出:
# Start Kismet
kismet
# Specify interface
kismet -c wlan0
# Access web interface
# http://localhost:2501
# Detect hidden networks
# Kismet passively collects all beacon frames
# including those from hidden SSIDs
フェーズ5: マルウェアおよびエクスプロイトのスキャン
ClamAV
オープンソースのアンチウイルススキャン:
# Update virus definitions
sudo freshclam
# Scan directory
clamscan -r /path/to/scan
# Scan with verbose output
clamscan -r -v /path/to/scan
# Move infected files
clamscan -r --move=/quarantine /path/to/scan
# Remove infected files
clamscan -r --remove /path/to/scan
# Scan specific file types
clamscan -r --include='\.exe$|\.dll$' /path/to/scan
# Output to log
clamscan -r -l scan.log /path/to/scan
Metasploit による脆弱性の検証
エクスプロイトによって脆弱性を検証します:
# Start Metasploit
msfconsole
# Database setup
msfdb init
db_status
# Import Nmap results
db_import /path/to/nmap_scan.xml
# Vulnerability scanning
use auxiliary/scanner/smb/smb_ms17_010
set RHOSTS 192.168.1.0/24
run
# Auto exploitation
vulns # View vulnerabilities
analyze # Suggest exploits
フェーズ6: クラウドセキュリティスキャン
Prowler(AWS)
AWSのセキュリティ評価:
# Install Prowler
pip install prowler
# Basic scan
prowler aws
# Specific checks
prowler aws -c iam s3 ec2
# Compliance framework
prowler aws --compliance cis_aws
# Output formats
prowler aws -M html json csv
# Specific region
prowler aws -f us-east-1
# Assume role
prowler aws -R arn:aws:iam::123456789012:role/ProwlerRole
ScoutSuite(マルチクラウド)
マルチクラウドのセキュリティ監査:
# Install ScoutSuite
pip install scoutsuite
# AWS scan
scout aws
# Azure scan
scout azure --cli
# GCP scan
scout gcp --user-account
# Generate report
scout aws --report-dir ./reports
フェーズ7: コンプライアンススキャン
Lynis
Unix/Linux向けのセキュリティ監査:
# Run audit
sudo lynis audit system
# Quick scan
sudo lynis audit system --quick
# Specific profile
sudo lynis audit system --profile server
# Output report
sudo lynis audit system --report-file /tmp/lynis-report.dat
# Check specific section
sudo lynis show profiles
sudo lynis audit system --tests-from-group malware
OpenSCAP
セキュリティコンプライアンススキャン:
# List available profiles
oscap info /usr/share/xml/scap/ssg/content/ssg-<distro>-ds.xml
# Run scan with profile
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_pci-dss \
--report report.html \
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
# Generate fix script
oscap xccdf generate fix \
--profile xccdf_org.ssgproject.content_profile_pci-dss \
--output remediation.sh \
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
フェーズ8: スキャン手法
体系的なスキャンのアプローチ:
-
計画
- スコープと目的を定義する
- 適切な許可を取得する
- 適切なツールを選定する
-
探索
- ホスト探索(Nmapによるping sweep)
- ポートスキャン
- サービスの列挙
-
脆弱性評価
- 自動スキャン(Nessus/OpenVAS)
- Webアプリケーションスキャン(Burp/ZAP)
- 手動による検証
-
分析
- 検出結果を関連付ける
- 誤検知を排除する
- 深刻度で優先順位を付ける
-
報告
- 検出結果を文書化する
- 修正のガイダンスを提供する
- エグゼクティブサマリー
フェーズ9: ツール選定ガイド
各シナリオに適したツールを選びます:
| シナリオ | 推奨ツール |
|---|---|
| ネットワーク探索 | Nmap、Masscan |
| 脆弱性評価 | Nessus、OpenVAS |
| Webアプリテスト | Burp Suite、ZAP、Nikto |
| 無線セキュリティ | Aircrack-ng、Kismet |
| マルウェア検出 | ClamAV、YARA |
| クラウドセキュリティ | Prowler、ScoutSuite |
| コンプライアンス | Lynis、OpenSCAP |
| プロトコル分析 | Wireshark、tcpdump |
フェーズ10: レポートと文書化
プロフェッショナルなレポートを作成します:
# Nmap XML to HTML
xsltproc nmap-output.xml -o report.html
# OpenVAS report export
gvm-cli socket --xml '<get_reports report_id="<id>" format_id="<pdf_format>"/>'
# Combine multiple scan results
# Use tools like Faraday, Dradis, or custom scripts
# Executive summary template:
# 1. Scope and methodology
# 2. Key findings summary
# 3. Risk distribution chart
# 4. Critical vulnerabilities
# 5. Remediation recommendations
# 6. Detailed technical findings
クイックリファレンス
Nmap チートシート
| スキャンの種類 | コマンド |
|---|---|
| Ping スキャン | nmap -sn <target> |
| クイックスキャン | nmap -T4 -F <target> |
| フルスキャン | nmap -p- <target> |
| サービススキャン | nmap -sV <target> |
| OS 検出 | nmap -O <target> |
| アグレッシブ | nmap -A <target> |
| 脆弱性スクリプト | nmap --script=vuln <target> |
| ステルススキャン | nmap -sS -T2 <target> |
一般的なポートの一覧
| ポート | サービス |
|---|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 445 | SMB |
| 3306 | MySQL |
| 3389 | RDP |
制約と制限事項
法的な考慮事項
- 必ず書面による許可を取得してください
- スコープの境界を尊重してください
- 責任ある開示の慣行に従ってください
- 現地の法律および規制を遵守してください
技術的な制限事項
- 一部のスキャンは IDS/IPS のアラートを発生させる可能性があります
- 負荷の高いスキャンはネットワークのパフォーマンスに影響を与える可能性があります
- 誤検知は手動で検証する必要があります
- 暗号化されたトラフィックでは分析が制限される場合があります
ベストプラクティス
- 非侵入型のスキャンから始めてください
- スキャンの強度は段階的に上げてください
- すべてのスキャン活動を文書化してください
- 報告の前に検出結果を検証してください
トラブルシューティング
ホストが検出されない
解決策:
- 別の検出方法を試してください:
nmap -Pnまたはnmap -sn -PS/PA/PU - ICMP をブロックしているファイアウォールのルールを確認してください
- TCP SYN スキャンを使用してください:
nmap -PS22,80,443 - ネットワークの接続を確認してください
スキャンのパフォーマンスが遅い
解決策:
- タイミングを上げてください:
nmap -T4または-T5 - ポート範囲を絞ってください:
--top-ports 100 - 初期検出には Masscan を使用してください
- DNS 解決を無効にしてください:
-n
Web スキャナーが脆弱性を検出しない
解決策:
- 保護された領域にアクセスするため認証を行ってください
- クロールの深さを増やしてください
- カスタムのインジェクションポイントを追加してください
- 網羅性を高めるため複数のツールを使用してください
- 手動テストを実施してください
コメント
Markdown 対応