Project Icon

asn

全面的网络情报与路由分析工具

ASN是一款综合性网络情报和路由分析工具,具备AS信息查询、IP地理定位、BGP路径追踪和IP信誉评估等功能。支持命令行、Web服务器和API多种使用方式,兼容多种操作系统和容器环境。通过整合权威数据源,ASN能快速提供全面的网络和IP信息,适用于网络安全分析和事件响应等场景。

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)
    • BGP incident history (number of BGP hijacks and route leaks involving the target AS in the past 12 months, as a victim or a hijacker)
    • 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 and incident history, 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:

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号