Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

ASN Lookup Tool (Bash)

Description

ASN/IPv4/IPv6/Prefix/ASPath lookup tool.

The script will perform an AS path trace (using mtr in raw mode and retrieving AS data from the results) for single IPs or DNS results (screenshots below).

The script uses Team Cymru's whois service for data.

Screenshots


Generic usage

asn


Example ASPath trace to www.github.com

asn-tracepath

Installation

To download the asn script from your shell:

curl https://raw.githubusercontent.com/nitefood/asn/master/asn > asn && chmod +x asn

After that, you can use the script by running ./asn.

Usage

  • asn <ASnumber> -- to lookup matching ASN data. Supports "as123" and "123" formats (case insensitive)
  • asn <IPv4/IPv6> -- to lookup matching route(4/6) and ASN data
  • asn <ROUTE> -- to lookup matching ASN data
  • asn <host.name.tld> -- to lookup matching IP(v4/v6), route and ASN data (supports multiple IPs - e.g. DNS RR)

AS path tracing is enabled by default for lookup results involving a single IP address. This can be disabled by passing the [n|--notrace] command line switch.

Thanks

This script was featured in the Security Trails blog post "ASN Lookup Tools, Strategies and Techniques". Thank you Esteban!

Feedback and contributing

Any feedback or pull request to improve the code is welcome. Feel free to contribute!

About

ASN/IPv4/IPv6/Prefix/AS Path lookup tool

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages