Zum Inhalt

ASNmap ASN Mapping Tool Cheat Sheet

Überblick

ASNmap ist ein schnelles und vielseitiges Tool, das von Project Discovery entwickelt wurde, um Autonome Systemnummern (ASNs) zu ihren entsprechenden IP-Bereichen und Organisationsinformationen zu kartieren. Es bietet eine einfache und effiziente Möglichkeit, ASN-Daten abzurufen, die für die Netzwerk-Rekonnaissance und Angriffs-Oberflächen-Mapping unerlässlich ist.

Was ASNmap von anderen ASN Lookup-Tools unterscheidet, ist seine Geschwindigkeit, Einfachheit und Vielseitigkeit. Es unterstützt mehrere Eingabeformate, einschließlich ASN-Nummern, IP-Adressen, Domainnamen und Organisationsnamen, so dass es ein flexibles Werkzeug für verschiedene Aufklärungssszenarien. ASNmap kann schnell IP-Bereiche, die mit bestimmten Organisationen oder ASNs verbunden sind, abrufen und Sicherheitsexperten dabei unterstützen, den Netzwerk-Fußabdruck ihrer Ziele zu verstehen.

ASNmap wird häufig in den frühen Stadien von Sicherheitsbewertungen und Bug-Bounty-Jagd verwendet, um den IP-Raum zu Zielorganisationen gehören zu identifizieren. Diese Informationen sind für nachfolgende Scan- und Aufzählungsaktivitäten entscheidend. Das Werkzeug lässt sich leicht in Sicherheits-Workflows integrieren und mit anderen Aufklärungswerkzeugen kombinieren, um den Prozess der Kartierung von Angriffsflächen zu automatisieren.

Installation

Verwenden Sie Go

```bash

Install using Go (requires Go 1.20 or later)

go install -v github.com/projectdiscovery/asnmap/cmd/asnmap@latest

Verify installation

asnmap -version ```_

Verwendung von Docker

```bash

Pull the latest Docker image

docker pull projectdiscovery/asnmap:latest

Run ASNmap using Docker

docker run -it projectdiscovery/asnmap:latest -h ```_

Verwendung von Homebrew (macOS)

```bash

Install using Homebrew

brew install asnmap

Verify installation

asnmap -version ```_

Verwendung von PDTM (Projekt Discovery Tools Manager)

```bash

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 ```_

Auf Kali Linux

```bash

Install using apt

sudo apt install asnmap

Verify installation

asnmap -version ```_

Basisnutzung

Abfragen von ASN Informationen

```bash

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" ```_

Mehrere Abfragen

```bash

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." ```_

Eingabe von Dateien

```bash

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 ```_

Eingang von STDIN

```bash

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 ```_

Ausgabeoptionen

```bash

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 ```_

Erweiterte Nutzung

Ausgangsfilterung

```bash

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 Erweiterung

```bash

Expand CIDR ranges to individual IPs

asnmap -asn AS15169 -cidr-expand

Limit CIDR expansion

asnmap -asn AS15169 -cidr-expand -limit 100 ```_

Filtern nach Land

```bash

Filter results by country

asnmap -asn AS15169 -c US

Filter results by multiple countries

asnmap -asn AS15169 -c US,CA,UK ```_

Filtern nach Registry

```bash

Filter results by registry

asnmap -asn AS15169 -registry ARIN

Filter results by multiple registries

asnmap -asn AS15169 -registry ARIN,RIPE ```_

Integration mit anderen Tools

Pipeline mit Naabu

```bash

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 mit HTTPX

```bash

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 mit Nuclei

```bash

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 mit MapCIDR

```bash

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 | ```_

Produktionsanpassung

Zollausgabe Format

```bash

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 ```_

Filterausgang

```bash

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

Filtern nach IP-Bereichsgröße

```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 | ```_

Filtern nach IP Version

```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

Gemeinsame Themen

  1. ** Keine Ergebnisse* * ```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. ** Anfragen* ```bash # Check internet connection ping 8.8.8.8

# Increase timeout asnmap -asn AS15169 -timeout 30

```_

  1. Beschränkung ```bash # Reduce concurrency asnmap -asn AS15169 -c 5

# Add delay between requests asnmap -asn AS15169 -delay 2

```_

  1. *Memory Issues ```bash # Process ASNs one by one for asn in $(cat asns.txt); do asnmap -asn $asn -o "$asn-ranges.txt"; done

```_

Debugging

```bash

Enable verbose mode

asnmap -asn AS15169 -v

Show debug information

asnmap -asn AS15169 -debug

Check data sources

asnmap -list-sources ```_

Konfiguration

Datei konfigurieren

ASNmap verwendet eine Konfigurationsdatei unter $HOME/.config/asnmap/config.yaml_. Sie können verschiedene Einstellungen in dieser Datei anpassen:

```yaml

Example configuration file

concurrency: 10 timeout: 30 sources: - asnmap - cymru - ripe ```_

Umweltvariablen

```bash

Set ASNmap configuration via environment variables

export ASNMAP_CONCURRENCY=10 export ASNMAP_TIMEOUT=30 export ASNMAP_SOURCES=asnmap,cymru,ripe ```_

Sachgebiet

Kommandozeilenoptionen

| | Flag | Description | | | --- | --- | | | -asn | ASN number(s) to query | | | | -asn-file | File containing ASN numbers | | | | -ip | IP address(es) to query | | | | -ip-file | File containing IP addresses | | | | -d, -domain | Domain name(s) to query | | | | -d-file | File containing domain names | | | | -org | Organization name(s) to query | | | | -org-file | File containing organization names | | | | -i, -input | Input type(s) for STDIN (asn, ip, domain, org) | | | | -o, -output | File to write output to | | | | -json | Write output in JSON format | | | | -csv | Write output in CSV format | | | | -silent | Show only results in output | | | | -v, -verbose | Show verbose output | | | | -debug | Show debug information | | | | -r, -range-only | Output only IP ranges | | | | -a, -asn-only | Output only ASN information | | | | -org-info | Output only organization information | | | | -cidr-expand | Expand CIDR ranges to individual IPs | | | | -limit | Maximum number of IPs to expand | | | | -c, -country | Filter results by country code(s) | | | | -registry | Filter results by registry(ies) | | | | -source | Data source(s) to use | | | | -list-sources | List available data sources | | | | -timeout | Timeout for requests in seconds | | | | -delay | Delay between requests in seconds | | | | -version | Show ASNmap version | |

Eingangstypen

| | Type | Description | Example | | | --- | --- | --- | | | asn | Autonomous System Number | AS15169 | | | | ip | IP address | 8.8.8.8 | | | | domain | Domain name | google.com | | | | org | Organization name | Google LLC | |

Datenquellen

| | Source | Description | | | --- | --- | | | asnmap | ASNmap's own database | | | | cymru | Team Cymru's ASN lookup service | | | | ripe | RIPE NCC's database | |

Ausgangsfelder

| | Field | Description | | | --- | --- | | | asn | Autonomous System Number | | | | range | IP range in CIDR notation | | | | org | Organization name | | | | country | Country code | | | | registry | Regional Internet Registry | | | | description | ASN description | |

Ressourcen

  • [offizielle Dokumentation](__LINK_3___
  • [GitHub Repository](_LINK_3__
  • [Project Discovery Discord](__LINK_3___

--

*Dieses Betrügereiblatt bietet eine umfassende Referenz für die Verwendung von ASNmap, von grundlegenden Abfragen bis hin zur erweiterten Filterung und Integration mit anderen Tools. Für die aktuellsten Informationen finden Sie immer die offizielle Dokumentation. *