Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Host Checker

Mass HTTP host checker — test hundreds of hosts in seconds. Inspired by the Host Checker tool in HTTP Injector.

Python License

Check multiple hosts concurrently, see which ones are live (with or without response data), detect CDN/provider from 3 signals (CNAME, HTTP headers, IP→ASN), and export results to CSV. Works on Windows, Linux, macOS, and Android (Termux).


Features

  • Mass host checking — bulk test hundreds of hostnames at once
  • Concurrent requests — uses asyncio + aiohttp for fast parallel checks
  • Live/Dead classification
    • Live (with data) — 2xx/3xx response with non-empty body
    • Live (no data) — 2xx/3xx response with empty body (use -m HEAD)
    • Dead — 4xx/5xx, timeout, or connection error
  • Request methods — GET, HEAD, and CONNECT (HTTP Injector-style)
  • Raw Server header — shows the unmodified Server: response header value
  • Multi-signal CDN detection — identifies what's fronting the host (headers + CNAME) and who owns the IP network (ASN/RDAP) as two separate facts:
    1. CNAME chain — resolves full DNS CNAME chain against 40+ CDN edge domains (*.cloudflare.net, *.akamaiedge.net, *.cloudfront.net, etc.) — contributes to cdn: score
    2. HTTP header fingerprints — matches 50+ CDN-specific headers (cf-ray, x-amz-cf-id, x-akamai-*, x-slb-*, etc.) — contributes to cdn: score
    3. IP→ASN/RDAP — resolves IP, looks up ASN + org via RDAP against 35+ CDN networks — shown as separate owner: field
  • Smart fallback — ASN/RDAP runs automatically when cdn: signals are weak (< 30 confidence), so you're never silently blind
  • --deep flag — force ASN/RDAP on every host (not just as fallback) for maximum accuracy
  • Separate cdn: and owner: fieldscdn: shows what's actually serving the response (headers + CNAME). owner: shows who owns the IP network (ASN). Only shown separately when they differ — if Cloudflare is detected by both headers and ASN, you see cdn: Cloudflare once.
  • Confidence score — shows how confident the detection is (0–99%)
  • Proxy support — route through any proxy like HTTP Injector (-p ip:port)
  • Color-coded output — green (live), yellow (no data), red (dead)
  • CSV export — save results with server, cdn, and network_owner as separate columns

Installation

Prerequisites

  • Python 3.8 or higher
  • pip

Quick Install

git clone https://github.com/your-username/host-checker.git
cd host-checker
pip install -r requirements.txt

Android (Termux)

pkg install python git
git clone https://github.com/your-username/host-checker.git
cd host-checker
pip install -r requirements.txt

Usage Guide

Quick Start

python run.py hosts.txt

This checks every hostname in hosts.txt using GET requests and shows which are live/dead with server header and CDN info.

Command Options

Argument Description
hosts Path to hosts file (one per line), or - for stdin
-m, --method Request method: GET, HEAD, CONNECT (default: GET)
-t, --timeout Timeout per host in seconds (default: 10)
-c, --concurrent Max concurrent checks (default: 50)
-p, --proxy Proxy to route through. Format: ip:port or user:pass@host:port
--deep Enable IP→ASN RDAP lookups for every host (slower, more accurate)
-o, --output Export results to a CSV file
--no-color Disable colored output

Usage Scenarios

1. Basic Mass Host Checking

python run.py hosts.txt

2. Zero-Data Host Checking (like HTTP Injector)

Use -m HEAD to only fetch headers — no data downloaded:

python run.py hosts.txt -m HEAD

3. Mass Check with a Proxy

Just like HTTP Injector — use -p ip:port (no http:// needed):

python run.py hosts.txt -m HEAD -p your-proxy.com:3128

4. CDN Detection — Fast Mode (default)

Headers + CNAME are always checked. ASN/RDAP runs automatically when those are weak:

python run.py hosts.txt -m HEAD

5. CDN Detection — Deep Mode (slow, max accuracy)

Forces IP→ASN/RDAP lookup on every host:

python run.py hosts.txt -m HEAD --deep

6. Speed Tuning

# Fast: 100 concurrent, 5s timeout
python run.py hosts.txt -m HEAD -t 5 -c 100

# Thorough: 10 concurrent, 30s timeout
python run.py hosts.txt -t 30 -c 10

7. Saving Results

python run.py hosts.txt -m HEAD -o results.csv

8. Pipe from Another Command

cat my-hosts.txt | python run.py - -m HEAD

Input File Format

# Lines starting with # are ignored
google.com
github.com
stackoverflow.com
httpbin.org/status/200
# Full URLs also work:
https://example.com
http://example.org

Hosts can be bare domain names or full URLs. HTTPS is tried first, with automatic HTTP fallback when using a proxy.


How CDN Detection Works

The tool produces two separate facts, not one merged score:

cdn: — What's serving the response (headers + CNAME)

# Signal What it checks Weight
1 CNAME chain Resolves the full DNS CNAME chain and checks each hop against known edge domains (*.cloudflare.net, *.akamaiedge.net, *.cloudfront.net, etc.) 50
2 HTTP headers Checks response headers for CDN-specific fingerprints (cf-ray → Cloudflare, x-amz-cf-id → CloudFront, x-slb- → Alibaba, etc.) 15–40

These two signals are evidence taken directly from the HTTP response — they tell you what's actually fronting the host.

owner: — Who owns the IP network (ASN/RDAP)

# Signal What it checks Weight
3 IP→ASN / RDAP Resolves the IP address, looks up the ASN and organisation name, matches against known CDN networks 30

This is a separate fact — who owns the IP block. It's only shown when it differs from cdn: (e.g. GitHub Pages fronted by GitHub, but the IP is owned by Microsoft/Azure).

When ASN runs

  • Fast mode (default): ASN runs automatically when cdn: confidence < 30 (fallback so you're never blind). Skipped for hosts already confidently identified.
  • Deep mode (--deep): ASN runs on every host regardless of cdn: confidence.

Sample Output

Without --deep (fast mode)

   +------------------------------------+
   |      Host Checker v2.0             |
   |  Mass HTTP Host Checker Tool       |
   +------------------------------------+

  Method: HEAD  |  Timeout: 5s  |  Concurrent: 50  |  Hosts: 6

=== Host Check Results ===
  * Live (data): 0  * Live (empty): 5  * Dead: 1  | Total: 6

  -- LIVE - NO DATA --

    > google.com  [200]  279ms | 0 B
      |- server: gws | owner: Google Cloud (50%)
    > alibaba.com  [200]  1.4s | 0 B
      |- server: Tengine | cdn: Alibaba Cloud (15%)
    > www.qwencloud.com  [200]  106ms | 0 B
      |- server: ESA | cdn: Alibaba Cloud (25%)
    > example.com  [200]  81ms | 0 B
      |- server: cloudflare | cdn: Cloudflare (99%)
    > github.com  [200]  210ms | 0 B
      |- server: github.com | cdn: GitHub Pages (20%) | owner: Azure (Microsoft) (60%)

  -- DEAD --

    > stackoverflow.com  [403]  56ms | 0 B
      |- server: cloudflare | cdn: Cloudflare (60%)

--- Done - 6 hosts checked ---

With --deep (ASN on every host)

  Method: HEAD  |  Timeout: 5s  |  Concurrent: 50  |  Hosts: 4  Deep: ON

=== Host Check Results ===
  * Live (data): 0  * Live (empty): 4  * Dead: 0  | Total: 4

  -- LIVE - NO DATA --
    > google.com  [200]  306ms | 0 B
      |- server: gws | owner: Google Cloud (50%)
    > alibaba.com  [200]  1.4s | 0 B
      |- server: Tengine | cdn: Alibaba Cloud (15%)
    > example.com  [200]  76ms | 0 B
      |- server: cloudflare | cdn: Cloudflare (99%)
    > github.com  [200]  199ms | 0 B
      |- server: github.com | cdn: GitHub Pages (20%) | owner: Azure (Microsoft) (60%)

CDN Detection: Fast vs Deep

Mode Command ASN/RDAP runs when Data usage
Fast (default) python run.py hosts.txt Only when headers + CNAME < 30 confidence Low
Deep python run.py hosts.txt --deep On every host Higher (1 RDAP req/host)

When to use each mode:

  • Fast mode — daily mass checks of 50+ hosts. Quickly identifies Cloudflare, CloudFront, Akamai, etc. from headers. Falls back to ASN for unidentified hosts so you're never blind.
  • Deep mode — when you want maximum accuracy for fewer hosts. Forces ASN on every host regardless of cdn: confidence.

CSV Export

host,status,response_time_ms,content_length,server,cdn,cdn_confidence,network_owner,network_owner_confidence,category,error,body_snippet
google.com,200,279.0,0,gws,Unknown,0,Google Cloud,50,LIVE (no data),,
alibaba.com,200,1400.0,0,Tengine,Alibaba Cloud,15,,,LIVE (no data),,
example.com,200,81.0,0,cloudflare,Cloudflare,99,,,LIVE (no data),,
github.com,200,210.0,0,github.com,GitHub Pages,20,Azure (Microsoft),60,LIVE (no data),,
stackoverflow.com,403,56.0,0,cloudflare,Cloudflare,60,,,DEAD,,

Practical Examples (for HTTP Injector Users)

What you want Command
Basic host check python run.py hosts.txt
Zero-data check (no download) python run.py hosts.txt -m HEAD
Check through a proxy python run.py hosts.txt -p 127.0.0.1:3128
Check with proxy + CDN deep scan python run.py hosts.txt -p 127.0.0.1:3128 --deep
See raw server header only python run.py hosts.txt -m HEAD
Save results as CSV python run.py hosts.txt -o results.csv
Fast mass scan (100 concurrent) python run.py hosts.txt -m HEAD -t 5 -c 100

Use Cases

  • Finding working hosts for HTTP Injector / VPN configs
  • Bug host hunting — discover zero-rated or unblocked hosts on your ISP
  • Proxy checking — test proxy hosts with CONNECT method
  • CDN detection — identify what CDN/provider fronts each host
  • Network diagnostics — see which hosts are reachable from your network

License

MIT License — see LICENSE for details.


Disclaimer

This tool is for educational and legitimate network testing purposes only. Users are responsible for complying with applicable laws and terms of service. The authors are not liable for any misuse.

About

Mass host checker for hunting bug hosts and zero-rated hosts on mobile ISPs (HTTP Injector-style). Tests hundreds of hosts concurrently, flags live/dead + zero-data responses, and fingerprints CDN/provider via headers, CNAME, and ASN.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages