ASN(1)

πŸ“¦
version 0.78.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… ASN(1) β€” User Commands, bestie edition

okay so first of all, this is a User Commands manual page, and it's page 1 of the manual, which is the section for user commands. iykyk. it's called asn and it's literally the moment. πŸ¦‹


✨ NAME ✨

asn β€” ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / ASPath / Organization / IP reputation lookup tool

no cap, that's a whole lot of jobs for one little command and she ate every single one. πŸ‘‘


🌸 SYNOPSIS 🌸

asn [OPTIONS] [TARGET]
asn [-v] -l [SERVER OPTIONS]

πŸ’– DESCRIPTION πŸ’–

ASN is a tool for performing various lookup operations related to ASN (Autonomous System Number), RPKI validity, BGP statistics, IPv4/v6 addresses, prefixes, ASPaths, organizations, and IP reputations.

that's the whole vibe: you give it a thing, it tells you everything about the thing. main character energy fr fr. ✨


πŸŽ€ OPTIONS πŸŽ€

  • -t β€” (enable trace) β€” Turn on AS path trace to the TARGET. this is literally the default behavior, so it's giving "just confirming the vibe" πŸ’…
  • -n β€” (no trace | no additional INETNUM lookups) β€” Disable tracing the AS path to the TARGET (for IP targets), or Disable additional (unannounced / announced by other AS) INETNUM lookups for the TARGET (for AS targets). it's the off-switch for the tracing, depending on what kind of target you handed her.
  • -d β€” (detailed) β€” Output detailed hop info during the AS path trace to the TARGET. This option also enables RPKI validation/BGP hijacking detection for every hop. every hop gets the full report card bestie 🫢
  • -a β€” (ASN Suggest) β€” Lookup AS names and numbers matching TARGET. it's giving autocomplete but for autonomous systems.
  • -u β€” (Transit/Upstream lookup) β€” Inspect BGP updates and ASPATHs for the TARGET address/prefix and identify possible transit/upstream autonomous systems. who's upstream? we're finding out. πŸ”₯
  • -c β€” (Country CIDR) β€” Lookup all IPv4/v6 CIDR blocks allocated to the TARGET country.
  • -g β€” (Bulk Geolocate) β€” Geolocate all IPv4/v6 addresses passed as TARGET. This mode supports multiple targets, stdin input and IP extraction from input, e.g.
asn -g < /var/log/apache2/error.log or echo 1.1.1.1 2.2.2.2 | asn -g
  • -s β€” (Shodan scan) β€” Query Shodan's InternetDB for CVE/CPE/Tags/Ports/Hostnames data about TARGET. This mode supports multiple targets and stdin input, e.g.
asn -s < iplist or echo 1.1.1.0/24 google.com | asn -s
  • -o β€” (organization search) β€” Force TARGET to be treated as an Organization Name.
  • -m β€” (monochrome output) β€” Disable colored output. no rainbow bestie, we're going plain 😭
  • -v β€” (verbose) β€” Enable (and log to $HOME/asndebug.log) debug messages (URLs being queried and variable names being assigned). API call response data (i.e. the JSON output) is logged to the logfile. she's telling you EVERYTHING. the whole tea. πŸ“
  • -j β€” (compact JSON output) β€” Set output to compact JSON mode (ideal for machine parsing).
  • -J β€” (pretty-printed JSON output) β€” Set output to pretty-printed JSON mode. same data, better outfit πŸ’…
  • -h β€” (help) β€” Show this help screen.
  • -l β€” (lookup server) β€” Launch the script in server mode. See SERVER OPTIONS below.

πŸ¦‹ TARGET πŸ¦‹

  • <AS Number> β€” Lookup matching ASN and BGP announcements/neighbours data.
  • <IPv4/IPv6> β€” Lookup matching route(4/6), IP reputation, and ASN data.
  • <Prefix> β€” Lookup matching ASN data.
  • <host.name.tld> β€” Lookup matching IP, route, and ASN data. Supports multiple IPs β€” e.g. DNS RR.
  • <URL> β€” Extract hostname/IP from the URL and lookup relative data. Supports any protocol prefix, non-standard ports, and prepended credentials.
  • <Organization Name> β€” Search by company name and lookup network ranges exported by (or related to) the company.

🌈 SERVER OPTIONS 🌈

  • BIND_ADDRESS β€” IP address (v4/v6) to bind the listening server to (e.g., asn -l 0.0.0.0). Default value: 127.0.0.1 (IPv4) or ::1 (IPv6).
  • BIND_PORT β€” TCP Port to bind the listening server to (e.g., asn -l 12345). Default value: 49200.
  • BIND_ADDRESS BIND_PORT β€” IP address and port to bind the listening server to (e.g., asn -l ::1 12345).
  • -v β€” (verbose) β€” Enable verbose output and debug messages in server mode.
  • --allow host[,host,...] β€” Allow only given hosts to connect to the server.
  • --allowfile file β€” A file of hosts allowed to connect to the server.
  • --deny host[,host,...] β€” Deny given hosts from connecting to the server.
  • --denyfile file β€” A file of hosts denied from connecting to the server.
  • -m, --max-conns <n> β€” The maximum number of simultaneous connections accepted by the server. 100 is the default.

πŸ’œ NOTES πŸ’œ

Every option in server mode (after -l) is passed directly to the ncat listener. Refer to man ncat for more details on the available commands.

Unless specified, the default IP:PORT values of 127.0.0.1:49200 (for IPv4) or [::1]:49200 (for IPv6) will be used (e.g., asn -l).

fr fr, she's just handing your flags straight to ncat. know what you're passing down the line bestie. 🧚

⭐ EXAMPLES ⭐

Example server usage:

asn -l (starts server on default IP(v4/v6):PORT)
asn -l 0.0.0.0 --allow 192.168.0.0/24,192.168.1.0/24,192.168.2.245
(binds to all available IPv4 interfaces on the default port, allowing
only connections from the three specified subnets)
asn -l :: 2222 --allow 2001:DB8::/32 (binds to all available IPv6
interfaces on port 2222, allowing only connections from the specified
prefix)
asn -v -l 0.0.0.0 --allowfile ~/goodips.txt -m 5 (verbose mode, bind to
all IPv4 interfaces, use an allowfile with allowed addresses, accept a
maximum of 5 concurrent connections)

πŸ’€ SEE ALSO πŸ’€

To file a bug report or feature request, please open an issue on the project homepage: https://github.com/nitefood/asn


πŸ‘‘ AUTHOR πŸ‘‘

Project author: nitefood <nitefood0@gmail.com>

This manpage was created by Marcos Rodrigues de Carvalho (aka oday) <marcosrcarvalho42@gmail.com>


and that's the whole page bestie πŸ’– this is version 0.77.0, dated July 2024, straight from the User Commands section of the manual β€” go forth and look up every ASN you can find, periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from