DC/VPN/Proxy/Tor IP detection engine — 30+ sources, binary search, full geo enrichment
Project description
🛡 TeamDev DCBlock v2.0
Supercharged DC / VPN / Proxy / Tor IP detection engine
30+ CIDR sources · Binary-search O(log n) · Full geo enrichment · Multi-platform
Features
- 30+ sources — AWS, GCP, Azure, Hetzner, OVH, Heroku, Render, Railway, GitHub, Tor, Spamhaus, and more
- Fallback CIDRs — works offline with bundled ranges when fetch fails
- Full enrichment — org, ISP, ASN, city, region, country, lat/lon, reverse DNS, risk score
- Zero 404 errors — fixed Azure/firehol/vultr URLs, fallback-first approach
- Fast — binary-search lookup handles 500k+ CIDRs in microseconds
- Multi-platform — CLI, FastAPI, Flask, Django, Telegram Bot, Website
Install
pip install -r requirements.txt
CLI Usage
# Check one IP (card view)
python3 cli/dcblock_cli.py check 3.108.66.217
# Check multiple (table view)
python3 cli/dcblock_cli.py check 1.2.3.4 8.8.8.8 45.33.32.156
# Check from file
python3 cli/dcblock_cli.py batch ips.txt
# JSON output + save
python3 cli/dcblock_cli.py check 1.2.3.4 --json --out result.json
# Force refresh all lists
python3 cli/dcblock_cli.py update
# Show stats
python3 cli/dcblock_cli.py stats
# Disable enrichment (faster, CIDR-only)
python3 cli/dcblock_cli.py check 1.2.3.4 --no-enrich
Python Module
from dcblock import DatacenterBlocker
blocker = DatacenterBlocker(enrich_asn=True).load()
result = blocker.check("3.108.66.217")
print(result.status_label()) # DATACENTER / CLEAN / TOR / PROXY / VPN
print(result.to_dict()) # Full JSON-serializable dict
# Bulk check
results = blocker.check_bulk(["1.2.3.4", "8.8.8.8"])
# Async bulk
import asyncio
results = asyncio.run(blocker.async_check_bulk(["1.2.3.4", "8.8.8.8"]))
FastAPI
from dcblock import DatacenterBlocker, make_fastapi_middleware
from fastapi import FastAPI
blocker = DatacenterBlocker().load()
app = FastAPI()
app.add_middleware(make_fastapi_middleware(blocker))
Run: uvicorn examples.fastapi_app:app --reload
Endpoints: GET /check/{ip} · POST /check/bulk · GET /stats
Flask
from dcblock import DatacenterBlocker, make_flask_middleware
from flask import Flask
blocker = DatacenterBlocker().load()
app = make_flask_middleware(Flask(__name__), blocker)
Django
from dcblock import DatacenterBlocker, make_django_middleware
blocker = DatacenterBlocker().load()
DatacenterMiddleware = make_django_middleware(blocker)
# In settings.py
MIDDLEWARE = ["myapp.middleware.DatacenterMiddleware", ...]
Telegram Bot
pip install pyTelegramBotAPI
# Set BOT_TOKEN in examples/telegram_bot.py
python3 examples/telegram_bot.py
Commands: /check 1.2.3.4 · /bulk 1.2.3.4 8.8.8.8 · /stats
Website
Open examples/website.html in browser with FastAPI running at localhost:8000.
Docker
docker-compose up -d
# API at http://localhost:8000
CheckResult fields
| Field | Type | Description |
|---|---|---|
ip |
str | Input IP |
is_datacenter |
bool | Blocked or not |
status_label() |
str | CLEAN / DATACENTER / PROXY / VPN / TOR / HOSTING |
reason |
str | cidr_match / proxy / hosting_flag / asn_keyword / tor |
source |
str | Which source list matched |
org |
str | Organization name |
isp |
str | ISP name |
asn |
str | ASN name |
asn_number |
str | ASN number (e.g. AS16509) |
country |
str | Country name |
country_code |
str | 2-letter code |
city |
str | City |
region |
str | Region/state |
latitude |
float | Geo latitude |
longitude |
float | Geo longitude |
reverse_dns |
str | rDNS hostname |
risk_score |
int | 0–100 risk score |
tags |
list | Labels like ["proxy", "hosting"] |
is_tor |
bool | Tor exit node |
is_proxy |
bool | Proxy detected |
is_vpn |
bool | VPN detected |
is_hosting |
bool | Hosting flag |
checked_at |
float | Unix timestamp |
Sources (30+)
| Provider | Category |
|---|---|
| Amazon AWS | cloud |
| Google Cloud | cloud |
| Microsoft Azure | cloud |
| DigitalOcean | cloud |
| Vultr | cloud |
| Oracle Cloud | cloud |
| Linode/Akamai | cloud |
| Hetzner | cloud |
| OVH | cloud |
| Contabo | cloud |
| Leaseweb | cloud |
| IBM Cloud | cloud |
| Alibaba Cloud | cloud |
| Tencent Cloud | cloud |
| Huawei Cloud | cloud |
| Scaleway | cloud |
| Cloudflare IPv4/v6 | cdn |
| Fastly | cdn |
| Heroku | paas |
| Render.com | paas |
| Railway.app | paas |
| Vercel | paas |
| Netlify | paas |
| GitHub Actions | devops |
| M247 / VPN Hosting | vpn_hosting |
| Choopa | cloud |
| ColoCrossing | cloud |
| Tor Exit Nodes | anonymizer |
| Spamhaus DROP | abuse |
TeamDev · @MR_ARMAN_08 · Support: @TEAM_X_OG
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teamdev_dcblock-2.0.0.tar.gz.
File metadata
- Download URL: teamdev_dcblock-2.0.0.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d83c4c5de91c464dc87261dab35e9127c2169bf409ff55c24f63bef38810bd74
|
|
| MD5 |
5ff12d561ef21771b721dd24075573df
|
|
| BLAKE2b-256 |
f507ef6a5945e309003f2c22fba65c032618a58390cdd99e0d8393a5d7d34a7e
|
File details
Details for the file teamdev_dcblock-2.0.0-py3-none-any.whl.
File metadata
- Download URL: teamdev_dcblock-2.0.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a8d06b2c199db6561f3ada67f8435bee8c000b5e6955aed74309daafd4bc280
|
|
| MD5 |
1f5a3ae6da7078939f37adff02aacf67
|
|
| BLAKE2b-256 |
5ba255f28f74bbb5b81773933a2134ae19f02cefee6f21dc7e8b2c3630f6125a
|