ASNmap ASNマッピングツール チートシート
概要
ASNmapは、Project Discoveryによって開発された、自律システム番号(ASN)とその対応するIPレンジ、組織情報をマッピングするための高速で多用途なツールです。ASNデータを簡単かつ効率的に取得する方法を提供し、ネットワーク偵察と攻撃対象領域のマッピングに不可欠です。
他のASNルックアップツールと比べて、ASNmapの特徴は、その速度、シンプルさ、そして多様性です。ASN番号、IPアドレス、ドメイン名、組織名など、複数の入力形式をサポートしており、さまざまな偵察シナリオに柔軟に対応できるツールとなっています。ASNmapは、特定の組織やASNに関連するIPレンジをすばやく取得でき、セキュリティ専門家がターゲットのネットワークフットプリントを理解するのに役立ちます。
ASNmapは、セキュリティ評価やバグバウンティハンティングの初期段階で一般的に使用され、ターゲット組織に属するIPスペースを特定します。この情報は、その後のスキャンや列挙活動に非常に重要です。このツールは、セキュリティワークフローに簡単に統合でき、他の偵察ツールと組み合わせて攻撃対象領域のマッピングプロセスを自動化できます。
インストール
Goを使用
(Note: I’ve only translated the first text as requested. Would you like me to continue with the remaining texts?)```bash
Install using Go (requires Go 1.20 or later)
go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest
Verify installation
asnmap -version
### Using Docker
```bash
# Pull the latest Docker image
docker pull projectdiscovery/asnmap:latest
# Run ASNmap using Docker
docker run -it projectdiscovery/asnmap:latest -h
Using Homebrew (macOS)
# Install using Homebrew
brew install asnmap
# Verify installation
asnmap -version
Using PDTM (Project Discovery Tools Manager)
# Install PDTM first if not already installed
go install -v github.com/projectdiscovery/pdtm/cmd/pdtm@latest
# Install ASNmap using PDTM
pdtm -i asnmap
# Verify installation
asnmap -version
On Kali Linux
# Install using apt
sudo apt install asnmap
# Verify installation
asnmap -version
Basic Usage
Querying ASN Information
# Query by ASN number
asnmap -asn AS15169
# Query by IP address
asnmap -ip 8.8.8.8
# Query by domain name
asnmap -d google.com
# Query by organization name
asnmap -org "Google LLC"
Multiple Queries
# Query multiple ASNs
asnmap -asn AS15169,AS13414
# Query multiple IPs
asnmap -ip 8.8.8.8,1.1.1.1
# Query multiple domains
asnmap -d google.com,cloudflare.com
# Query multiple organizations
asnmap -org "Google LLC,Cloudflare, Inc."
Input from Files
# Query from a file containing ASNs
asnmap -asn-file asns.txt
# Query from a file containing IPs
asnmap -ip-file ips.txt
# Query from a file containing domains
asnmap -d-file domains.txt
# Query from a file containing organizations
asnmap -org-file orgs.txt
Input from STDIN
# Query from STDIN
echo "AS15169"|asnmap
# Query from STDIN with specific input type
echo "8.8.8.8"|asnmap -i ip
# Query from STDIN with multiple input types
cat input.txt|asnmap -i ip,asn,domain
Output Options
# Save results to a file
asnmap -asn AS15169 -o results.txt
# Output in JSON format
asnmap -asn AS15169 -json -o results.json
# Output in CSV format
asnmap -asn AS15169 -csv -o results.csv
# Silent mode (only results)
asnmap -asn AS15169 -silent
Advanced Usage
Output Filtering
# Output only IP ranges
asnmap -asn AS15169 -r
# Output only ASN information
asnmap -asn AS15169 -a
# Output only organization information
asnmap -asn AS15169 -org-info
CIDR Expansion
# Expand CIDR ranges to individual IPs
asnmap -asn AS15169 -cidr-expand
# Limit CIDR expansion
asnmap -asn AS15169 -cidr-expand -limit 100
Filtering by Country
# Filter results by country
asnmap -asn AS15169 -c US
# Filter results by multiple countries
asnmap -asn AS15169 -c US,CA,UK
Filtering by Registry
# Filter results by registry
asnmap -asn AS15169 -registry ARIN
# Filter results by multiple registries
asnmap -asn AS15169 -registry ARIN,RIPE
Integration with Other Tools
Pipeline with Naabu
# Map ASN to IP ranges and scan for open ports
asnmap -asn AS15169 -silent|naabu -silent
# Map ASN to IP ranges, filter, and scan for open ports
asnmap -asn AS15169 -silent|grep -v ":"|naabu -silent
Pipeline with HTTPX
# Map ASN to IP ranges and probe for HTTP services
asnmap -asn AS15169 -silent|httpx -silent
# Map ASN to IP ranges, expand CIDRs, and probe for HTTP services
asnmap -asn AS15169 -cidr-expand -silent|httpx -silent
Pipeline with Nuclei
# Map ASN to IP ranges, probe for HTTP services, and scan for vulnerabilities
asnmap -asn AS15169 -silent|httpx -silent|nuclei -t cves/
# Map organization to IP ranges and scan for vulnerabilities
asnmap -org "Example Inc" -silent|httpx -silent|nuclei -t exposures/
Pipeline with MapCIDR
# Map ASN to IP ranges and split into smaller subnets
asnmap -asn AS15169 -silent|mapcidr -silent -split 256
# Map ASN to IP ranges, filter, and split into smaller subnets
asnmap -asn AS15169 -silent|grep -v ":"|mapcidr -silent -split 256
Output Customization
Custom Output Format
# Output only IP ranges
asnmap -asn AS15169 -silent -r
# Output ASN and IP ranges
asnmap -asn AS15169 -silent|awk '\\\\{print $1,$2\\\\}'
# Count total IP ranges
asnmap -asn AS15169 -silent|wc -l
# Sort output by IP range
asnmap -asn AS15169 -silent|sort
Filtering Output
# Filter by IP version (IPv4)
asnmap -asn AS15169 -silent|grep -v ":"
# Filter by IP version (IPv6)
asnmap -asn AS15169 -silent|grep ":"
# Filter by CIDR size
asnmap -asn AS15169 -silent|grep "/24"
# Filter by specific pattern
asnmap -asn AS15169 -silent|grep "192.168"
```## 高度なフィルタリング
```bash
# Filter by CIDR prefix length
asnmap -asn AS15169 -silent|grep "/24"
# Filter by CIDR prefix length range
asnmap -asn AS15169 -silent|grep -E "/2[0-4]"
# Count IPs by CIDR prefix length
asnmap -asn AS15169 -silent|grep -E "/[0-9]+"|sort|uniq -c
```### IPバージョンによるフィルタリング
```bash
# Filter IPv4 addresses
asnmap -asn AS15169 -silent|grep -v ":"
# Filter IPv6 addresses
asnmap -asn AS15169 -silent|grep ":"
# Count IPv4 vs IPv6 addresses
asnmap -asn AS15169 -silent|grep -v ":"|wc -l # IPv4 count
asnmap -asn AS15169 -silent|grep ":"|wc -l # IPv6 count
```## トラブルシューティング
```bash
# Check if ASN exists
asnmap -asn AS15169 -v
# Try a different input type
asnmap -ip 8.8.8.8
# Try a different data source
asnmap -asn AS15169 -source cymru
```### 一般的な問題
```bash
# Check internet connection
ping 8.8.8.8
# Increase timeout
asnmap -asn AS15169 -timeout 30
```1. **結果なし**
```bash
# Reduce concurrency
asnmap -asn AS15169 -c 5
# Add delay between requests
asnmap -asn AS15169 -delay 2
```2. **接続の問題**
```bash
# Process ASNs one by one
for asn in $(cat asns.txt); do asnmap -asn $asn -o "$asn-ranges.txt"; done
```3. **レート制限**
```bash
# Enable verbose mode
asnmap -asn AS15169 -v
# Show debug information
asnmap -asn AS15169 -debug
# Check data sources
asnmap -list-sources
```4. **メモリの問題**
`$HOME/.config/asnmap/config.yaml`### デバッグ
```yaml
# Example configuration file
concurrency: 10
timeout: 30
sources:
- asnmap
- cymru
- ripe
```## 設定
```bash
# Set ASNmap configuration via environment variables
export ASNMAP_CONCURRENCY=10
export ASNMAP_TIMEOUT=30
export ASNMAP_SOURCES=asnmap,cymru,ripe
```### 設定ファイル
| フラグ | 説明 |
|------|-------------|
| `-asn` | クエリするASN番号 |
| `-asn-file` | ASN番号を含むファイル |
| `-ip` | クエリを実行するIP アドレス |
| `-ip-file` | IPアドレスを含むファイル |
| `-d, -domain` | クエリを実行するドメイン名 |
| `-d-file` | ドメイン名を含むファイル |
| `-org` | 検索するOrganization名 |
| `-org-file` | 組織名を含むファイル |
| `-i, -input` | STDIN の入力タイプ (asn、ip、domain、org) |
| `-o, -output` | 出力を書き込むファイル |
| `-json` | JSONフォーマットで出力を書き出す |
| `-csv` | CSVフォーマットで出力を書き出す |
| `-silent` | 出力にのみ結果を表示 |
| `-v, -verbose` | 詳細な出力を表示 |
| `-debug` | デバッグ情報を表示 |
| `-r, -range-only` | IPレンジのみを出力 |
| `-a, -asn-only` | ASN 情報のみを出力 |
| `-org-info` | 組織情報のみを出力 |
| `-cidr-expand` | CIDR範囲を個々のIPアドレスに展開する |
| `-limit` | 展開するIPの最大数 |
| `-c, -country` | 国コードで結果をフィルタリング |
| `-registry` | レジストリ(複数可)で結果をフィルタリング |
| `-source` | 使用するデータソース |
| `-list-sources` | 利用可能なデータソースをリスト |
| `-timeout` | リクエストのタイムアウト(秒) |
| `-delay` | リクエスト間の遅延(秒) |
| `-version` | ASNmapのバージョンを表示 |ASNmapは以下の場所に設定ファイルを使用します。このファイルで様々な設定をカスタマイズできます:
| タイプ | 説明 | 例 |
|------|-------------|---------|
| `asn` | 自律システム番号 | AS15169 |
| `ip` | IPアドレス | 8.8.8.8 |
| `domain` | ドメイン名 | google.com |
| `org` | 組織名 | Google LLC |### 環境変数
| ソース | 説明 |
|--------|-------------|
| `asnmap` | ASNmap独自のデータベース |
| `cymru` | Team Cymruの ASNルックアップサービス |
| `ripe` | RIPE NCCのデータベース |## リファレンス
| フィールド | 説明 |
|-------|-------------|
| `asn` | 自律システム番号 |
| `range` | CIDR表記のIPレンジ |
| `org` | 組織名 |
| `country` | 国コード |
| `registry` | 地域インターネットレジストリ (RIR) |
| `description` | ASN説明 |### コマンドラインオプション
https://docs.projectdiscovery.io/tools/asnmap##
# 入力タイプ
https://github.com/projectdiscovery/asnmap##
# データソース
https://discord.gg/projectdiscovery##
# 出力フィールド