• Stars
    star
    516
  • Rank 85,726 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created about 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go CLI and Library for quickly mapping organization network ranges using ASN information.

asnmap

Go CLI and Library for quickly mapping organization network ranges using ASN information.

FeaturesInstallationUsageRunning asnmapJoin Discord


Features

image

  • ASN to CIDR Lookup
  • ORG to CIDR Lookup
  • DNS to CIDR Lookup
  • IP to CIDR Lookup
  • ASN/DNS/IP/ORG input
  • JSON/CSV/TEXT output
  • STD IN/OUT support

Installation

asnmap requires Go 1.18 to install successfully. To install, just run the below command or download pre-compiled binary from release page.

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

Usage

asnmap -h

This will display help for the tool. Here are all the flag it supports.

Usage:
  ./asnmap [flags]

Flags:
INPUT:
   -a, -asn string[]     target asn to lookup, example: -a AS5650
   -i, -ip string[]      target ip to lookup, example: -i 100.19.12.21, -i 2a10:ad40::
   -d, -domain string[]  target domain to lookup, example: -d google.com, -d facebook.com
   -org string[]         target organization to lookup, example: -org GOOGLE
   -f, -file string[]    targets to lookup from file

CONFIGURATIONS:
   -config string           path to the asnmap configuration file
   -r, -resolvers string[]  list of resolvers to use

UPDATE:
   -up, -update                 update asnmap to latest version
   -duc, -disable-update-check  disable automatic asnmap update check

OUTPUT:
   -o, -output string  file to write output to
   -j, -json           display json format output
   -c, -csv            display csv format output
   -v6                 display ipv6 cidr ranges in cli output
   -v, -verbose        display verbose output
   -silent             display silent output
   -version            show version of the project

Running asnmap

Input for asnmap

asnmap support multiple inputs including ASN, IP, DNS and ORG name to query ASN/CIDR information.

Input ASN DNS IP ORG
Example AS14421 example.com 93.184.216.34 GOOGLE

Input can be provided either using specific options or STDIN which accepts all the supported formats. Single, multiple (comma-separated) and file input is supported for all the options.

echo GOOGLE | ./asnmap -silent

Example input for asnmap:

asnmap -a AS45596 -silent
asnmap -i 100.19.12.21 -silent
asnmap -d hackerone.com -silent
asnmap -org GOOGLE -silent

Default Run

asnmap by default returns the CIDR range for given input.

echo GOOGLE | ./asnmap

   ___   _____  __              
  / _ | / __/ |/ /_ _  ___ ____ 
 / __ |_\ \/    /  ' \/ _  / _ \
/_/ |_/___/_/|_/_/_/_/\_,_/ .__/
                         /_/    v0.0.1
		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.

8.8.4.0/24
8.8.8.0/24
8.35.200.0/21
34.3.3.0/24
34.4.4.0/24
34.96.0.0/20
34.96.32.0/19
34.96.64.0/18
34.98.64.0/18
34.98.136.0/21
34.98.144.0/21

JSON Output

asnmap by default displays CIDR range, and all the information is always available in JSON format, for automation and post processing using -json output is most convenient option to use.

echo hackerone.com | ./asnmap -json -silent | jq
{
  "timestamp": "2022-09-19 12:14:33.267339314 +0530 IST",
  "input": "hackerone.com",
  "as_number": "AS13335",
  "as_name": "CLOUDFLARENET",
  "as_country": "US",
  "as_range": [
    "104.16.0.0/14",
    "104.20.0.0/16",
    "104.21.0.0/17"
  ]
}
{
  "timestamp": "2022-09-19 12:14:33.457401266 +0530 IST",
  "input": "hackerone.com",
  "as_number": "AS13335",
  "as_name": "CLOUDFLARENET",
  "as_country": "US",
  "as_range": [
    "2606:4700:8390::/44"
  ]
}

CSV Output

asnmap also support csv format output which has all the information just like JSON output

echo hackerone.com | ./asnmap -csv -silent
timestamp|input|as_number|as_name|as_country|as_range
2022-09-19 12:15:04.906664007 +0530 IST|hackerone.com|AS13335|CLOUDFLARENET|US|104.16.0.0/14,104.20.0.0/16,104.21.0.0/17
2022-09-19 12:15:05.201328136 +0530 IST|hackerone.com|AS13335|CLOUDFLARENET|US|2606:4700:9760::/44

Using with other PD projects

Output of asnmap can be directly piped into other projects in workflow accepting stdin as input, for example:

  • echo AS54115 | asnmap | tlsx
  • echo AS54115 | asnmap | dnsx -ptr
  • echo AS54115 | asnmap | naabu -p 443
  • echo AS54115 | asnmap | naabu -p 443 | httpx
  • echo AS54115 | asnmap | naabu -p 443 | httpx | nuclei -id tech-detect

Use asnmap as a library

Examples of using asnmap from Go code are provided in the examples folder.

Acknowledgements


asnmap is made with ❤️ by the projectdiscovery team and distributed under MIT License.

Join Discord

More Repositories

1

nuclei

Fast and customizable vulnerability scanner based on simple YAML based DSL.
Go
14,482
star
2

katana

A next-generation crawling and spidering framework.
Go
10,861
star
3

subfinder

Fast passive subdomain enumeration tool.
Go
9,888
star
4

nuclei-templates

Community curated list of templates for the nuclei engine to find security vulnerabilities.
6,913
star
5

httpx

httpx is a fast and multi-purpose HTTP toolkit that allows running multiple probes using the retryablehttp library.
Go
5,706
star
6

naabu

A fast port scanner written in go with a focus on reliability and simplicity. Designed to be used in combination with other tools for attack surface discovery in bug bounties and pentests
Go
3,657
star
7

interactsh

An OOB interaction gathering server and client library
Go
2,818
star
8

proxify

A versatile and portable proxy for capturing, manipulating, and replaying HTTP/HTTPS traffic on the go.
Go
2,362
star
9

uncover

Quickly discover exposed hosts on the internet using multiple search engines.
Go
2,026
star
10

dnsx

dnsx is a fast and multi-purpose DNS toolkit allow to run multiple DNS queries of your choice with a list of user-supplied resolvers.
Go
1,708
star
11

nuclei-burp-plugin

Nuclei plugin for BurpSuite
Java
1,133
star
12

shuffledns

MassDNS wrapper written in go that allows you to enumerate valid subdomains using active bruteforce as well as resolve subdomains with wildcard handling and easy input-output support.
Go
1,119
star
13

notify

Notify is a Go-based assistance package that enables you to stream the output of several tools (or read from a file) and publish it to a variety of supported platforms.
Go
951
star
14

public-bugbounty-programs

Community curated list of public bug bounty and responsible disclosure programs.
Go
876
star
15

mapcidr

Small utility program to perform multiple operations for a given subnet/CIDR ranges.
Go
811
star
16

cloudlist

Cloudlist is a tool for listing Assets from multiple Cloud Providers.
Go
691
star
17

tlsx

Fast and configurable TLS grabber focused on TLS based data collection.
Go
654
star
18

pdtm

ProjectDiscovery's Open Source Tool Manager
Go
521
star
19

wappalyzergo

A high performance go implementation of Wappalyzer Technology Detection Library
Go
498
star
20

chaos-client

Go client to communicate with Chaos DB API.
Go
498
star
21

alterx

Fast and customizable subdomain wordlist generator using DSL
Go
480
star
22

cdncheck

A utility to detect various technology for a given IP address.
Go
463
star
23

nuclei-ai-extension

Nuclei AI - Browser Extension for Rapid Nuclei Template Generation
JavaScript
422
star
24

simplehttpserver

Go alternative of python SimpleHTTPServer
Go
418
star
25

dnsprobe

DNSProb is a tool built on top of retryabledns that allows you to perform multiple dns queries of your choice with a list of user supplied resolvers.
Go
269
star
26

aix

AIx is a cli tool to interact with Large Language Models (LLM) APIs.
Go
200
star
27

nuclei-action

Vulnerability Scan with Nuclei
JavaScript
199
star
28

interactsh-web

Web dashboard for Interactsh client
TypeScript
162
star
29

openrisk

openrisk is a tool that generates a risk score based on the results of a Nuclei scan.
Go
160
star
30

rawhttp

Raw HTTP client in Go for complete request control and customization.
Go
120
star
31

retryabledns

Retryable DNS client in Go
Go
103
star
32

retryablehttp-go

Package retryablehttp provides a familiar HTTP client interface with automatic retries and exponential backoff
Go
92
star
33

nuclei-docs

Nuclei documentation
HTML
84
star
34

gologger

A simple layer for leveled logging in go
Go
66
star
35

utils

Helper Libraries
Go
65
star
36

network-fingerprint

A fingerprint generation helper for nuclei network templates
Go
61
star
37

goflags

A go flag wrapper with convenience helpers
Go
59
star
38

awesome-search-queries

Community curated list of search queries for various products across multiple search engines.
46
star
39

fastdialer

Dialer with DNS Cache + Dial History
Go
45
star
40

ipranger

IP/FQDN data structure helper with randomization of hosts and ports based on masscan internal logic
Go
43
star
41

dsl

DSL engine
Go
38
star
42

fuzzing-templates

Community curated list of nuclei templates for finding "unknown" security vulnerabilities.
36
star
43

hmap

Hybrid memory/disk map
Go
35
star
44

useragent

Curated list of categorized User Agents
Go
30
star
45

wallpapers

Collection of ProjectDiscovery wallpapers
26
star
46

collaborator

BurpSuite Standard/Private Collaborator Library
Go
22
star
47

tinydns

Tiny embeddable dns server
Go
22
star
48

blackrock

blackrock cipher based on masscan
Go
21
star
49

fdmax

Small Helper Library to increase automatically the file descriptors limits for the current process
Go
21
star
50

ratelimit

A Golang blocking rate limit implementation
Go
20
star
51

php-app-race-condition

Vulnerable demo application for the race condition
PHP
17
star
52

yamldoc-go

A documentation generator for YAML as code
Go
16
star
53

freeport

Free listening port from the OS
Go
16
star
54

clistats

A command based package for simple display of statistics
Go
15
star
55

fileutil

File helpers - Moved at https://github.com/projectdiscovery/utils
Go
12
star
56

notify-action

Notify is a helper utility written in Go that allows you to post output to multiple platforms.
12
star
57

naabu-action

A fast port scanner written in go with a focus on reliability and simplicity.
12
star
58

sqlc-go-builder

sqlc-go-builder
Go
12
star
59

subfinder-action

Fast and passive subdomain enumeration.
12
star
60

roundrobin

roundrobin with configurable rotating strategies
Go
11
star
61

executil

Exec helpers - Moved at https://github.com/projectdiscovery/utils
Go
11
star
62

networkpolicy

Network Policy Helper
Go
10
star
63

resolvercache-go

A DNS response caching library in go
Go
10
star
64

gozero

gozero: the wannabe zero dependency [language-here] runtime for Go developers - Experimental
Go
9
star
65

iputil

ip helpers - Moved at https://github.com/projectdiscovery/utils
Go
8
star
66

dnsx-action

Fast and multi-purpose DNS toolkit allow to run multiple DNS queries.
8
star
67

expirablelru

A TTL expiring LRU cache in go
Go
7
star
68

sslcert

Reworked version of https://golang.org/src/crypto/tls/generate_cert.go
Go
7
star
69

tailwindcss

Design system config file
JavaScript
7
star
70

goconfig

Helper library to save/restore internal values across multiple runs
Go
7
star
71

httpx-action

HTTP Web Server probing
7
star
72

cryptoutil

Library containing various crypto helpers
Go
7
star
73

stringsutil

Strings helper - Moved at https://github.com/projectdiscovery/utils
Go
6
star
74

nuclei-updatecheck-api

Nuclei UpdateChecking API caching github releases for update check
Go
5
star
75

filekv

File based kv store
Go
5
star
76

sarif

Sarif exporter
Go
5
star
77

sliceutil

sliceutils helpers - Moved at https://github.com/projectdiscovery/utils
Go
5
star
78

cloudlist-action

Cloudlist is a tool for listing Assets from multiple Cloud Providers.
5
star
79

mapsutil

Go maps helper functions - Moved at https://github.com/projectdiscovery/utils
Go
4
star
80

gostruct

Python like library to Interpret bytes as packed binary data
Go
4
star
81

folderutil

Package containing various folder helpers
Go
3
star
82

httputil

Http helper library
Go
3
star
83

templates-stats

A utility for extracting various meta data from nuclei-templates.
Go
3
star
84

docs

Centralized docs of ProjectDiscovery
MDX
3
star
85

reflectutil

Library containing reflection helpers
Go
2
star
86

urlutil

Helper library handling edge cases URLs - Moved at https://github.com/projectdiscovery/utils
Go
2
star
87

.github

Community health files for the @projectdiscovery organization
2
star
88

eslint-config

ESLint Configurations
JavaScript
1
star