Skip to main content

Python client for detect.expert DNS checking service with Cloudflare bypass

Project description

Detect Expert DNS Check Client

Python 3.10+ Docker License: MIT

Python client for detect.expert DNS checking service.

Key feature: Bypasses Cloudflare protection using TLS fingerprinting — no browser required!

Works where requests and httpx fail — passes Cloudflare's bot detection by impersonating Chrome's TLS handshake.

Features

  • Cloudflare Bypass — Uses tls-client to impersonate Chrome TLS fingerprint
  • Fast Pagination — Fetches all pages with progress indicator and smart retry logic
  • Full Data — Extracts IP, provider, country, region, and city
  • CLI Tool — Command-line interface with real-time progress
  • Export — JSON, CSV, or plain IP list

Installation

pip install detect-expert-client

Or install from source:

git clone https://github.com/mazamaka/detect-expert-client.git
cd detect-expert-client
pip install -e .

Docker

Pull and run with Docker — no Python installation needed:

# Pull latest image
docker pull mazamaka/detect-expert-client:latest

# Run DNS check
docker run --rm mazamaka/detect-expert-client \
  -e your@email.com -p your_password \
  check 8.8.8.8

# Save results to local file
docker run --rm -v $(pwd):/data mazamaka/detect-expert-client \
  -e your@email.com -p your_password \
  check 8.8.8.8 -o /data/results.json

# View check history
docker run --rm mazamaka/detect-expert-client \
  -e your@email.com -p your_password \
  history

Build from source:

docker build -t detect-expert-client .
docker run --rm detect-expert-client --help

Quick Start

Set Credentials

export DETECT_EXPERT_EMAIL="your@email.com"
export DETECT_EXPERT_PASSWORD="your_password"

Run New DNS Check (All Pages)

# Full check - fetches ALL pages automatically
detect-expert check 8.8.8.8 -o results.json

# With longer wait for large checks
detect-expert check 8.8.8.8 -o results.json --wait 10

Fetch Only First Page (Quick Preview)

# Only first 100 records
detect-expert check 8.8.8.8 --max-pages 1 -o preview.json

Fetch Existing Check Results

# Re-download results from previous check (no cost)
detect-expert fetch <check_id> <session_id> -o results.json

# Example:
detect-expert fetch cddec0733d6d4c9cb5f121483101435e 90ccc3317d6641b3ae17031211b7f5f2 -o results.json

Other Commands

# View check history
detect-expert history

# Export as IP list only
detect-expert check 1.1.1.1 -o ips.txt -f ips

# Export as CSV
detect-expert check 1.1.1.1 -o data.csv -f csv

Example Output

$ detect-expert check 8.8.8.8 -o results.json

🔐 Logging in as user@example.com...
✅ Authenticated. Balance: $49.25

📤 Starting DNS check for 8.8.8.8...
   📄 Page 15/21 | 1500 records

✅ Found 2099 DNS records
   URL: https://detect.expert/dnscheck/abc123/def456

📊 Top providers:
   Google LLC: 2099

📋 Sample records:
   8.8.8.8 - Google LLC
   8.8.4.4 - Google LLC
   35.186.235.154 - Google LLC
   ... and 2089 more

💾 Saved to results.json

JSON Output Structure

{
  "check_id": "84d34ccc84f14e1587dbacbf980703dd",
  "session_id": "984ff4f30ec64e8da47c2097d0daa56c",
  "ip_checked": "8.8.8.8",
  "url": "https://detect.expert/dnscheck/84d34ccc.../984ff4f3...",
  "total_records": 2099,
  "records": [
    {
      "ip": "8.8.8.8",
      "provider": "Google LLC",
      "country": "United States",
      "region": "CA",
      "city": "Mountain View"
    },
    {
      "ip": "35.186.235.154",
      "provider": "Google LLC",
      "country": "United States",
      "region": "MO",
      "city": "Kansas City"
    }
  ],
  "providers": {
    "Google LLC": 2099
  },
  "created_at": "2025-01-01T23:30:00.000000"
}

Python API

from detect_expert import DetectExpertClient

# Create client and login
client = DetectExpertClient()
client.login("your@email.com", "your_password")

# Run DNS check (fetches all pages)
result = client.check_dns("8.8.8.8")

print(f"Total DNS records: {result.total_records}")
print(f"Unique IPs: {len(result.unique_ips)}")

for record in result.records[:5]:
    print(f"{record.ip} | {record.provider} | {record.city}, {record.region}")

Fetch with Progress Callback

def on_progress(page: int, total_records: int, total_pages: int | None):
    if total_pages:
        print(f"Page {page}/{total_pages}: {total_records} records")
    else:
        print(f"Page {page}: {total_records} records")

# Fetch results with progress
records = list(client.fetch_results(
    check_id="abc123",
    session_id="def456",
    on_page=on_progress,
))

API Reference

Method Description
login(email, password) Authenticate with detect.expert
check_dns(ip, ...) Run DNS check for IP address
fetch_results(check_id, session_id, ...) Fetch results from existing check
get_history(limit=10) Get check history

check_dns() Parameters

result = client.check_dns(
    ip_address="8.8.8.8",   # IP to check
    wait_seconds=3.0,       # Wait before fetching (default: 3)
    fetch_results=True,     # Auto-fetch results (default: True)
    max_pages=300,          # Max pages to fetch (default: 300)
    page_delay=0.1,         # Delay between pages (default: 0.1)
)

fetch_results() Parameters

records = client.fetch_results(
    check_id="abc123",
    session_id="def456",
    max_pages=300,          # Max pages (default: 300)
    delay=0.1,              # Delay between pages (default: 0.1)
    retry_delay=1.0,        # Retry delay for pending pages (default: 1.0)
    max_retries=15,         # Max retries per page (default: 15)
    on_page=callback,       # Progress callback (optional)
)

CLI Options

detect-expert check <IP> [OPTIONS]
  -o, --output FILE     Save results to file
  -f, --format FORMAT   Output format: json, ips, csv (default: json)
  --wait SECONDS        Wait time after check (default: 3)
  --max-pages N         Max pages to fetch (default: 300)
  --delay SECONDS       Delay between requests (default: 0.1)
  -q, --quiet           Quiet mode

detect-expert fetch <CHECK_ID> <SESSION_ID> [OPTIONS]
  -o, --output FILE     Save results to file
  -f, --format FORMAT   Output format: json, ips, csv
  --max-pages N         Max pages to fetch
  --delay SECONDS       Delay between requests

detect-expert history
  -l, --limit N         Max items to show (default: 10)

How It Works

Why This Works

Standard HTTP libraries (requests, httpx, aiohttp) fail against Cloudflare because their TLS fingerprint doesn't match any known browser. Cloudflare blocks them with 403/503 errors.

This client uses tls-client which:

  • Impersonates Chrome's exact TLS handshake (cipher suites, extensions, ALPN)
  • Passes Cloudflare's JA3/JA4 fingerprint checks
  • No Selenium, Playwright, or browser automation needed
requests/httpx ────────────> [Cloudflare] ❌ 403 Forbidden

detect-expert-client ──────> [Cloudflare] ✅ Pass ──> [detect.expert]
    └── Chrome TLS fingerprint

Technical Details

  1. TLS Fingerprinting: Impersonates chrome_131 TLS profile
  2. CSRF Handling: Extracts tokens from forms and cookies for Django backend
  3. Smart Pagination: Retries pages returning "retry" status (check still processing)
  4. Progress Tracking: Detects total pages from pagination links

Requirements

  • Python 3.10+
  • tls-client >= 1.0.0
  • detect.expert account with balance

What is DNS Check?

DNS check on detect.expert shows all DNS resolvers that have queried your IP address. This reveals:

  • VPN/Proxy detection — If DNS requests come from different IPs than the connection IP
  • ISP information — Provider names, geographic locations of DNS servers
  • DNS leak detection — Shows if your real DNS servers are exposed

The service sends a unique DNS query to your IP and logs all resolvers that look it up.

Pricing

Each DNS check costs $0.15 on detect.expert. Fetching existing results is free.

Links

License

MIT License - see LICENSE file.

Disclaimer

This tool is for educational and authorized testing purposes only. The author is not responsible for any misuse. Make sure you comply with detect.expert's Terms of Service.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

detect_expert_client-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

detect_expert_client-1.0.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file detect_expert_client-1.0.0.tar.gz.

File metadata

  • Download URL: detect_expert_client-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.10

File hashes

Hashes for detect_expert_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b12c2de41b1d0363c2fcf8604ef945c15c678c0cb70610072c4f0c45b800381c
MD5 24cec7069ac26452320d4b5a2eeba139
BLAKE2b-256 247776ae0e3757efd8a4422fba7f6f621aad8c12cc93efe4e0922a5456110f35

See more details on using hashes here.

File details

Details for the file detect_expert_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for detect_expert_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2978cc92653f8187f6091a4f5e7362a47c965eab85783c316205dee581f70cae
MD5 d341cac5d68408e21d921722e1efb52b
BLAKE2b-256 b153bb27805faa08d1ddada7212f95b09ee9dabd93a394d94c2e6af6e2273527

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page