ASNmap ASN Mapping Tool Cheat Sheet
Überblick
ASNmap ist ein schnelles und vielseitiges Tool, das von Project Discovery zur Zuordnung von Autonomous System Numbers (ASNs) zu ihren entsprechenden IP-Bereichen und Organisationsinformationen entwickelt wurde. Es bietet eine einfache und effiziente Möglichkeit, ASN-Daten abzurufen, was für die Netzwerkerkennung und Angriffsoberflächenkartierung wesentlich ist.
Was ASNmap von anderen ASN-Lookup-Tools unterscheidet, sind seine Geschwindigkeit, Einfachheit und Vielseitigkeit. Es unterstützt mehrere Eingabeformate, einschließlich ASN-Nummern, IP-Adressen, Domainnamen und Organisationsnamen, was es zu einem flexiblen Tool für verschiedene Erkennungsszenarien macht. ASNmap kann schnell IP-Bereiche abrufen, die bestimmten Organisationen oder ASNs zugeordnet sind, und hilft Sicherheitsprofis, den Netzwerk-Fußabdruck ihrer Ziele zu verstehen.
ASNmap wird häufig in den frühen Phasen von Sicherheitsbewertungen und Bug-Bounty-Jagden verwendet, um den IP-Raum von Zielorganisationen zu identifizieren. Diese Informationen sind entscheidend für nachfolgende Scan- und Enumerationsaktivitäten. Das Tool kann leicht in Sicherheits-Workflows integriert und mit anderen Erkennungstools kombiniert werden, um den Prozess der Angriffsoberflächenkartierung zu automatisieren.
Would you like me to continue with the remaining sections?```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"
```## Erweiterte Filterung
```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
```### Filterung nach IP-Versionstyp
```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
```## Fehlerbehebung
```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. **Keine Ergebnisse**
```bash
# Check internet connection
ping 8.8.8.8
# Increase timeout
asnmap -asn AS15169 -timeout 30
```2. **Verbindungsprobleme**
```bash
# Reduce concurrency
asnmap -asn AS15169 -c 5
# Add delay between requests
asnmap -asn AS15169 -delay 2
```3. **Ratenlimitierung**
```bash
# Process ASNs one by one
for asn in $(cat asns.txt); do asnmap -asn $asn -o "$asn-ranges.txt"; done
```4. **Speicherprobleme**
```bash
# Enable verbose mode
asnmap -asn AS15169 -v
# Show debug information
asnmap -asn AS15169 -debug
# Check data sources
asnmap -list-sources
```### Debugging
`$HOME/.config/asnmap/config.yaml`ASNmap verwendet eine Konfigurationsdatei, die sich an folgendem Speicherort befindet:
```yaml
# Example configuration file
concurrency: 10
timeout: 30
sources:
- asnmap
- cymru
- ripe
```Sie können verschiedene Einstellungen in dieser Datei anpassen:
```bash
# Set ASNmap configuration via environment variables
export ASNMAP_CONCURRENCY=10
export ASNMAP_TIMEOUT=30
export ASNMAP_SOURCES=asnmap,cymru,ripe
```### Umgebungsvariablen
| Flagge | Beschreibung |
|------|-------------|
| `-asn` | ASN-Nummer(n) zur Abfrage |
| `-asn-file` | Datei mit ASN-Nummern |
| `-ip` | IP-Adresse(n) abfragen |
| `-ip-file` | Datei mit IP-Adressen |
| `-d, -domain` | Domain-Name(s), die abgefragt werden sollen |
| `-d-file` | Datei mit Domainnamen |
| `-org` | Zu abfragende Organisationsname(n) |
| `-org-file` | Datei mit Organisationsnamen |
| `-i, -input` | Eingabetyp(en) für STDIN (asn, ip, domain, org) |
| `-o, -output` | Datei zum Schreiben der Ausgabe |
| `-json` | Ausgabe im JSON-Format schreiben |
| `-csv` | Ausgabe im CSV-Format schreiben |
| `-silent` | Zeige nur Ergebnisse in der Ausgabe |
| `-v, -verbose` | Ausführliche Ausgabe anzeigen |
| `-debug` | Debug-Informationen anzeigen |
| `-r, -range-only` | Nur IP-Bereiche ausgeben |
| `-a, -asn-only` | Nur ASN-Informationen ausgeben |
| `-org-info` | Nur Organisationsinformationen ausgeben |
| `-cidr-expand` | CIDR-Bereiche in einzelne IPs erweitern |
| `-limit` | Maximale Anzahl der zu erweiternden IPs |
| `-c, -country` | Ergebnisse nach Ländercode(s) filtern |
| `-registry` | Ergebnisse nach Registry(ies) filtern |
| `-source` | Zu verwendende Datenquelle(n) |
| `-list-sources` | Verfügbare Datenquellen auflisten |
| `-timeout` | Timeout für Anfragen in Sekunden |
| `-delay` | Verzögerung zwischen Anfragen in Sekunden |
| `-version` | ASNmap-Version anzeigen |### Befehlszeilenoptionen
| Typ | Beschreibung | Beispiel |
|------|-------------|---------|
| `asn` | Autonomous System Number | AS15169 |
| `ip` | IP-Adresse | 8.8.8.8 |
| `domain` | Domain-Name | google.com |
| `org` | Organisationsname | Google LLC |### Eingabetypen
| Quelle | Beschreibung |
|--------|-------------|
| `asnmap` | ASNmap's eigene Datenbank |
| `cymru` | Team Cymru's ASN-Lookup-Dienst |
| `ripe` | RIPE NCC's Datenbank |### Datenquellen
| Feld | Beschreibung |
|-------|-------------|
| `asn` | Autonomous System Number |
| `range` | IP-Bereich in CIDR-Notation |
| `org` | Organisationsname |
| `country` | Ländercode |
| `registry` | Regionale Internetregistrierungsstelle |
| `description` | ASN-Beschreibung |### Ausgabefelder
https://docs.projectdiscovery.io/tools/asnmap#
# Ressourcen
https://github.com/projectdiscovery/asnmap- [Offizielle Dokumentation](https://discord.gg/projectdiscovery)