Giter Site home page Giter Site logo

nitefood / asn Goto Github PK

View Code? Open in Web Editor NEW
1.2K 33.0 147.0 512 KB

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / URL / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup API server / Web traceroute server

License: MIT License

Shell 99.58% Dockerfile 0.42%
asn asn-lookup autonomous-systems ip-lookup team-cymru as-path mtr traceroute osint incident-response

asn's Introduction

ASN Lookup Tool and Traceroute Server

Packaging status

Container support:

Docker Google Cloud

OS support:

Debian Ubuntu Kali Cent OS Red Hat Rocky Linux Fedora Arch Manjaro Alpine Linux openSUSE FreeBSD Nix macOS Windows Raspberry Pi

Table of contents:


Description

ASN / RPKI validity / BGP stats / IPv4v6 / Prefix / ASPath / Organization / IP reputation / IP geolocation / IP fingerprinting / Network recon / lookup tool / Web traceroute server.

This script serves the purpose of having a quick OSINT command line tool at disposal when investigating network data, which can come in handy in incident response scenarios as well (with features such as bulk geolocation and threat scoring).

It can be used as a recon tool by querying Shodan for data about any type of target (CIDR blocks/URLs/single IPs/hostnames). This will quickly give the user a complete breakdown about open ports, known vulnerabilities, known software and hardware running on the target, and more - without ever sending a single packet to the target. JSON output of the results, multiple simultaneous targets and IP list file inputs and are also supported. Click here for more information about Shodan scanning mode.

It can also be used as a web-based traceroute server, by running it in listening mode and launching lookups and traces from a local or remote browser (via a bookmarklet or custom search engine) or terminal (via curl, elinks or similar tools). Click here for more information about server mode functionality.

Furthermore, it can serve as a self-hosted lookup API endpoint and output JSON-formatted data while running in both interactive and server mode. Click here for more information about API mode functionality.

Features:

  • It will lookup relevant Autonomous System information for any given AS number, including:

    • Organization name and RIR region
    • IXP Presence (Internet Exchange facilities where the AS is present)
    • Global AS rank (derived from the size of its customer cone, number of peering relationships and more)
    • BGP statistics (neighbours count, originated v4/v6 prefix count)
    • Peering relationships separated by type (upstream/downstream/uncertain), and sorted by observed path count, to give more reliable results (so for instance, the first few upstream peers are most likely to be transits). Furthermore, a recap of transits/peers/customers amount (per latest CAIDA data) is displayed.
    • Announced prefixes aggregated to the most relevant less-specific INET(6)NUM object (actual LIR allocation).
  • It will perform an AS path trace (using mtr and retrieving AS data from the results) for single IPs or DNS results, optionally reporting detailed data for each hop, such as RPKI ROA validity, organization/network name, geographic location, etc.

  • It will detect IXPs (Internet Exchange Points) traversed during the trace, and highlight them for clarity.

  • It will attempt to lookup all relevant abuse contacts for any given IP or prefix.

  • It will perform RPKI validity lookups for every possible IP. Data is validated using the RIPEStat RPKI validation API. For path traces, the tool will match each hop's ASN/Prefix pair (retrieved from the Prefix Whois public server) with relevant published RPKI ROAs. In case of origin AS mismatch or unallowed more-specific prefixes, it will warn the user of a potential route leak / BGP hijack along with the offending AS in the path (requires -d option, see below for usage info).

    • Read more about BGP hijkacking here.
    • Read more about RPKI here, here, or here.
  • It will perform IP geolocation lookups according to the logic described below.

    • geolocation can be performed in bulk mode. See here for more info.
    • the script can also map all IPv4/IPv6 CIDR blocks allocated to any given country, by querying data from Marcel Bischoff's country-ip-blocks repo. See below for more info.
  • It will perform IP reputation, noise classification and in-depth threat analysis reporting (especially useful when investigating foreign IPs from log files).

  • It will perform IP fingerprinting using Shodan's InternetDB API and report any known vulnerabilities, open ports and services/operating system/hardware pertaining to target IPs and individual trace hops (detailed traces only).

    • Directly querying Shodan for any type of targets (including CIDR blocks) is also possible. More informations here about how to use the script as a recon tool.
  • It will perform IP type identification (Anycast IP/Mobile network/Proxy host/Datacenter or hosting provider/IXP prefix) for target IPs and individual trace hops. Broad type classification comes from ip-api, while detailed DC+region identification comes from incolumitas.com

    • It will also identify bogon addresses being traversed and classify them according to the relevant RFC (Private address space/CGN space/Test address/link-local/reserved/etc.)
  • It is possible to search by organization name in order to retrieve a list of IPv4/6 network ranges related to a given company. A multiple choice menu will be presented if more than one organization matches the search query.

  • It is possible to search for ASNs matching a given name, in order to map the ASNs for a given organization. The list will be enriched by each result's AS rank and useful tags highlighting the highest-ranking ASNs found.

  • It is possible to quickly identify the transit/upstream AS network(s) for a given prefix, through analysis of observed BGP updates and ASPATHs.

    • the tool will also inform the user when a prefix is likely coming from a large tier-1 or multihomed network.
  • Lookup data can be integrated by third party tools by choosing JSON output and parsing the results externally, turning the script into a lookup API endpoint.

Screenshots for every lookup option are below.

The script uses the following services for data retrieval:

It also provides hyperlinks (in server mode) to the following external services when appropriate:

Requires Bash v4.2+. Tested on:

  • Linux
  • FreeBSD
  • Windows (WSL2, Cygwin)
  • MacOS (thanks Antonio Prado and Alessandro Barisone)

Screenshots

Generic usage

  • IPv4 lookup with IP type detection (Anycast, Hosting/DC) and classification as good

    ipv4lookup

  • IPv4 lookup (bad reputation IP) with threat analysis/scoring, CPE/CVE identification and open ports reporting

    ipv4badlookup

  • IP fingerprinting with advanced datacenter+region identification, known vulnerabilities affecting the target and honeypot identification according to Shodan data

  • IPv6 lookup

    ipv6lookup

  • Autonomous system number lookup with AS ranking, operational region, BGP stats, peering and prefix informations

    asnlookup

  • Hostname/URL lookup

    hostnamelookup

AS Path tracing

  • ASPath trace to www.github.com

    pathtrace

  • ASPath trace traversing both an unannounced PNI prefix (FASTWEB->SWISSCOM at hop 11) and an IXP (SWISSCOM -> RCN through Equinix Ashburn at hop 16)

    pathtrace_pni_ixp

  • Detailed ASPath trace to 8.8.8.8 traversing the Milan Internet Exchange (MIX) IXP peering LAN at hop 6

    detailed_pathtrace

Network search by organization

  • Organization search for "github"

    search_by_org

Shodan scanning

  • Scanning for Shodan informations for a list of IPs

    shodanscan

Country IPv4/IPv6 CIDR mapping

  • Displaying a list of CIDR blocks allocated to Jamaica

    country_cidr

Bulk Geolocation / country stats

  • Performing bulk extraction, geolocation and stats for IPs from a logfile

    bulk_geolocation

Suggested ASNs search

  • Suggested ASNs (and respective AS rankings) for "google"

    asnsuggest

Transit/Upstream lookup

  • A large tier-1 network (COMCAST, AS7922) prefix is reachable through multiple other tier-1 networks like COGENT (AS174), LEVEL3 (AS3356) etc. - likely through settlement-free peering rather than BGP transit:

    upstreamfinder_tier1_network

  • Transit identification for a multihomed AS (AS30036 announces this prefix to Hurricane and GTT in a balanced way):

    upstreamfinder_multihoming

  • Preferred transit identification - Chinese UNICOM AS is a large network, but likely prefers Russian TRANSTELECOM (AS20485) transit over TELIA (AS1299), HURRICANE (AS6939), GTT (AS3257) and others:

    upstreamfinder_preferred_transit


Running the script from a container

To run the script without installing it locally, you have the following options:

  • Docker (thanks Gianni Stubbe, anarcat, Francesco Colista, arbal)

    Note: the Docker image runs by default in server mode, if no parameters are given. This is equivalent to running the tool as asn -l 0.0.0.0 (run server, bind to all IPv4 interfaces - this is necessary to expose the server port to the host machine). You can run the server with different options by explicitly passing -l [options]. It's also possible to pass an IpQualityScore token (both client and server runs) by setting the IQS_TOKEN environment variable (example below) in the container.

    Usage examples:

    • Start server: docker run -it -p 49200:49200 nitefood/asn
    • Client mode: docker run -it nitefood/asn 1.1.1.1
    • Supply an IQS token: docker run -it -e IQS_TOKEN="<your_token_here>" nitefood/asn [...]
  • Google Cloud Shell

    Note: server mode is supported out of the box in Cloud Shell, just follow the bookmarklet link that will be shown at server launch to access the VM for remote lookups.

    1. Clone the repository in Cloud Shell by clicking the following button:

    Open in Cloud Shell

    2. Prepare the GCP environment by launching ./cloudshell_bootstrap.sh

    3. (OPTIONAL) Input your IpQualityScore token when requested to enable in-depth threat analisys and scoring


Installation

This script requires BASH v4.2 or later. You can check your version by running from your shell:

bash -c 'echo $BASH_VERSION'

After installation, you can use the script by running the asn command.

Method 1: Install prerequisites + manual download

Note: this method is recommended as it will always get you the latest version of the script.

STEP 1. Install prerequisite packages

Some packages are required for full functionality:

  • Debian 10 / Ubuntu 20.04 (or newer):

    apt -y install curl whois bind9-host mtr-tiny jq ipcalc grepcidr nmap ncat aha
    
  • Debian 9 / Ubuntu 18.04 (or older):

    apt -y install curl whois bind9-host mtr-tiny jq ipcalc grepcidr nmap git gcc make && \
    git clone https://github.com/theZiz/aha.git && \
    make install -C aha/
    
  • CentOS / RHEL / Rocky Linux 9:

    dnf -y install epel-release && \
    dnf -y install curl whois bind-utils mtr jq nmap nmap-ncat ipcalc aha grepcidr
    
  • CentOS / RHEL / Rocky Linux 8: (thanks Robert Scheck)

    dnf -y install epel-release 'dnf-command(copr)' && \
    dnf -y copr enable robert/ipcalc && \
    dnf -y install curl whois bind-utils mtr jq nmap nmap-ncat ipcalc aha grepcidr
    
  • CentOS / RHEL 7: (thanks Robert Scheck)

    yum -y install epel-release yum-plugin-copr && \
    yum -y copr enable robert/ipcalc && \
    yum -y install curl whois bind-utils mtr jq nmap nmap-ncat ipcalc aha grepcidr && \
    hash -d ipcalc
    
  • Fedora:

    dnf -y install curl whois bind-utils mtr jq nmap nmap-ncat ipcalc aha grepcidr
    
  • openSUSE Leap 15.5 (or newer), openSUSE Tumbleweed

    zypper in -y curl whois bind-utils mtr jq nmap ncat ipcalc aha grepcidr
    
  • FreeBSD:

    env ASSUME_ALWAYS_YES=YES pkg install bash coreutils curl whois mtr jq ipcalc grepcidr nmap aha
    
  • Windows:

    • using WSL2 (recommended): Install Windows Subsystem for Linux (v2) by following Microsoft's guide. On step 6, choose one of the Linux distributions listed above (Ubuntu 20.04 LTS is recommended). Once your WSL2 system is up and running, open a Linux terminal and follow the prerequisite installation instructions above for your distribution of choice.

      Note for WSL2 users: Check this page for details on how to activate systemd if you plan to install the asn service.

    • using Cygwin: Most of the prerequisite packages listed above for Debian 10 / Ubuntu 20.04 (or newer) are obtainable directly with Cygwin's own Setup wizard (or through scripts like apt-cyg). You will still have to manually compile (or find a suitable third-party precompiled binary) the mtr, grepcidr and aha tools. Instructions on how to do so can be found directly on the respective projects homepages.

STEP 2. Script download and installation

Afterwards, to install the asn script from your shell to /usr/bin:

curl "https://raw.githubusercontent.com/nitefood/asn/master/asn" > /usr/bin/asn && chmod 0755 /usr/bin/asn

Method 2: Installing a packaged version of the script

Note: packages may not reflect the latest version, check Repology first.

Packaged versions of the tool are available for the following distributions:

Distribution list

  • Debian-based: (thanks Marcos Rodrigues de Carvalho)

    Debian 13 / Sid
    Ubuntu 24.04 (or newer)
    Kali (rolling)
    Raspbian (testing)

    sudo apt update && sudo apt install asn
    
  • Manjaro / Arch Linux: (thanks Worty)

    yay -S asn-git
    
  • Alpine Linux 3.18 (or newer) (thanks Francesco Colista)

    apk add -X https://dl-cdn.alpinelinux.org/alpine/v3.19/community asn
    
  • NixOS (thanks devhell)

  • MacOS (using Homebrew, thanks filippovitale)

    brew install asn
    

    Note for MacOS users:

    Homebrew has a policy not to install any binary with the setuid bit, and mtr (or actually, the mtr-packet helper binary that comes with it) requires to elevate to root to perform traces (good explanations for this can be found here and here). If mtr (and therefore asn) traces are not working on your system, you should either run asn as root using sudo, or set the proper SUID permission bit on the mtr (or better, on the mtr-packet) binary.

(Optional) Installing the asn server as a system service

Note: this step is optional, and these instructions are only for systemd-based Linux systems (most current major distributions).

To control the asn server with utilities like systemctl and service, and to enable it to automatically start at boot, follow these steps:

  1. create a new file called /etc/systemd/system/asn.service with the following content (make sure you edit the ExecStart line to match your installation path and desired startup options):
[Unit]
Description=ASN lookup and traceroute server
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=nobody
ExecStart=/usr/bin/asn -l 0.0.0.0

[Install]
WantedBy=multi-user.target
  1. Enable the CAP_NET_RAW capability for the mtr-packet binary: setcap cap_net_raw+ep $(which mtr-packet) Explanation: this will allow mtr-packet to create raw sockets (and thus perform traces) when launched as an unprivileged user (we're setting up the service to run as user nobody for added security), without the requirement of the setuid-root bit and without having to invoke mtr as root. A thorough explanation for this can be found here.
  2. Now you can refer to standard systemd utilities to perform service operations:
    • To start the service: systemctl start asn
    • To stop the service: systemctl stop asn
    • To check its status and latest logs: systemctl status asn
    • To follow its logging in real time: journalctl -f -u asn
    • To start the service automatically on boot: systemctl enable asn
    • To disable automatic start on boot: systemctl disable asn

IP reputation API token

The script will perform first-level IPv4/v6 reputation lookups using StopForumSpam, and in case of a match it will perform a second-level, in-depth threat analysis for targets and trace hops using the IPQualityScore API. The StopForumSpam API is free and requires no sign-up, and the service aggregates a huge amount of blacklist feeds.

Still, in order to use the IPQualityScore API for in-depth threat reporting, it's necessary to sign up for their service (it's free) and get an API token (it will be emailed to you on sign-up), which will entitle you to 5000 free lookups per month.

Once obtained, the api token should be written to one of the following files (parsed in that order):

$HOME/.asn/iqs_token or /etc/asn/iqs_token

The /etc-based file should be used when running asn in server mode. The $HOME-based file takes precedence if both files exist, and is ideal for user mode (that is, running asn interactively from the command line).

In order to do so, you can use the following command:

User mode:

TOKEN="<your_token_here>"; mkdir "$HOME/.asn/" && echo "$TOKEN" > "$HOME/.asn/iqs_token" && chmod -R 600 "$HOME/.asn/"

Server mode:

TOKEN="<your_token_here>"; mkdir "/etc/asn/" && echo "$TOKEN" > "/etc/asn/iqs_token" && chmod -R 700 "/etc/asn/" && chown -R nobody /etc/asn/

Either way, asn will pick up your token on the next run (no need to restart the service if running in server mode), and use it to query the IPQualityScore API.

Note: IPQualityScore is not queried by default for every target, but only for targets that get flagged as BAD by StopForumSpam. It's possible to override this behavior (and force IQS lookup for every target) by setting the IQS_ALWAYS_QUERY parameter to true in the preferences file. It is also possible to specify custom query settings through the IQS_CUSTOM_SETTINGS parameter.


Usage

Syntax

asn [OPTIONS] [TARGET]

asn [-v] -l [SERVER OPTIONS]

where TARGET can be one of the following:

  • AS number -- lookup matching ASN and BGP announcements/neighbours data. Supports "as123" and "123" formats (case insensitive)
  • IPv4/IPv6/Prefix -- lookup matching route(4/6), IP reputation and ASN data
  • Hostname -- resolve the host and lookup data (same as IPv4/IPv6 lookup. 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

Options:

  • -t

    • enables lookup and path tracing for targets (this is the default behavior)

      .asnrc option equivalent: MTR_TRACING=true (default: true)

  • -d

    • enables detailed trace mode (more info below)

      .asnrc option equivalent: DETAILED_TRACE=true (default: false)

  • -n

    • disables path tracing and only outputs lookup info (for IP targets)

    • disables additional INETNUM/origin lookups (for AS targets)

      .asnrc option equivalent: MTR_TRACING=false (default: true), ADDITIONAL_INETNUM_LOOKUP=false (default: true)

  • -s

    • Launch a Shodan InternetDB scan for the target(s). Supports multiple targets, mixed target types (IP/hostname/CIDR/URL) and piping from stdin.
  • -o

    • forces a Search-By-Organization lookup and skip all target identification checks
  • -a

    • enable ASN suggestion mode. This will search for all ASNs matching a given name.
  • -u

    • enable Transit/Upstream lookup mode. This will inspect BGP updates and ASPATHs for the TARGET address/prefix and identify possible transit/upstream autonomous systems.
  • -c

    • enable Country CIDR mode. This will output all IPv4/v6 CIDR blocks allocated to the specified country.
  • -g

    • enable Bulk Geolocation mode. This will extract all IPv4/v6 addresses from the input, geolocate them and draw some stats.
  • -l

    • Launch the script in server mode. See Server Options below
  • -j

    • enables compact JSON output. Useful for feeding the output into other tools (like jq or other parsers), or storing the lookup results.

      .asnrc option equivalent: JSON_OUTPUT=true (default: false)

  • -J

    • enables pretty-printed JSON output.

      .asnrc option equivalent: JSON_PRETTY=true (default: false)

  • -m

    • enables monochrome mode (disables all colors).

      .asnrc option equivalent: MONOCHROME_MODE=true (default: false)

  • -v

    • Enable debug messages (will display all URLs being queried to help identify external API slowdowns)

      .asnrc option equivalent: ASN_DEBUG=true (default: false)

  • -h

    • Show usage information.

Server Options:

  • BIND_ADDRESS

    • IP address (v4/v6) to bind the listening server to (e.g. asn -l 0.0.0.0)

      .asnrc option equivalent: DEFAULT_SERVER_BINDADDR_v4="<IPv4address>" (default: "127.0.0.1") and DEFAULT_SERVER_BINDADDR_v6="<IPv6address>" (default: "::1")

  • BIND_PORT

    • TCP Port to bind the listening server to (e.g. asn -l 12345)

      .asnrc option equivalent: DEFAULT_SERVER_BINDPORT="<port>" (default: "49200")

  • BIND_ADDRESS BIND_PORT

    • IP address and port to bind the listening server to (e.g. asn -l ::1 12345)
  • -v

    • Enable verbose output and debug messages in server mode

      .asnrc option equivalent: ASN_DEBUG=true (default: false)

  • --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
  • --max-conns <n>

    • The maximum number of simultaneous connections accepted by the server. 100 is the default.

Note: 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)

Default behavior:
  • The script will attempt to automatically identify the TARGET type, if invoked with -t, -n, -d or without options,
  • AS path tracing is enabled by default for all lookups involving an IP or hostname. In case of multiple IP results, the script will trace the first IP, with a preference for IPv6 if possible on the user's host.
Preferences file ($HOME/.asnrc)

Options defaults can be overridden by creating a file called .asnrc in the user's home directory. The following values are the defaults. Any (or all) of them can be specified in the settings file and adjusted to the user's preference:

MTR_TRACING=true
ADDITIONAL_INETNUM_LOOKUP=true
DETAILED_TRACE=false
MTR_ROUNDS=5
MAX_CONCURRENT_SHODAN_REQUESTS=10
SHODAN_SHOW_TOP_N=5
MONOCHROME_MODE=false
ASN_DEBUG=false
JSON_OUTPUT=false
JSON_PRETTY=false
DEFAULT_SERVER_BINDADDR_v4="127.0.0.1"
DEFAULT_SERVER_BINDADDR_v6="::1"
DEFAULT_SERVER_BINDPORT="49200"
IQS_ALWAYS_QUERY=false
IQS_CUSTOM_SETTINGS=""
Detailed mode (-d | DETAILED_TRACE=true)
  • Detailed hop info reporting and RPKI validation can be turned on by passing the [-d|--detailed] command line switch. This will enable querying the public pWhois server and the RIPEStat RPKI validation API for every hop in the mtr trace. Relevant info will be displayed as a "tree" below the hop data, in addition to Team Cymru's server output (which only reports the AS name that the organization originating the prefix gave to its autonomous system number). This can be useful to figure out more details regarding the organization's name, the prefix' intended designation, and even (to a certain extent) its geographical scope. Furthermore, this will enable a warning whenever RPKI validation fails for one of the hops in the trace, indicating which AS in the path is wrongly announcing (as per current pWhois data) the hop prefix, indicating a potential route leak or BGP hijacking incident.
Organization search (-o)
  • The script will try to figure out if the input is an Organization name (i.e. if it doesn't look like an IP address, an AS number or a hostname). In order to force an organization search (for example for Orgs containing . in their name), pass the [-o|--organization] command line switch.
ASN suggest (-a)
  • The script will try to find ASNs matching the given search string, using the RIPEStat API. This mode can be used to map all the autonomous systems related to a given company.
Upstream/transit identification (-u)
  • The script will inspect BGP updates for the given IP (v4/v6) and identify the likelyhood of the upstream autonomous system(s) being transit(s) for the origin AS. A probability of the upstreams being transits will be inferred by the amount of times the upstream AS appears in the observed ASPATHs towards the target IP, in comparison to other BGP peers. The script will also inform the user if the prefix is being simultaneously announced to multiple upstreams (e.g. in case of BGP multihoming, tier-1 prefixes, anycast addresses, etc.). JSON mode is supported.
Server mode (-l)
  • The script will start up a webserver allowing the user to run remote lookups and traceroutes directly from the browser. The web server is actually an ncat listener waiting for requests, responding to browsers querying through the HTTP protocol. This interface makes for a straightforward integration into user workflow and no need to download any client-side tools. By simply using a Javascript bookmarklet or custom search engine, it will be possible to launch remote traces and lookups without ever leaving the browser. Refer to the this section for more information.

Notes

Organization data, IP Reputation, noise classification and IP fingerprinting
  • Organization data is taken from pWhois
  • IP reputation data is taken from StopForumSpam and IpQualityScore

    Reputation is also enriched with IP noise classification (addresses that have been observed scanning the Internet, and very likely to appear in your logs), taken from GreyNoise. This will also help identify known-good IPs (e.g. Google networks, CDNs, etc.) from aggressive, known-malicious scanners.

  • IP fingerprinting data is retrieved from Shodan's InternetDB API. Data includes open ports, software/hardware information and known vulnerabilities pertaining to the IP address.
Geolocation

The script will perform IP and trace hop geolocation with this logic:

  1. Using the RIPE IPmap service as a primary source of geolocation data. It offers extremely precise latency-based geolocation data and is extremely reliable
  2. Using the ip-api service as a fallback source of geolocation data
  3. Using the Prefix Whois service as a last-resort source of geolocation data
IP Classification

The script will use the ip-api, incolumitas.com, RIPE IPmap and PeeringDB services to classify target IPs and trace hops into these categories:

  • Anycast IP
  • Mobile network
  • Proxy host (TOR exit node/VPN/etc)
  • Hosting network (datacenter/hosting provider/etc) along with detailed DC and region identification where available
  • IXP network
IXP detection and unannounced prefixes
  • The script will detect IXPs traversed during path traces by matching them with PeeringDB's comprehensive dataset of IXP prefixes.
  • The script will also attempt a best-effort, fallback generic whois lookup when Team Cymru, pWhois and PeeringDB have no info about the IP address or prefix. This is usually the case with some PNI prefixes, and will give better insight into the path taken by packets.

Running lookups from the browser

Prerequisite tools for server mode

Server mode requires two tools for its functionality: ncat and aha. Specifically, aha (the ANSI->HTML converter) v0.5+ is required. The ncat tool is contained inside the nmap package on older distributions (e.g. Ubuntu 18.04, Debian 9), while it is packaged as a standalone tool on newer ones.

Please refer to the installation section and run the appropriate commands to install the required packages for your operating system, and optionally to install the asn server as a systemd service.

Advantages of server mode

The main advantage of running lookups from the browser, is that every IP address and AS number gets converted into a hyperlink, allowing to perform subsequent lookups by simply clicking on them.

When looking up an URL/hostname/domain, quick WHOIS info and links to relevant external resources will be available in the results.

When looking up an AS number, all peering ASNs will be clickable. Also, if an AS peers at a public facility, PeeringDB info for that facility will be linked directly. Furthermore, additional external BGP information sources will be linked, directly for the target ASN.

Here are some examples:

srvmode_hostname_lookup

srvmode_whois

srvmode_asn_lookup

Server side

Once started in server mode, asn will spin up a custom webserver waiting for browser requests. This is what the server-side console looks like:

server_console

The server is now ready to accept browser requests (only from the local machine, in this case - since I've launched it with no command line switches, which defaults to listening on 127.0.0.1:49200. Refer to the usage section for more information about the available server options).

Client side

Visit this page in your browser and follow the instructions to copy the bookmarklet to your bookmarks toolbar:

bookmarklet_install

How it works

The bookmarklet is actually a small piece of Javascript code which will grab the hostname of the website you're currently visiting in the browser, and pass it to the server through a simple HTTP GET request. The server then proceeds to perform the lookup and traceroute (from its own viewpoint, just like it does when ran interactively from the command line), and feed the results to your browser through an HTML page, mimicking the effect of a scrolling terminal.

Note: The link you drag to the bookmarks bar is actually a minified (i.e.: compacted) version of the source javascript code, but for reference, here's the full source:

javascript:(function () {
   var asnserver = "localhost:49200";
   var target = window.location.hostname;
   var width = screen.width - screen.width / 7;
   var height= screen.height - screen.height / 4;
   var left = window.innerWidth / 2 - width / 2;
   var top = window.innerHeight / 2 - height / 2;
   window.open("http://" + asnserver + "/asn_lookup&" + target, "newWindow", "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left);
})();

If you want to "un-minify" the actual bookmarklet code, you can refer to this site

Once the trace is finished, an option to share the output on termbin is given to the user. This makes for quick sharing of the traceroute or lookup output with other people:

termbin

termbin_2

Search engine setup

In order to take full advantage of having asn inside the browser, it is possible to configure it as a custom search engine for the browser search bar. This allows to leverage the server to search for ASNs, URLs, IPs, Hostnames, and so on, depending on the search string.

Generally speaking, this implies instructing the browser that when a certain keyword is prepended to a search, the following characters (the actual search string, identified by %s) have to be passed to a certain URL. The URL is then composed according to this logic, and opened just like a normal webpage.

I've used @asn for my keyword, but anything would do. In order to speed up things, one could very well use a shorter tag (e.g. #) that, when used in the address bar, automatically switches your search engine to the ASN Lookup server. Note that the leading @ sign is not mandatory, just handy since it doesn't get in the way of normal searches, but there's much freedom with that.

For quick reference, the location URL string to enter (for both Firefox and Chrome) is: http://127.0.0.1:49200/asn_lookup&%s. Of course that sends lookup requests to the locally running ASN server.

Here's how to add a search engine in Firefox and Chrome:

Firefox:

  • Simply create a new bookmark and fill its details like this:

    searchsetup_firefox

Afterwards, you will be able to run queries and traceroutes by simply entering, for example, @asn 8.8.8.8 in the browser's location bar.

Chrome:

  1. Right click the location bar and select Manage search engines...

    searchsetup_chrome_1

  2. Click Add:

    searchsetup_chrome_2

  3. Fill in the details as shown below:

    searchsetup_chrome_3

As usual, the keyword is entierly customizable to your preference.

Other browsers:

  • You may want to follow this post to search for instructions on how to add a custom search engine for your browser of choice.

Running the server on an external host

Port forwarding

In order to access the server remotely, beside binding to 0.0.0.0 (or any other relevant IP address for your scenario), if the host is behind a NAT router, you'll need to forward the listening port (BIND_PORT) from the host/router outside IP to the actual machine where the ASN server is running on. It is a single TCP port (by default TCP/49200), and you can change it via the command line parameters (see Usage).

Textual browser client

It is possible to launch remote traces from another command line, and view the results directly in the terminal. All it takes is a compatible text browser, for example elinks (but you can download results for later reviewing even using curl or really anything else).

The script makes use of 8-bit ANSI colors for its output, so the command to launch a remote trace using elinks would be something like this:

elinks -dump -dump-color-mode 3 http://<ASN_SRV_IP>:49200/asn_lookup&8.8.8.8

Security considerations

The server logic in itself is very simple: the script implements a basic web server entirely in BASH, leveraging the fact that it can talk to a browser using the HTTP protocol and the HTML language, in a reasonably simple way.

The core behind it revolves around ncat, a very robust and stable netcat-like network tool. This is the actual "server" listening for incoming connection, and spawning connection handlers (that is, 'single-purpose' instances of the asn script itself) as clients connect.

If you decide to open it to the outside (i.e.: binding it to something that is not localhost, and launching traces from outside your local machine), please bear in mind that there is no authentication mechanism (yet) integrated into the code, so theoretically anybody with the right URL could spawn traceroutes from your server and view the results (bear in mind however that the server sanitizes user input by stripping any dangerous characters).

To contrast that, fortunately ncat implements a robust allow/deny logic (based both on command line parameters and files, a la /etc/hosts.allow and hosts.deny). The script supports passing parameters directly to ncat, therefore it's possible to make full use of its filtering capabilities and lock the server to a restricted range of trusted IPs.

The available options, and some usage examples, can be viewed by running asn -h.

Note: if you plan to run the server somewhere else than your local machine, remember to change the bookmarklet code and the custom search engine URL values to reflect the actual IP of the asn server. It is naturally possible to have multiple bookmarklets and search engine keywords to map to different ASN server instances.

For the bookmarklet, you'll need to change this value at the very beginning: var asnserver="localhost:49200" and make it point to the new address:port pair. No further change is required in the remaining JS code.

Shodan scanning (Recon Mode)

The tool can query Shodan's InternetDB API to look up informations regarding any type of targets when launched with the -s command line switch.

If the scan identifies any vulnerabilities, the NIST NVD API is queried in order to provide descriptions, any well known names and a link to learn more about the top ones.

Currently supported targets are:

  • IP addresses
  • CIDR blocks (will scan all of the IPs in the range)
  • URLs
  • Hostnames (will resolve to an IP (or list of IPs) and query all of them)

Target types can be mixed and queried in a single run. Targets can be piped to the tool via standard input as well.

Usage Examples:

asn -s 1.1.1.1 8.8.8.8 9.9.9.9

asn -s https://www.google.com 8.8.8.0/24

asn -s < iplist

curl -s https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/blocklist_de_bots.ipset | asn -s

Shodan scan results can be output in JSON mode by passing the -j or -J options.

Note: the Nmap tool is needed to use this feature, but note that no packets whatsoever are sent to the targets. Nmap is only required to break down CIDR blocks into single IPs (as a calculator tool).

Mapping the IP(v4/v6) address space of specific countries

The tool will search and display all IPv4 and IPv6 CIDR blocks allocated to a specific country when launched with the -c command line switch, plus some statistics.

  • Searching for a specific country code with a leading dot (e.g. .fr) will yield direct results for France, while full text search will display country codes matching the search string, or proceed to display the results if only one match is found.
  • Statistics such as v4 prefix length distribution, total IPv4 addresses available to the country, IPv4 addresses per capita, etc. are included.
  • JSON output is supported.

Usage Examples:

asn -c germany

asn -c .de

# scan a random norwegian subnet for CVE/CPE/open ports/hostnames:
asn -jc .no | jq -r ".results[] | .ipv4[$RANDOM % .ipv4_blocks]" | asn -s

Bulk geolocation mode

In this mode the tool will extract all IPv4 and IPv6 addresses from the input data and geolocate them. Anycast detection and general stats (top IPv4/IPv6 addresses with number of occurrences, number of IPs per country etc.) are included in the output. Bulk geolocation is quicker than normal asn lookups (300 IP addresses can be parsed in ~5s), and its main use case is to extract, geolocate and calculate country/occurrence stats for any number of IPs from arbitrarily formatted data streams (e.g. server logs). JSON output and stdin input are supported.

Usage Examples:

asn -g 1.1.1.1 8.8.8.8

# geolocate webserver clients
asn -g < /var/log/apache2/access.log
# geolocate IPs that have logged in to the system
last | asn -g

JSON output and API mode

Locally (shell mode)

The tool can be instructed to output lookup results in JSON mode by using the -j (compact JSON) or -J (pretty-printed JSON) command line options:

Example 1 - IPv4 lookup

Command:

asn -J 8.8.8.8

Output:
{
  "target": "8.8.8.8",
  "target_type": "ipv4",
  "result": "ok",
  "reason": "success",
  "version": "0.72.1",
  "request_time": "2022-03-28T22:42:34",
  "request_duration": 3,
  "result_count": 1,
  "results": [
    {
      "ip": "8.8.8.8",
      "ip_version": "4",
      "reverse": "dns.google",
      "org_name": "Google LLC",
      "abuse_contacts": [
        "[email protected]",
        "[email protected]"
      ],
      "routing": {
        "is_announced": true,
        "as_number": "15169",
        "as_name": "GOOGLE, US",
        "net_range": "8.8.8.0/24",
        "net_name": "LVLT-GOGL-8-8-8",
        "roa_count": "1",
        "roa_validity": "valid"
      },
      "type": {
        "is_bogon": false,
        "is_anycast": true,
        "is_mobile": false,
        "is_proxy": false,
        "is_dc": true,
        "dc_details": {
          "dc_name": "Google Cloud"
        },
        "is_ixp": false
      },
      "geolocation": {
        "city": "Washington, D.C.",
        "region": "Washington, D.C.",
        "country": "United States",
        "cc": "US"
      },
      "reputation": {
        "status": "good",
        "is_known_good": true,
        "known_as": "Google Public DNS"
      },
      "fingerprinting": {
        "ports": [
          53,
          443
        ]
      }
    }
  ]
}

Example 2 - ASN lookup

Command:

asn -J 5505

Output:
{
  "target": "5505",
  "target_type": "asn",
  "result": "ok",
  "reason": "success",
  "version": "0.76.0",
  "request_time": "2024-02-22T00:11:41",
  "request_duration": 10,
  "result_count": 1,
  "results": [
    {
      "asn": "5505",
      "asname": "VADAVO, ES",
      "asrank": 3779,
      "org": "VDV-VLC-RED06 VDV-VLC-RED06 - CLIENTES TELECOM",
      "holder": "VADAVO SOLUCIONES SL",
      "abuse_contacts": [
        "[email protected]"
      ],
      "registration_date": "2016-12-13T08:28:07",
      "ixp_presence": [
        "DE-CIX Madrid: DE-CIX Madrid Peering LAN",
        "ESPANIX Madrid Lower LAN"
      ],
      "prefix_count_v4": 8,
      "prefix_count_v6": 1,
      "bgp_peer_count": 36,
      "bgp_peers": {
        "upstream": [
          "1299",
          "6939",
          "59432",
          "174",
          "25091",
          "33891",
          "8218",
          "41327",
          "48348",
          "35280",
          "35625",
          "4455",
          "13030",
          "202766",
          "3303",
          "6057",
          "137409",
          "15830"
        ],
        "downstream": [
          "48952",
          "208248",
          "205086",
          "202054"
        ],
        "uncertain": [
          "47787",
          "39384",
          "37721",
          "36236",
          "25160",
          "24482",
          "51185",
          "49544",
          "41047",
          "29680",
          "29049",
          "212483",
          "14840",
          "34927"
        ]
      },
      "announced_prefixes": {
        "v4": [
          "185.123.204.0/24",
          "185.123.207.0/24",
          "188.130.247.0/24",
          "185.210.226.0/24",
          "185.210.227.0/24",
          "185.123.205.0/24",
          "185.210.225.0/24",
          "185.123.206.0/24"
        ],
        "v6": [
          "2a03:9320::/32"
        ]
      },
      "inetnums": {
        "v4": [
          "185.123.204.0/22",
          "185.210.225.0/24",
          "185.210.226.0/24",
          "185.210.227.0/24",
          "188.130.247.0/24"
        ],
        "v6": [
          "2a03:9320::/32"
        ]
      },
      "inetnums_announced_by_other_as": {
        "v4": [
          {
            "prefix": "188.130.254.0/24",
            "origin_asn": "",
            "origin_org": "",
            "is_announced": false
          }
        ],
        "v6": []
      }
    }
  ]
}

Example 3 - enumerating abuse contacts for every IP to which a hostname resolves

Command:

asn -j www.google.com | jq '[.results[].abuse_contacts[]] | unique[]'

Output:

Example 4 - enumerating known vulnerabilities for a target

Command:

asn -j 45.67.34.100 | jq '.results[].fingerprinting.vulns[]'

Output:
"CVE-2017-15906"
"CVE-2018-15919"

Example 5 - upstream/transit AS lookup for a given IP

Command:

asn -Ju 72.17.119.201

Output:
{
  "target": "72.17.119.201",
  "target_type": "ipv4",
  "result": "ok",
  "reason": "success",
  "version": "0.76.0",
  "request_time": "2024-02-22T00:15:25",
  "request_duration": 3,
  "result_count": 1,
  "results": [
    {
      "prefix": "72.17.0.0/17",
      "origin_as": "33363",
      "origin_as_name": "BHN-33363, US",
      "origin_as_rank": 435,
      "upstreams_count": 1,
      "upstreams": [
        {
          "asn": "7843",
          "asname": "TWC-7843-BB, US",
          "probability": 100,
          "is_tier1": false
        }
      ],
      "multiple_upstreams": false
    }
  ]
}

Example 6 - enumerating unannounced address blocks for a given AS

Command:

asn -j AS5505 | jq -r '.results[].inetnums_announced_by_other_as.v4[] | select(.is_announced==false) | .prefix'

Output:
188.130.254.0/24

Remotely (API endpoint)

By running the script in server mode, it is possible to use it as a self-hosted lookup API service by running HTTP queries against it and retrieving the results in compact or pretty-printed JSON format. The server exposes the asn_lookup_json and asn_lookup_jsonp endpoints for this purpose. The syntax is the same as with normal browser-based remote queries.

Example 1: querying the server remotely using curl (compact output):

root@KRUSTY:~# curl -s "http://localhost:49200/asn_lookup_json&1.1.1.1"
{"target":"1.1.1.1","target_type":"ipv4","result":"ok","reason":"success","version":"0.72.1","request_time":"2022-03-29T00:13:11","request_duration":5,"result_count":1,"results":[{"ip":"1.1.1.1","ip_version":"4","reverse":"one.one.one.one","org_name":"APNIC and Cloudflare DNS Resolver project","abuse_contacts":["[email protected]"],"routing":{"is_announced":true,"as_number":"13335","as_name":"CLOUDFLARENET, US","net_range":"1.1.1.0/24","net_name":"APNIC-LABS","roa_count":"1","roa_validity":"valid"},"type":{"is_bogon":false,"is_anycast":true,"is_mobile":false,"is_proxy":false,"is_dc":true,"dc_details":{"dc_name":"Cloudflare"},"is_ixp":false},"geolocation":{"city":"Magomeni","region":"Dar es Salaam","country":"Tanzania","cc":"TZ"},"reputation":{"status":"good","is_known_good":true,"known_as":"Cloudflare Public DNS"},"fingerprinting":{"ports":[53,80,443]}}]}

Example 2: querying the server remotely using curl (pretty printed output):

root@KRUSTY:~# curl -s "http://localhost:49200/asn_lookup_jsonp&10.0.0.1"
{
  "target": "10.0.0.1",
  "target_type": "ipv4",
  "result": "ok",
  "reason": "success",
  "version": "0.72.1",
  "request_time": "2022-03-29T00:14:57",
  "request_duration": 0,
  "result_count": 1,
  "results": [
    {
      "ip": "10.0.0.1",
      "ip_version": "4",
      "org_name": "IANA",
      "routing": {
        "is_announced": false,
        "net_name": "PRIVATE-ADDRESS-ABLK-RFC1918-IANA-RESERVED"
      },
      "type": {
        "is_bogon": true,
        "bogon_type": "rfc1918 (Private Space)"
      },
      "reputation": {},
      "fingerprinting": {}
    }
  ]
}

Thanks

An initial version of this script was featured in the Security Trails blog post "ASN Lookup Tools, Strategies and Techniques". Thank you Esteban!

Thanks Massimo Candela for your support and excellent work on IPmap, BGPlay and TraceMON!

Thanks to all the awesome contributors for their code, ideas, suggestions, packages and bug reports!

Feedback and contributing

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

asn's People

Contributors

33fraise33 avatar agru avatar aorith avatar arthur4ires avatar filippovitale avatar nitefood avatar odaydebian avatar robert-scheck avatar worty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asn's Issues

MacOS Compatibility

This looks great!

Trying to run on a Mac however and getting a coproc: command not found error in the script:

➜  ~ ./asn 8.8.8.8

╭────────────────────────╮
│ ASN lookup for 8.8.8.8 │
╰────────────────────────╯

 8.8.8.8 ┌PTR dns.google
         ├ASN 15169 (GOOGLE, US)
         ├ORG Google LLC
         ├NET 8.8.8.0/24 (LVLT-GOGL-8-8-8)
         ├ABU [email protected]
         ├GEO Mountain View, California (US)
         └REP ✓ GOOD


Tracing path to 8.8.8.8 (press CTRL-C to cancel)..../asn: line 234: coproc: command not found

╭──────────────────╮
│ Trace to 8.8.8.8 │
╰──────────────────╯

 Hop IP Address                                                                        Ping avg     AS Information
  1. ???                                                                                        *   (No reply)

Trace complete in 1 seconds.

Any ideas?

Use HTTPS when it's available

Firstly, thanks for the handy tool!

When the script checks the StopForumSpam API, it uses HTTP instead of HTTPS.

asn/asn

Line 2295 in 3097a10

is_blacklisted=$(docurl -m4 -s "http://api.stopforumspam.org/api?json&ip=$1" | jq -r '.ip.appears')

The API docs mention that the client must support SNI for HTTPS to work.
curl has supported this since version 7.18.1 (released in March 2008) so I think it's safe to assume it'll be fine.

As for ip-api.com, it looks like it needs a license to use HTTPS. It would be nice to have an option to provide an API key, similar to what you've done with ipqualityscore.

But even just a comment in the script to mention this is the reason it's using the insecure protocol would be good.

[Feature Request] Support IP2Location.io API to Query ASN

I would like to introduce the IP2Location.io IP geolocation API. It has the following advantages compare to other API providers.

  • Fast - one of the fastest API in the market using multi-location servers and Anycast routing
  • Accurate - based on IP2Location and IP2Proxy database which is available since 2002
  • Free - free tier with 30,000 queries monthly available to all users who sign-up online

Please consider IP2Location.io as one of the database source to get ASN. Feel free to ping me if you have any questions. Thank you.

Feature Request: Multi source lookups

I've been using this a bit and I really like it in server mode. Excellent as a looking glass. Nice crisp, colourful output.
And I've discovered aha, which is now my new favourite toy.

I can't help wondering if we could get this to execute on a bunch of remove machines (via ssh and keys) and output the results to the same page, one after the other. A bit like mtr.sh

What are you thoughts?

Installed ipcalc not detected

$ git log --oneline --no-decorate -1
741a5d5 reduced default shodan scanning threads - threads reduced from 20 to 10, Shodan introduced stricter rate limits (and longer cooldown timers)
$ dpkg -l ipcalc
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
         Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name           Version      Architektur  Beschreibung
+++-==============-============-============-=======================================
ii  ipcalc         0.42-2       all          parameter calculator for IPv4 addresses

$ ipcalc --version
0.5
$ ./asn github.com

╭─────────────╮
│ ! WARNING ! │
╰─────────────╯

The following tools were not found on this system:  
 - ipcalc

The following features will be disabled: 
 - CIDR deaggregation (due to incompatible ipcalc version - v0.41+ for Debian-based or v1.0.0+ for RHEL-based required, but you have v0.5)

Please install the necessary prerequisite packages
for your system by following these instructions: 

>> https://github.com/nitefood/asn#prerequisite-packages <<

Press ENTER to continue...
Interrupted

Feature request: add option to always query IPQualityScore and pass settings

IPQualityScore provides a lot of useful information on abuse IP. Please, add option to always query it. Also add an option to pass settings string, like strictness=1&allow_public_access_points=false

For example, abuser IP 77.83.36.16 currently displays REP ✓ NONE, but with enabled IPQualityScore it will display REP ❌ BAD (Threat Score 87%) RECENT ABUSER PROXY. Passing strictness=1 will give even better results: REP ❌ BAD (Threat Score 100%) RECENT ABUSER BOT PROXY .

zsh: killed bash (exec 3<>/dev/tcp/whois.ripe.net/43)

Hello there!

I am not an expert, and it might not be an issue with the code, but something changed because your amazing script stopped working for me since yesterday. I am running it on MacOS Ventura 13.1 with Homebrew.

Below is what happens:

sudo ./asn -n 40021

╭──────────────────────╮
│ ASN lookup for 40021 │
╰──────────────────────╯

AS Number ──> 40021
AS Name ──> CONTABO, US
Organization ──> CONTABO (Contabo Inc.)
Abuse contact ──> [email protected]
AS Reg. date ──> 2019-12-25 01:26:48
Peering @ixps ──> NONE

╭────────────────────────────────────────────╮
│ BGP informations for AS40021 (CONTABO, US) │
╰────────────────────────────────────────────╯

Retrieving prefix allocations and announcements for AS40021 (CONTABO, US) (press CTRL-C to cancel)...zsh: killed sudo ./asn -n 40021

In an effort to pinpoint the issue, I also got the following:

bash -x asn -v 40021 137 ⨯

  • ASN_VERSION=0.72.9
  • IFS='
    '
  • green=''
  • magenta=''
  • yellow=''
  • white=''
  • blue=''
  • red=''
  • black=''
  • lightyellow=''
  • lightred=''
  • lightblue=''
  • lightgreybg=''
  • bluebg=''
  • redbg=''
  • greenbg=''
  • yellowbg=''
  • default=''
  • htmlwhite='#cccccc'
  • htmlblack='#1e1e1e'
  • htmllightgray='#d5d5d5'
  • htmlred='#ff5f5f'
  • htmlblue='#00afd7'
  • htmlyellow='#afaf00'
  • htmlgreen='#00af5f'
  • htmlmagenta='#ff5fff'
  • [[ xterm-256color = \d\u\m\b ]]
  • IS_HEADLESS=false
  • ipv4v6regex='[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))'
  • '[' false = true ']'
    ++ tput cols
  • terminal_width=158
  • trap 'terminal_width=$(tput cols)' SIGWINCH
  • '[' '' = true ']'
  • IS_ASN_CHILD=false
  • '[' '' = true ']'
  • IS_ASN_CONNHANDLER=false
  • IQS_TOKEN_FILES=/Users/jmpere6/.asn/iqs_token:/etc/asn/iqs_token
  • NO_ERROR_ON_INTERRUPT=false
  • trap Ctrl_C INT
  • peeringdb_dataset=
  • peeringdb_ipv6_dataset=
  • [[ -r /etc/services ]]
    ++ cat /etc/services
  • WELL_KNOWN_PORTS='#

(I removed the long list of ports)

  • MTR_TRACING=true
  • DETAILED_TRACE=false
  • MTR_ROUNDS=5
  • MAX_CONCURRENT_SHODAN_REQUESTS=10
  • SHODAN_SHOW_TOP_N=5
  • MONOCHROME_MODE=false
  • ASN_DEBUG=false
  • JSON_OUTPUT=false
  • JSON_PRETTY=false
  • DEFAULT_SERVER_BINDADDR=127.0.0.1
  • DEFAULT_SERVER_BINDPORT=49200
  • [[ 2 -lt 1 ]]
  • '[' false = false ']'
  • rcfile=//Users/jmpere6/.asnrc
  • '[' -r //Users/jmpere6/.asnrc ']'
  • status_json_output=ok
  • reason_json_output=success
    ++ date +%Y-%m-%dT%H:%M:%S
  • json_request_time=2023-01-12T16:45:17
    ++ date +%s
  • starttime=1673559917
  • final_json_output=
  • json_target_type=unknown
  • json_resultcount=0
  • optspec=:hvmljJsgn:t:d:o:a:c:
  • FORCE_ORGSEARCH=false
  • SUGGEST_SEARCH=false
  • SERVER_MODE=false
  • RECON_MODE=false
  • COUNTRY_BLOCK_MODE=false
  • GEOLOCATE_ONLY_MODE=false
  • OPTIONS_PRESENT=false
  • getopts :hvmljJsgn:t:d⭕a:c: optchar
  • userinput=
  • OPTIONS_PRESENT=true
  • case "${optchar}" in
  • ASN_DEBUG=true
  • getopts :hvmljJsgn:t:d⭕a:c: optchar
  • '[' -t 0 ']'
  • '[' true = false ']'
  • '[' -z '' ']'
  • '[' false = false ']'
  • GetFullParamsFromCurrentPosition -v 40021
  • userinput=
  • for option in "${@:$OPTIND}"
  • userinput+=' 40021'
    ++ awk '{ sub(/^[ \t]+/, ""); print }'
  • userinput=40021
    ++ echo -en 40021
  • userinput=40021
  • '[' -z 40021 ']'
  • [[ false = true ]]
  • [[ false = true ]]
  • [[ false = true ]]
  • CheckPrerequisites
  • saveIFS='
    '
  • IFS=' '
  • prerequisite_tools='jq whois host curl'
  • optional_tools='nmap mtr ipcalc grepcidr ncat aha'
  • missing_tools=
  • disabled_features=
  • HARD_FAIL=false
  • HAVE_IPCALC=true
  • HAVE_NMAP=true
  • IXP_DETECTION=true
  • UNABLE_TO_SERVE=false
    ++ echo '5.2.15(1)-release'
    ++ cut -d . -f 1
  • bash_major=5
    ++ echo '5.2.15(1)-release'
    ++ cut -d . -f 2
  • bash_minor=2
  • bash_version_too_low=false
  • '[' 5 -lt 4 ']'
  • '[' 5 -eq 4 ']'
  • [[ false = true ]]
  • for tool in $prerequisite_tools
    ++ command -v jq
  • '[' -z /opt/homebrew/bin/jq ']'
  • for tool in $prerequisite_tools
    ++ command -v whois
  • '[' -z /usr/bin/whois ']'
  • for tool in $prerequisite_tools
    ++ command -v host
  • '[' -z /usr/bin/host ']'
  • for tool in $prerequisite_tools
    ++ command -v curl
  • '[' -z /usr/bin/curl ']'
  • for tool in $optional_tools
    ++ command -v nmap
  • '[' -z /opt/homebrew/bin/nmap ']'
  • for tool in $optional_tools
    ++ command -v mtr
  • '[' -z /opt/homebrew/sbin/mtr ']'
  • for tool in $optional_tools
    ++ command -v ipcalc
  • '[' -z /opt/homebrew/bin/ipcalc ']'
  • for tool in $optional_tools
    ++ command -v grepcidr
  • '[' -z /opt/homebrew/bin/grepcidr ']'
  • for tool in $optional_tools
    ++ command -v ncat
  • '[' -z /opt/homebrew/bin/ncat ']'
  • for tool in $optional_tools
    ++ command -v aha
  • '[' -z /opt/homebrew/bin/aha ']'
  • IpcalcVersionCheck
  • IPCALC_FLAG=
  • '[' true = true ']'
    ++ ipcalc -v
    ++ sed 's/ipcalc //'
  • ipcalc_version=0.51
    ++ echo 0.51
    ++ cut -d . -f 1
  • ipcalc_major=0
  • case "${ipcalc_major}" in
    ++ echo 0.51
    ++ cut -d . -f 2
  • ipcalc_minor=51
  • '[' 51 -ge 5 ']'
  • IPCALC_FLAG=-r
  • '[' -n '' ']'
  • IQS_TOKEN=
  • IFS='
    '
    ++ tr : '\n'
  • for asn_config_file in $(tr ':' '\n' <<< "$IQS_TOKEN_FILES")
  • '[' -r /Users/jmpere6/.asn/iqs_token ']'
    ++ tr -d ' \n\r\t'
  • IQS_TOKEN=25Txj4VImrUYxXUSVOa3LIhP0S58RvTo
  • break
  • '[' -z 25Txj4VImrUYxXUSVOa3LIhP0S58RvTo ']'
  • CoreutilsFixup
    ++ command -v gdate
  • '[' -x /opt/homebrew/bin/gdate ']'
  • export -f date
    ++ command -v gsed
  • '[' -x '' ']'
    ++ command -v gawk
  • '[' -x '' ']'
    ++ command -v gbase64
  • '[' -x /opt/homebrew/bin/gbase64 ']'
  • export -f base64
    ++ command -v gwc
  • '[' -x /opt/homebrew/bin/gwc ']'
  • export -f wc
  • '[' false = true ']'
  • '[' false = true ']'
  • IFS='
    '
  • local_wanip=
  • HAVE_IPV6=false
  • '[' false = true ']'
  • '[' -n '' ']'
  • '[' false = true ']'
  • '[' false = true ']'
  • '[' false = true ']'
  • BoxHeader 'ASN lookup for 40021'
  • [[ false = true ]]
  • local 'message=ASN lookup for 40021'
  • '[' false = true ']'
  • '[' false = true ']'
  • echo -e '\n╭──────────────────────╮\n│ ASN lookup for 40021 │\n╰──────────────────────╯'

╭──────────────────────╮
│ ASN lookup for 40021 │
╰──────────────────────╯

AS Number ──> 40021+ '[' false = true ']'

╭────────────────────────────────────────────╮
│ BGP informations for AS40021 (CONTABO, US) │
╰────────────────────────────────────────────╯

Sorry for the long output, I hope it helps. Looking at the script, I have the impression the problem is when it tries to open a persistent connection to RIPE Whois.

Thank you for the amazing script!

Windows 10 Installation

I am totally newbie in python.
I look for a bgp asn traceroute program for my lab and find this program, which is very good for my objectives.
Unfortunately, I am not able to understand that how can I use it in Windows 10.
I will be very grateful, if you guide me.
I am extremely sorry if I make any inconvenience to you.

`jq: error (at <stdin>:1): Cannot iterate over null (null)`

From a Hotel Wifi I get:

$ git log --oneline --no-decorate -1
6cb4456 improved subnet detection, introduced ROU element in report. - many ISPs allocate small blocks for PtP networks (or customers allocations), and take the time to define them in RIPE. But Cymru/Pwhois don't index these blocks (since they're not routed directly but aggregated in larger routes). Now `asn` will try to identify these subnets even if they're routed within larger prefixes. - NET element refers now to the smaller inetnum, while ROU reports the target IP's route. - Examples:   - asn -n 188.152.136.18   - asn -n 195.103.16.76   - asn -n 217.212.125.124   - asn -n 2.228.17.105
$ ./asn -v www.molgen.mpg.de

────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭──────────────────────────────────╮
│ ASN lookup for www.molgen.mpg.de │
╰──────────────────────────────────╯

- Resolving "www.molgen.mpg.de"... 1 IP address found:

[2022-11-10 19:58:14]   DEBUG   curl -s api64.ipify.org
[2022-11-10 19:58:16]   DEBUG   curl -m5 -s https://stat.ripe.net/data/abuse-contact-finder/data.json?resource=134.76.31.205&sourceapp=nitefood-asn
[2022-11-10 19:58:17]   DEBUG   curl -m4 -s https://ipmap.ripe.net/api/v1/locate/134.76.31.205/best
[2022-11-10 19:58:18]   DEBUG   curl -m4 -s http://ip-api.com/json/134.76.31.205?fields=status,message,country,countryCode,regionName,city,mobile,proxy,hosting
[2022-11-10 19:58:18]   DEBUG   curl -m2 -s https://api.incolumitas.com/datacenter?ip=134.76.31.205
[2022-11-10 19:58:18]   DEBUG   curl -m4 -s http://api.stopforumspam.org/api?json&ip=134.76.31.205
[2022-11-10 19:58:19]   DEBUG   curl -m5 -s https://api.greynoise.io/v3/community/134.76.31.205
[2022-11-10 19:58:20]   DEBUG   curl -m5 -s https://internetdb.shodan.io/134.76.31.205
[2022-11-10 19:58:21]   DEBUG   curl -s https://stat.ripe.net/data/rpki-validation/data.json?resource=680&prefix=134.76.0.0/16&sourceapp=nitefood-asn

 134.76.31.205 ┌PTR npsw-www.mpg.de
               ├ASN 680 (DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE)
               ├ORG GWD Goettingen
               ├NET 134.76.0.0/16 (GWDG)
               ├ABU [email protected] / [email protected]
               ├ROA ✓ VALID (2 ROAs found)
               ├TYP  Mobile network IP 
               ├GEO Göttingen, Lower Saxony (DE)
               ├CPE [APP: apache:http_server] [APP: rubyonrails:rails] [APP: ruby-lang:ruby]
               ├POR Open ports: 80, 443
               └REP ✓ NONE


╭────────────────────────────╮
│ Trace to www.molgen.mpg.de │
╰────────────────────────────╯

[2022-11-10 19:58:22]   DEBUG   mtr -> 134.76.31.205 (5 rounds)
 Hop IP Address                                                                               Loss%      Ping avg     AS Information                
  1. _gateway (172.16.3.254)                                                                     0%        1.5 ms    BOGON  rfc1918 (Private Space)
  2. host18523696-201.telnaptelecom.pl (185.236.96.201)                                          0%        1.4 ms   [AS43372] TELNAP, PL
  3. ???                                                                                       100%             *   (No reply)
  4. host185186152-40.telnaptelecom.pl (185.186.152.40)                                          0%        7.9 ms   [AS43372] TELNAP, PL
  5. 82.177.247.209                                                                              0%        2.1 ms   [AS20804] ASN-TELENERGO ul. PERKUNA 47, WARSZAWA, PL
[2022-11-10 19:58:36]   DEBUG   curl -s https://www.peeringdb.com/api/ixpfx?prefix__startswith=88.220&protocol__in=IPv4
  6. 88.220.206.191                                                                              0%       21.5 ms   (EXATEL-NET)
[2022-11-10 19:58:38]   DEBUG   curl -s https://www.peeringdb.com/api/ixpfx?prefix__startswith=88.220&protocol__in=IPv4
  7. 88.220.204.181                                                                              0%       18.0 ms   (EXATEL-NET)
[2022-11-10 19:58:39]   DEBUG   curl -s https://www.peeringdb.com/api/ixpfx?prefix__startswith=88.220&protocol__in=IPv4
  8. 88.220.195.38                                                                               0%       18.1 ms   (EXATEL-NET / Connected by EXATEL S.A.)
[2022-11-10 19:58:41]   DEBUG   curl -s https://www.peeringdb.com/api/ixpfx?prefix__startswith=88.220&protocol__in=IPv4
jq: error (at <stdin>:1): Cannot iterate over null (null)
  9. 88.220.196.43                                                                               0%       16.3 ms   (EXATEL-NET / Connected by EXATEL S.A.)
 10. ???                                                                                       100%             *   (No reply)
 11. cr-han2-be6.x-win.dfn.de (188.1.144.134)                                                    0%       25.1 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
 12. kr-goe12-13.x-win.dfn.de (188.1.231.126)                                                    0%       27.9 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
C 13. gv-GWDGIR-gwdg.net.gwdg.de (134.76.147.181)                                                 0%       27.8 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
 14. npsw-www.mpg.de (134.76.31.205)                                                             0%       26.2 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE

Trace completed in 22 seconds on 2022-11-10 19:58:44 CET


╭──────────────────────────────╮
│ AS path to www.molgen.mpg.de │
╰──────────────────────────────╯

  43372  TELNAP (Local AS)
 ╭╯
 ╰20804  ASN-TELENERGO ul. PERKUNA 47
 ╭╯
 ╰680    DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V.

Last AS missing in AS path information

I am using

$ git log --oneline --no-decorate -1
1f794b9 Add installation instructions for RHEL 7 and 8 (#38)

Then:

$ ./asn charite.de

────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭───────────────────────────╮
│ ASN lookup for charite.de │
╰───────────────────────────╯

- Resolving "charite.de"... 1 IP address found:

                                                                                
 141.42.206.113 ┌PTR charite.de
                ├ASN 680 (DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE)
                ├ORG DFN
                ├NET 141.42.0.0/16 (CHARITE-NET)
                ├ABU [email protected] / [email protected]
                ├ROA ✓ VALID (1 ROA found)
                ├GEO Berlin, Land Berlin (DE)
                ├CPE [APP: php:php] [APP: apache:http_server] [APP: typo3:typo3]
                ├POR Open ports: 80, 443
                └REP ✓ NONE


╭─────────────────────╮
│ Trace to charite.de │
╰─────────────────────╯

 Hop IP Address         Loss%      Ping avg     AS Information                  
  1. o2.box (192.168.1.1)    80%        0.7 ms    BOGON  rfc1918 (Private Space)
  2. loopback1.0002.acln.01.ber.de.net.telefonica.de (62.52.201.185)    80%        6.9 ms   [AS6805] TDDE-ASN1, DE
  3. bundle-ether16.0003.dbrx.01.ber.de.net.telefonica.de (62.53.2.84)    80%        7.0 ms   [AS6805] TDDE-ASN1, DE
  4. ae1-0.0001.prrx.01.ber.de.net.telefonica.de (62.53.11.125)    80%        9.2 ms   [AS6805] TDDE-ASN1, DE
  5. dfn.bcix.de (193.178.185.42)    20%       17.1 ms    IXP  BCIX (Berlin Commercial Internet Exchange)
  6. kr-charit1.x-win.dfn.de (188.1.235.78)    80%       17.2 ms   (WIN-IP / IP networking on DFN's Wissenschaftsnetz "X-WiN")
  7. ???                 100%             *   (No reply)                        
  8. ???                 100%             *   (No reply)                        
  9. ???                 100%             *   (No reply)                        
 10. charite.de (141.42.206.113)    20%       19.3 ms   (CHARITE-NET / Charite - Universitaetsmedizin Berlin)
                                                                                
Trace completed in 37 seconds on 2023-02-20 14:22:40 CET


╭───────────────────────╮
│ AS path to charite.de │
╰───────────────────────╯

  6805   TDDE-ASN1 (Local AS)
 ╭╯
 ╰ IXP   BCIX (Berlin Commercial Internet Exchange)


The AS path information is missing the last AS680. It’s present in the mtr output:

$ mtr -z -s 10 -r -c 10 charite.de
Start: 2023-02-20T14:43:23+0100
HOST: ersatz                      Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. AS???    o2.box              90.0%    10    2.5   2.5   2.5   2.5   0.0
  2. AS???    loopback1.0002.acln 90.0%    10    7.0   7.0   7.0   7.0   0.0
  3. AS???    bundle-ether16.0003 90.0%    10    7.3   7.3   7.3   7.3   0.0
  4. AS6805   ae1-0.0001.prrx.01. 90.0%    10    6.4   6.4   6.4   6.4   0.0
  5. AS???    dfn.bcix.de         10.0%    10   16.7  17.0  16.7  17.7   0.4
  6. AS???    kr-charit1.x-win.df 90.0%    10   17.2  17.2  17.2  17.2   0.0
  7. AS???    ???                 100.0    10    0.0   0.0   0.0   0.0   0.0
  8. AS???    ???                 100.0    10    0.0   0.0   0.0   0.0   0.0
  9. AS???    ???                 100.0    10    0.0   0.0   0.0   0.0   0.0
 10. AS680    charite.de          10.0%    10   19.1  19.0  18.6  19.2   0.2

Cannot iterate over null

When you use it with the -g parameter, it prints the following error, do you know the reason?

jq: error (at :1): Cannot iterate over null (null)

screenshots

Just a placeholder issue to permalink screenshots from the repo README.

Some flags aren't being pulled in from cdnjs

This ASN lookup string broke the pulling of a flag.

LINODE-AP Linode, LLC, US

I'm guessing the code grabs the second field in a comma separated list, as it attempted to grab llc.svg

We should probably grab the last item in the list.

I'll take a closer look when I have some time.

Two routers with same IP address are treated as "routing loop"

Two routers with same IP address are treated as "routing loop", even there is no real routing loop. From asn output while using commit 64e9253:

 Hop IP Address                                                                                  Loss%      Ping avg     AS Information                                                                                         
  1. fritz.box (192.168.0.1)                                                                        0%        1.2 ms    BOGON  rfc1918 (Private Space)                                                                          
  2. dslb-084-059-211-001.084.059.pools.vodafone-ip.de (84.59.211.1)                                0%        5.5 ms   [AS3209] VODANET International IP-Backbone of Vodafone, DE                                               
  3. 88.79.14.158                                                                                   0%        5.2 ms   [AS3209] VODANET International IP-Backbone of Vodafone, DE                                               
  4. 88.79.15.124                                                                                   0%        5.5 ms   [AS3209] VODANET International IP-Backbone of Vodafone, DE                                               
  5. 188.111.129.42                                                                                 0%        6.6 ms   [AS3209] VODANET International IP-Backbone of Vodafone, DE                                               
  6. 145.254.2.209                                                                                  0%       10.2 ms   [AS3209] VODANET International IP-Backbone of Vodafone, DE                                               
  7.  no route to host (routing loop detected)                                                    100%             *   (No reply)                                                                    

However, in mtr it looks like this:

$ mtr -w -z <…>
Start: 2021-10-14T01:31:28+0200
HOST: tux.example.net                                               Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. AS???    fritz.box                                              0.0%    10    1.1   1.1   1.0   1.1   0.0
  2. AS3209   dslb-084-059-211-001.084.059.pools.vodafone-ip.de      0.0%    10    5.5   5.4   5.0   6.6   0.5
  3. AS3209   88.79.14.158                                           0.0%    10    5.0   5.2   4.8   5.8   0.3
  4. AS3209   88.79.15.124                                           0.0%    10    5.7   5.9   5.1   6.5   0.4
  5. AS3209   188.111.129.42                                         0.0%    10    7.0   6.8   6.2   8.1   0.5
  6. AS3209   145.254.2.209                                          0.0%    10   10.6  10.5  10.1  11.4   0.4
  7. AS3209   145.254.2.209                                          0.0%    10    9.7  10.1   9.6  11.2   0.4
  8. AS6830   de-str01c-rb01-be-1050.aorta.net                       0.0%    10   12.5  12.7  12.3  13.8   0.5
  9. AS3209   <…>                                                    0.0%    10   12.2  12.2  11.9  12.7   0.2
 10. AS<…>    <…>                                                    0.0%    10   12.0  18.7  11.7  78.2  20.9
$ 

So yes, the same IP address appears twice in the trace, but there is still no routing loop, the target can be properly reached.

No date/time logged in output

Currently, it looks like there is no date/time, from when the command was executed, in the output. I know, everyone could append date; asn …, but often it’s forgotten, and the date/time might be useful to correctly interpret the data (later).

Some IP addresses missing in trace

Using traceroute shows cloudflare.bcix.de, but ASN’s trace does not.

$ git log --oneline -1 --no-decorate 
23b2d39 Minor tweaks
$ ./asn 1.1.1.1

────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭────────────────────────╮
│ ASN lookup for 1.1.1.1 │
╰────────────────────────╯
                                                                                                                                                      
 1.1.1.1 ┌PTR one.one.one.one
         ├ASN 13335 (CLOUDFLARENET, US)
         ├ORG APNIC and Cloudflare DNS Resolver project
         ├NET 1.1.1.0/24 (APNIC-LABS)
         ├ABU [email protected]
         ├ROA ✓ VALID (1 ROA found)
         ├TYP  Anycast IP   Hosting/DC 
         ├GEO Magomeni, Dar es Salaam (TZ)
         └REP ✓  KNOWN GOOD as "Cloudflare Public DNS" 


╭──────────────────╮
│ Trace to 1.1.1.1 │
╰──────────────────╯

 Hop IP Address                                                                               Loss%      Ping avg     AS Information                  
  1. ???                                                                                       100%             *   (No reply)                        
  2. ???                                                                                       100%             *   (No reply)                        
  3. ae14-0.0002.dbrx.02.ber.de.net.telefonica.de (62.53.11.222)                                 0%        9.2 ms   [AS6805] TDDE-ASN1, DE            
  4. ae1-0.0002.prrx.02.ber.de.net.telefonica.de (62.53.12.61)                                  80%        7.5 ms   [AS6805] TDDE-ASN1, DE            
  5. ???                                                                                       100%             *   (No reply)                        
  6. one.one.one.one (1.1.1.1)                                                                  80%        9.1 ms   [AS13335] CLOUDFLARENET, US       
                                                                                                                                                      
Trace complete in 11 seconds.


╭────────────────────╮
│ AS path to 1.1.1.1 │
╰────────────────────╯

  6805   TDDE-ASN1 (Local AS)
 ╭╯
 ╰13335  CLOUDFLARENET


$ traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  ae14-0.0001.dbrx.02.ber.de.net.telefonica.de (62.53.11.220)  12.626 ms  12.610 ms  12.587 ms
 4  ae0-0.0002.prrx.02.ber.de.net.telefonica.de (62.53.12.59)  11.638 ms ae0-0.0001.prrx.02.ber.de.net.telefonica.de (62.53.4.153)  12.564 ms ae1-0.0001.prrx.02.ber.de.net.telefonica.de (62.53.4.155)  17.601 ms
 5  cloudflare.bcix.de (193.178.185.17)  17.145 ms as13335.berlin.megaport.com (194.9.117.74)  14.391 ms  14.379 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

TERM value is set in headless mode when run with ./asn -l

When listening in server mode, I don't get any output from asn.

[2021-04-11 18:15:45] INFO ASN Lookup Server listening on 192.168.3.21:49200
[2021-04-11 18:15:47] INFO Incoming connection by client 172.18.0.7
[2021-04-11 18:15:47] STARTED Lookup request by client 172.18.0.7 for target github.com (Request ID: 817759845)

────────────────────────────────────────────────────────────
WARNING

No IPQualityScore token found, so disabling in-depth threat
analysis and IP reputation lookups. Please visit
https://github.com/nitefood/asn#ip-reputation-api-token
for instructions on how to enable it.
────────────────────────────────────────────────────────────
./asn: line 1389: $max_msg_size: substring expression < 0
[2021-04-11 18:15:48] COMPLETED Lookup request by client 172.18.0.7 for target github.com (Request ID: 817759845)

Screenshot 2021-04-11 at 18 19 26

./asn: line 1389: $max_msg_size: substring expression < 0

asn/asn

Line 1387 in d280c0a

max_msg_size=$((terminal_width-23))

It looks like terminal_width is 0 at this point and thus max_msg_size = -23

Disable Color Output

Please give us an option to disable color output and to get output as JSON. nobody wants those pesky colors in their terminal, those are for kiddos ;)

thanks for the awesome tool!

IPv4 address retrieval for a specific AS does not work anymore

Launching ./asn 15169 :

...

╭───────────────────────────────────────────╮
│ BGP informations for AS15169 (GOOGLE, US) │
╰───────────────────────────────────────────╯

Retrieving information for IPv4 prefix 0/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 1/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 2/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 3/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 4/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 5/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 6/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
Retrieving information for IPv4 prefix 7/805 (press CTRL-C to cancel)...host: '....origin.asn.cymru.com' is not a legal name (empty label)
...

Final print : 

...
───── IPv4 ─────

NONE

───── IPv6 ─────

2001:4860::/32
2404:6800::/32
2404:f340::/32
2606:73c0::/32
2607:f8b0::/32
2620:120:e000::/40
2800:3f0::/32
2a00:1450::/29
2a00:79e0::/31
2c0f:fb50::/32


Some IPv6 ranges not picked up

I love asn, but it misses some IPv6 networks.

As an example, 'asn 5089' displays the network information for Virgin Media (UK), with many IPv4 subnets but no IPv6 subnets.

However a search for 'asn 2a02:8801::1' shows it is part of AS5089 (2a02:8801::/32). Virgin Media also have 2a02:8880::/25, and a search for an address in that subnet also works.

Is there a way to get these IPv6 subnets to show up?

Not every ipcalc(1) supports '-r'

Not every ipcalc supports -r as it seems, thus I see the following in the output somewhere in the middle while using asn from commit 64e9253:

ipcalc: bad argument -r: unknown option                                                        
Usage: ipcalc [OPTION...]
  -c, --check         Validate IP address for specified address family
  -4, --ipv4          IPv4 address family (default)
  -6, --ipv6          IPv6 address family
  -b, --broadcast     Display calculated broadcast address
  -h, --hostname      Show hostname determined via DNS
  -m, --netmask       Display default netmask for IP (class A, B, or C)
  -n, --network       Display network address
  -p, --prefix        Display network prefix
  -s, --silent        Don't ever display error messages

Help options:
  -?, --help          Show this help message
  --usage             Display brief usage message
$ rpm -qf `which ipcalc`
initscripts-9.49.53-1.el7_9.1.x86_64
$ 

Bulk geolocation incorrect results

Bulk geolocation feature may need some more testing.

It defaults every IP to : Ranong, Ranong, TH (Thailand) here:

$ echo "169.150.243.18 143.244.33.95 143.244.33.79 143.244.33.78 143.244.33.56 169.150.243.20 169.150.243.17" | asn -g

────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭─────────────────────────────────────────╮
│ Geolocation lookup for multiple targets │
╰─────────────────────────────────────────╯
143.244.33.56   : Ranong, Ranong, TH (Thailand)                                                                                                                                                                                         
143.244.33.78   : Ranong, Ranong, TH (Thailand) 
143.244.33.79   : Ranong, Ranong, TH (Thailand) 
143.244.33.95   : Ranong, Ranong, TH (Thailand) 
169.150.243.17  : Ranong, Ranong, TH (Thailand) 
169.150.243.18  : Ranong, Ranong, TH (Thailand) 
169.150.243.20  : Ranong, Ranong, TH (Thailand) 

Adding an IPQuality API improves it a bit, but it still mention Ranong:

$ echo "169.150.243.18 143.244.33.95 143.244.33.79 143.244.33.78 143.244.33.56 169.150.243.20 169.150.243.17" | asn -g

╭─────────────────────────────────────────╮
│ Geolocation lookup for multiple targets │
╰─────────────────────────────────────────╯
143.244.33.56   : Singapore, Central Singapore, SG (Singapore)                                                                                                                                                                          
143.244.33.78   : Ranong, Ranong, TH (Thailand) 
143.244.33.79   : Singapore, Central Singapore, SG (Singapore) 
143.244.33.95   : Singapore, Central Singapore, SG (Singapore) 
169.150.243.17  : Singapore, Central Singapore, SG (Singapore) 
169.150.243.18  : Singapore, Central Singapore, SG (Singapore) 
169.150.243.20  : Singapore, Central Singapore, SG (Singapore) 

Similar issue trying with a known list from the UK:

$ echo "84.17.50.99 185.59.221.179 84.17.50.98 89.187.88.237" | asn -g

╭─────────────────────────────────────────╮
│ Geolocation lookup for multiple targets │
╰─────────────────────────────────────────╯
185.59.221.179  : Ranong, Ranong, TH (Thailand)                                                                                                                                                                                         
84.17.50.98     : Ranong, Ranong, TH (Thailand) 
84.17.50.99     : Ranong, Ranong, TH (Thailand) 
89.187.88.237   : London, England, GB (United Kingdom) 

Git tags?

Do you have any plans for Git tags? Based on the source code there seems to be some versioning (0.71.6 as of writing). Thus, do you see any chance to create a Git tag when bumping the version in the source code? This would ease packaging for Linux distributions.

IPv6 traceroute refusing to start on my host

Hi,
First of all, thank you for this amazing script.

I'm opening this issue as IPv6 traceroute doesn't work for me for some reason. When I try to traceroute to e.g. google.com'v IPv6 address, I get:

user@host:~$ ./asn 2a00:1450:4002:402::200e
[... a bunch of correct information ...]
Error: cannot trace an IPv6 from this IPv4-only host!

Similarly, when I run ./asn google.com it performs an IPv4 traceroute, even though the docs say it should perform an IPv6 traceroute when possible.

However, the host is definitely IPv6-enabled: I can successfully ping6 and traceroute6 to the very same address.

I'm gonna take a look myself and see if I can figure out the issue, and then update this issue.

ipcalc bad argument

Possibly related to issue 34 - #34

asn dns.inxfiber.com

ipcalc: bad argument -v: unknown option
Usage: ipcalc [OPTION...]
-c, --check Validate IP address for specified address family
-4, --ipv4 IPv4 address family (default)
-6, --ipv6 IPv6 address family
-b, --broadcast Display calculated broadcast address
-h, --hostname Show hostname determined via DNS
-m, --netmask Display default netmask for IP (class A, B, or C)
-n, --network Display network address
-p, --prefix Display network prefix
-s, --silent Don't ever display error messages

Help options:
-?, --help Show this help message
--usage Display brief usage message

yum whatprovides ipcalc

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: ohioix.mm.fcix.net
  • epel: mirrors.wcupa.edu
  • extras: mirrors.sonic.net
  • updates: repos.lax.layerhost.com
    initscripts-9.49.53-1.el7.x86_64 : The inittab file and the /etc/init.d scripts

Repo : base
Matched from:
Filename : /usr/bin/ipcalc

Json output breaks for AS1547

Probably some quoting issues:

$ bash -x ./asn -J 1547

[ ... ]

+ json_to_print+='"results":[{"asn":"1547","asname":"IDK-NETWORK, MD","org":"N/A","holder":"Societatea mixta pe actiuni de tip inchis "Interdnestrcom"","abuse_contacts":

[ ... ]

+ [[ true = true ]]
++ jq -M .
parse error: Invalid numeric literal at line 1, column 297
+ json_to_print=
+ echo -e ''

+ exit 0

Add option to search by (company) name

One option I'm missing is to get results by providing the (company) name. Sometimes you don't even know the full name so you would provide a substring and get all results which contain the substring.

This option is e.g. available here: https://bgpview.io

btw. Thanks for the great tool :)

Issue with obtaining v4 and v6 prefixes on MACOS

Hi nitefood,

Mac seems to have an issue grabbing prefixes both IPv4 and v6:

:~/repo/asn [master]% sw_vers
ProductName:		macOS
ProductVersion:		13.2.1
BuildVersion:		22D68
~/repo/asn [master]% git --no-pager log --oneline --no-decorate -1
f53ff33 IPv6 improvements (fixes #43) - improved host IPv6 detection reliability using ifconfig.co - improved host AS detection using RIPEStat for IPv6 and dual stack hosts - [server mode] switched default binding address to ::1 instead of 127.0.0.1 for IPv6 and dual stack hosts
~/repo/asn [master]% ./asn 5505

╭─────────────────────╮
│ ASN lookup for 5505 │
╰─────────────────────╯

 AS Number     ──> 5505
 AS Name       ──> VADAVO, ES
 Organization  ──>  (VDV-VLC-RED06 VDV-VLC-RED06 - CLIENTES TELECOM)
 Abuse contact ──> [email protected]
 AS Reg. date  ──> 2016-12-13 08:28:07
 Peering @IXPs ──> DE-CIX Madrid: DE-CIX Madrid Peering LAN • ESPANIX Madrid Lower LAN


╭──────────────────────────────────────────╮
│ BGP informations for AS5505 (VADAVO, ES) │
╰──────────────────────────────────────────╯

Retrieving prefix allocations and announcements for AS5505 (VADAVO, ES) (press CTRL-C to cancel)...zsh: killed     ./asn 5505

Seems to be an issue with how the connection to ripe is made, maybe?

~/repo/asn [master]% exec 85<>/dev/tcp/whois.ripe.net/43
zsh: no such file or directory: /dev/tcp/whois.ripe.net/43

~/repo/asn [master]% exec 3<>/dev/tcp/whois.ripe.net/43
zsh: no such file or directory: /dev/tcp/whois.ripe.net/43

IPv4 blocks

when i search for the ASNs using orgname for ext asn google.com, i get about 5 to 10 results matching the name and i need to key in the number i want to and the tools gives me a CIDR if present, is it possible that I can get all the CIDRS of the listed names at once with key in the required org name number

thanks

IP version assumptions and conflict in server mode

When running in server mode, compare if you will

/asn_lookup&bbc.co.uk

and

/asn_lookup&www.bbc.co.uk

The error is:

host: '....origin.asn.cymru.com' is not a legal name (empty label)
host: '' is not in legal name syntax (unexpected end of input)

Looks like $rev doesn't get a value. I'll take a closer when i get some time

./asn www.bbc.co.uk works fine on the command line.

BGP informations not retrieved

Hi,

When I use the script to get informations of ASN, it appears that I don't received BGP Informations and Announced prefixes.

./asn 206610

────────────────────────────────────────────────────────────
WARNING

No IPQualityScore token found, so disabling in-depth threat
analysis and IP reputation lookups. Please visit
https://github.com/nitefood/asn#ip-reputation-api-token
for instructions on how to enable it.
────────────────────────────────────────────────────────────

╭───────────────────────╮
│ ASN lookup for 206610 │
╰───────────────────────╯

AS Number ──────> 206610
AS Name ────────> MIXVOIP, LU
Organization ───> Mixvoip S.A.
AS Reg. date ───> 2016-12-13 08:28:07
Peering @ixps ──> DE-CIX Dusseldorf: DE-CIX Dusseldorf Peering LAN | DE-CIX Frankfurt: DE-CIX Frankfurt Peering LAN | ECIX-DUS | ECIX-FRA | France-IX Paris | LU-CIX

╭─────────────────────────────────────────────╮
│ BGP informations for AS206610 (MIXVOIP, LU) │
╰─────────────────────────────────────────────╯

Retrieving prefix allocations and announcements for AS206610 (MIXVOIP, LU) (press CTRL-C to cancel)...

╭────────────────────────────────────────────────────────────╮
│ Announced prefixes (aggregated) for AS206610 (MIXVOIP, LU) │
╰────────────────────────────────────────────────────────────╯

───── IPv4 ─────

NONE

───── IPv6 ─────

NONE

I've tested with many ASN and the result is the same.

I did not have this result few days ago...

Could you help me to solve this occur ?

Regards

CSV format

It's possible to get output as CSV/Xls ?

Permission denied for install

Hi, congrats on what looks like a great ASN lookup. I'd like to install this software but permission is denied @nitefood .

This is the error
image

Please can I access the file - can you share this? Thank you

upstream/transit

Each lookup is acknowledged with the error "/usr/bin/asn: line 2770: printf: 32.98889175923534: invalid number"

`asn -u 1.1.1.1

╭────────────────────────╮
│ ASN lookup for 1.1.1.1 │
╰────────────────────────╯

╭───────────────────────────────────────────────────╮
│ Recently observed upstream/transit AS for 1.1.1.1 │
╰───────────────────────────────────────────────────╯

Legend:
██ most likely transit ( very large / Tier 1 upstream AS )
██ very likely transit ( >= 85% BGP updates from this AS )
██ likely transit ( >= 75% BGP updates from this AS )
██ potentially transit ( >= 65% BGP updates from this AS )
██ unlikely transit ( < 65% BGP updates from this AS )

Target : 1.1.1.1 (matching prefix: 1.1.1.0/24)
Origin AS : [AS13335] CLOUDFLARENET, US
CAIDA AS rank: #78 TOP 100 AS

/usr/bin/asn: line 2770: printf: 32.98889175923534: invalid number
██ AS2914 ( 32,00%) - NTT-LTD-2914, US
/usr/bin/asn: line 2770: printf: 31.95556703694136: invalid number
██ AS24482 ( 31,00%) - SGGS-AS-AP SG.GS, SG
/usr/bin/asn: line 2770: printf: 31.077241022991476: invalid number
██ AS1031 ( 31,00%) - PEER-1-INTERNET, US
/usr/bin/asn: line 2770: printf: 0.7491604236631362: invalid number
██ AS7195 ( 0,00%) - EDGEUNO SAS, CO
/usr/bin/asn: line 2770: printf: 0.41332988891759237: invalid number
██ AS37468 ( 0,00%) - ANGOLA-CABLES, AO
/usr/bin/asn: line 2770: printf: 0.3874967708602428: invalid number
██ AS12779 ( 0,00%) - ITGATE, IT
/usr/bin/asn: line 2770: printf: 0.3358305347455438: invalid number
██ AS3257 ( 0,00%) - GTT-BACKBONE GTT, US`

Exciting News: 'asn' Tool Soon to be Included in Debian!

Hello everyone,

I'm stopping by to express my gratitude for the incredible work done on the "asn" tool. It is with immense joy that I share the news that soon this tool will be available in Debian.

The effort and dedication of the developers behind this project are truly remarkable, and this milestone is a testament to the excellent work done by all.

Please find more details about the inclusion of "asn" in Debian at:
Link to Debian page

Once again, congratulations to all involved for this great achievement!

Best regards,

Marcos Rodrigues de Carvalho (aka oday) [email protected]

Feature request: Add asn_lookup hyperlink for "Remaining IPs" and formatting changes

Love the new updates. Great idea having added the ability to just click on a hop for a new asn_lookup.

Can we do the same for the remaining IPs that get "ignored"? To avoid ambiguity, in this screenshot 172.217.1.174

asn

While I love this new feature, it does make the hop output a bit busy.
Can we remove the unscores from the hyperlinks and open the links in a new window (style="text-decoration: none;" and target="_blank" or something)?
I'm not sure aha supports that out of the box, so maybe a stylesheet?

My OCD is kicking in now, and the links to APIs seem inconsistent. Currently in the detailed ASN lookup top section we have

WHOIS, host.io and ipinfo.io

Can we change that to

whois, host and ipinfo (and without the chain link icon thing)

I don't mind doing this but as it's really esthetics and not functional, do feel free to tell me to naff off and get a life.

ASN number lookup output hurts my brain at the moment, but it's super rich.
Not sure how much sense it makes to do traceroutes to subnets, but maybe I'm missing something. I will spend more time playing with it soon.

Thanks again for this great tool

AS 45609 - parse error: Invalid numeric literal at line 1, column 7

This ASN has a large number of prefixes and I'm trying to get a list of just the IPv6's.
When I add an IP Reputation token, it's still running for over 30 mins on a 50 Mbit FTTH uplink.

$ asn 45609

────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭──────────────────────╮
│ ASN lookup for 45609 │
╰──────────────────────╯

 AS Number     ──> 45609
 AS Name       ──> BHARTI-MOBILITY-AS-AP Bharti Airtel Ltd. AS for GPRS Service, IN
 Organization  ──> Bharti Airtel Limited
 AS Reg. date  ──> 2017-08-10 02:29:43
 Peering @IXPs ──>  NONE 


╭─────────────────────────────────────────────────────────────────────────────────────────────────╮
│ BGP informations for AS45609 (BHARTI-MOBILITY-AS-AP Bharti Airtel Ltd. AS for GPRS Service, IN) │
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯

Retrieving BGP data for AS45609 (BHARTI-MOBILITY-AS-AP Bharti Airtel Ltd. AS for GPRS Service, IN) (press CTRL-C to cancel)...parse error: Invalid numeric literal at line 1, column 7
parse error: Invalid numeric literal at line 1, column 7
parse error: Invalid numeric literal at line 1, column 7
Retrieving prefix allocations and announcements for AS45609 (BHARTI-MOBILITY-AS-AP Bharti Airtel Ltd. AS for GPRS Service, IN) (press CTRL-C to cancel)...^CInterrupted by signal 2...

Hangs at `Analyzing collected trace output to …`

Today, asn hung at analyzing collected trace output.

$ git log --oneline --no-decorate -1
23b2d39 Minor tweaks
────────────────────────────────────────────────────────────
			WARNING 

No IPQualityScore token found, so disabling in-depth threat 
analysis and IP reputation lookups. Please visit 
https://github.com/nitefood/asn#ip-reputation-api-token 
for instructions on how to enable it. 
────────────────────────────────────────────────────────────

╭─────────────────────────────────╮
│ ASN lookup for www.tu-berlin.de │
╰─────────────────────────────────╯

- Resolving "www.tu-berlin.de"... 1 IP address found:

                                                                                                                                                      
 130.149.7.201 ┌PTR www.tu-berlin.de
               ├ASN 680 (DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE)
               ├ORG DFN
               ├NET 130.149.0.0/16 (TUB)
               ├ABU [email protected]
               ├ROA ✓ UNKNOWN (no ROAs found)
               ├GEO Berlin, Berlin (DE)
               └REP ✓ NONE


╭───────────────────────────╮
│ Trace to www.tu-berlin.de │
╰───────────────────────────╯

 Hop IP Address                                                                               Loss%      Ping avg     AS Information                  
  1. 10.31.96.1                                                                                  0%        2.7 ms    BOGON  rfc1918 (Private Space)   
  2. 10.31.251.254                                                                               0%        2.5 ms    BOGON  rfc1918 (Private Space)   
  3. 141.42.5.254                                                                                0%        2.7 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
  4. rouxwin-tg-3.charite.de (193.175.73.2)                                                      0%       15.2 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
  5. roubrain-tg-3.charite.de (193.175.73.3)                                                     0%        3.4 ms   [AS680] DFN Verein zur Foerderung eines Deutschen Forschungsnetzes e.V., DE
Analyzing collected trace output to 130.149.7.201 (press CTRL-C to cancel)...^C                                                                       
Interrupted

I had to cancel it with Ctrl + c.

$ mtr -s 10 -r -c 10 www.tu-berlin.de
Start: 2022-03-29T09:29:06+0200
HOST: ersatz                      Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- _gateway                   0.0%    10   62.4   8.3   1.8  62.4  19.0
  2.|-- 10.31.251.254              0.0%    10    2.0   2.0   1.8   3.2   0.4
  3.|-- 141.42.5.254               0.0%    10    2.6   2.5   2.1   3.5   0.4
  4.|-- rouxwin-tg-3.charite.de    0.0%    10    2.6   3.0   2.6   3.5   0.3
  5.|-- roubrain-tg-3.charite.de   0.0%    10    3.3   3.1   2.6   3.6   0.3
  6.|-- 192.86.163.97              0.0%    10    3.2   3.1   2.5   3.5   0.3
  7.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  8.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  9.|-- 130.149.126.189            0.0%    10    3.5   3.7   3.0   6.2   0.9
 10.|-- e-ns-e-n.gate.tu-berlin.d  0.0%    10    4.1   7.2   3.5  33.2   9.2
 11.|-- www.tu-berlin.de           0.0%    10    2.8   3.3   2.8   3.9   0.3
$ traceroute www.tu-berlin.de
traceroute to www.tu-berlin.de (130.149.7.201), 30 hops max, 60 byte packets
 1  _gateway (10.31.96.1)  1.886 ms  2.162 ms  2.556 ms
 2  10.31.251.254 (10.31.251.254)  2.802 ms  3.195 ms  3.180 ms
 3  rouxwin-tg-3.charite.de (193.175.73.2)  5.365 ms  4.705 ms  4.262 ms
 4  roubrain-tg-3.charite.de (193.175.73.3)  5.319 ms  5.305 ms  4.924 ms
 5  192.86.163.97 (192.86.163.97)  5.276 ms  5.669 ms  5.655 ms
 6  * * *
 7  * * *
 8  130.149.126.189 (130.149.126.189)  5.170 ms  5.466 ms  6.123 ms
 9  e-ns-e-n.gate.tu-berlin.de (130.149.126.78)  6.109 ms  6.094 ms  6.080 ms
10  www.tu-berlin.de (130.149.7.201)  6.395 ms  7.051 ms  6.366 ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.