$ show xykt/IPQuality
IPQuality is a comprehensive bash-based CLI tool for evaluating the quality and risk profile of an IP address. It performs geolocation lookups (via Maxmind and IPinfo), IP type classification (ISP, hosting, business, etc.), risk scoring from multiple threat intelligence providers (AbuseIPDB, IP2Location, IPQS, Scamalytics, etc.), streaming media unlock detection (TikTok, Disney+, Netflix, YouTube, Amazon Prime Video, Reddit, ChatGPT), email service connectivity tests (Gmail, Outlook, Yahoo, etc.), and DNS blacklist checks against 400+ databases. The script is designed for VPS owners and network administrators to quickly assess whether an IP is clean, blocked, or associated with proxies/VPNs. It supports dual-stack IPv4/IPv6, multiple operating systems, Docker, and various output formats (ANSI, JSON, plain text). The architecture is a single monolithic bash script (~78000 tokens) with modular functions, progress bars, and extensive error handling. While not a reusable library, it demonstrates advanced bash scripting patterns for network diagnostics.
The LLM identified 3 files worth highlighting for reuse:
The `check_dnsbl_parallel` function performs parallel DNS lookups against a list of 400+ DNSBL servers using `xargs -P`. It reverses the IP octets, queries each blacklist domain, and categorizes results as Clean, Blacklisted, or Other. This pattern is reusable for any batch DNS-based checks in bash and demonstrates efficient concurrency without external tools.
The `MediaUnlockTest_TikTok`, `MediaUnlockTest_DisneyPlus`, `MediaUnlockTest_Netflix`, etc., functions implement HTTP-based probes to determine if a streaming service is accessible from the IP. They use DNS checks, HTTP requests with custom headers, and response parsing to infer unlock status and region. While tightly coupled to the script's global state, the logic for each service is self-contained and could be extracted for use in other network testing tools.
The `save_json` function constructs a structured JSON report from the script's associative arrays using `jq` pipelines. It handles boolean, string, and null values, and includes nested objects for Head, Info, Type, Score, Factor, Media, and Mail. This pattern demonstrates how to build complex JSON from bash variables and is reusable for any script that needs to output structured data.