ASNmap ASN 매핑 도구 치트 시트
개요
ASNmap은 Project Discovery에서 개발한 자율 시스템 번호(ASN)를 해당 IP 범위 및 조직 정보에 매핑하는 빠르고 다재다능한 도구입니다. 이는 ASN 데이터를 검색하는 간단하고 효율적인 방법을 제공하며, 네트워크 정찰 및 공격 표면 매핑에 필수적입니다.
다른 ASN 조회 도구와 차별화되는 점은 ASNmap의 속도, 단순성 및 다재다능함입니다. ASN 번호, IP 주소, 도메인 이름, 조직 이름을 포함한 여러 입력 형식을 지원하여 다양한 정찰 시나리오에 유연한 도구입니다. ASNmap은 특정 조직 또는 ASN과 연관된 IP 범위를 빠르게 검색할 수 있어 보안 전문가가 대상의 네트워크 범위를 이해하는 데 도움을 줍니다.
ASNmap은 일반적으로 보안 평가 및 버그 바운티 헌팅의 초기 단계에서 대상 조직에 속한 IP 공간을 식별하는 데 사용됩니다. 이 정보는 후속 스캔 및 열거 활동에 중요합니다. 이 도구는 보안 워크플로우에 쉽게 통합될 수 있으며 다른 정찰 도구와 결합하여 공격 표면 매핑 프로세스를 자동화할 수 있습니다.
Would you like me to continue with the remaining translations?```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
```1. **결과 없음**
```bash
# Check internet connection
ping 8.8.8.8
# Increase timeout
asnmap -asn AS15169 -timeout 30
```2. **연결 문제**
```bash
# Reduce concurrency
asnmap -asn AS15169 -c 5
# Add delay between requests
asnmap -asn AS15169 -delay 2
```3. **요율 제한**
```bash
# Process ASNs one by one
for asn in $(cat asns.txt); do asnmap -asn $asn -o "$asn-ranges.txt"; done
```4. **메모리 문제**
```bash
# Enable verbose mode
asnmap -asn AS15169 -v
# Show debug information
asnmap -asn AS15169 -debug
# Check data sources
asnmap -list-sources
```### 디버깅
`$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
```ASNmap은 다음 위치에 구성 파일을 사용합니다. 이 파일에서 다양한 설정을 사용자 지정할 수 있습니다:
| 깃발 | 설명 |
|------|-------------|
| `-asn` | 조회할 ASN 번호(들) |
| `-asn-file` | ASN 번호가 포함된 파일 |
| `-ip` | 쿼리할 IP 주소(들) |
| `-ip-file` | IP 주소를 포함하는 파일 |
| `-d, -domain` | 쿼리할 도메인 이름(들) |
| `-d-file` | 도메인 이름을 포함하는 파일 |
| `-org` | 쿼리할 조직 이름(들) |
| `-org-file` | 조직 이름이 포함된 파일 |
| `-i, -input` | STDIN에 대한 입력 유형(asn, ip, 도메인, 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 버전 표시 |### 환경 변수
| 유형 | 설명 | 예시 |
|------|-------------|---------|
| `asn` | 자율 시스템 번호 | AS15169 |
| `ip` | IP 주소 | 8.8.8.8 |
| `domain` | 도메인 이름 | google.com |
| `org` | 조직 이름 | 구글 LLC |## 참조
| 소스 | 설명 |
|--------|-------------|
| `asnmap` | ASNmap의 자체 데이터베이스 |
| `cymru` | Team Cymru의 ASN 조회 서비스 |
| `ripe` | RIPE NCC의 데이터베이스 |### 명령줄 옵션
| 필드 | 설명 |
|-------|-------------|
| `asn` | 자율 시스템 번호 |
| `range` | CIDR 표기법의 IP 범위 |
| `org` | 조직 이름 |
| `country` | 국가 코드 |
| `registry` | 지역 인터넷 레지스트리 |
| `description` | ASN 설명 |### 입력 유형
https://docs.projectdiscovery.io/tools/asnmap##
# 데이터 소스
https://github.com/projectdiscovery/asnmap##
# 출력 필드
https://discord.gg/projectdiscovery#
# 리소스