⚠️ Commercial Use Notice: This software is licensed under AGPL-3.0 with additional commercial use restrictions. Commercial use requires explicit written permission. See LICENSE for details.
- 🔒 Privacy-first: No tracking, no ads, no analytics
- 🛡️ Security-focused: Comprehensive security headers, input validation
- 🌐 IPv4 & IPv6: Full support for both IP versions
- 📊 Detailed Information: IP details (multiple formats), ASN lookup, network information, organization details from all 5 RIRs
- 🎨 Modern UI: Beautiful dark theme, responsive design, one-click IP copy
- ⚡ Fast: Built with Rust for performance
- 🔧 Easy Setup: Simple configuration, Docker-ready
- 📡 Cloudflare Integration: Reads client IP from Cloudflare headers (CF-Connecting-IP)
- 🌍 Cloudflare Worker Headers: Supports extended Cloudflare Worker headers (X-CF-Country, X-CF-City, X-CF-ASN, X-CF-Trust-Score, etc.)
- 🔒 XSS Protection: All Cloudflare header values are sanitized before HTML rendering
- 🗄️ Local ASN Database: Uses ip2asn-based binary database (
asn_db.bin) - 🏢 Multi-RIR Organization Data: Organization details from all 5 RIRs (RIPE, APNIC, LACNIC, AFRINIC, ARIN)
- 🔍 Reverse DNS Lookup: Client-side reverse DNS (PTR) lookup using Cloudflare DNS over HTTPS (DoH) - only on user interaction
- 🌐 ISP Hint Detection: Client-side authoritative NS lookup to identify ISP/provider from nameserver hostnames
- Rust (stable, e.g. 1.80+)
- Linux / macOS
curl,gunzip(for gzip package)
📖 Detailed Installation Guide: See INSTALL.md for comprehensive installation instructions, troubleshooting, and manual setup.
# Download and run the installation script
curl -fsSL https://raw.githubusercontent.com/drmckay/cloakprobe/main/install.sh | sudo bash
# Download ASN database
sudo /opt/cloakprobe/scripts/update_asn_db.sh
# Start the service
sudo systemctl start cloakprobe
# Check status
sudo systemctl status cloakprobegit clone https://github.com/drmckay/cloakprobe.git
cd cloakprobe
# Build
cargo build --release
# Generate IP→ASN database
./scripts/update_asn_db.sh
# Run locally
CLOAKPROBE_PRIVACY_MODE=strict \
CLOAKPROBE_ASN_DB_PATH=./data/asn_db.bin \
CLOAKPROBE_REGION=eu-central \
./target/release/cloakprobeDefault address: 0.0.0.0:8080.
The installation script automatically sets up a systemd service. Manual setup:
# Copy service file
sudo cp cloakprobe.service /etc/systemd/system/
# Edit paths if needed
sudo nano /etc/systemd/system/cloakprobe.service
# Reload systemd
sudo systemctl daemon-reload
# Enable and start
sudo systemctl enable cloakprobe
sudo systemctl start cloakprobeCloakProbe uses a TOML configuration file for clean, organized settings. Environment variables can override config file values for container deployments.
Copy the example config and customize:
cp cloakprobe.example.toml cloakprobe.tomlConfig file locations (in order of priority):
- Path specified with
-c/--configargument ./cloakprobe.toml(current directory)/etc/cloakprobe/cloakprobe.toml(system-wide)
Example configuration:
[server]
bind_address = "0.0.0.0"
port = 8080
mode = "cloudflare" # "cloudflare" or "nginx"
region = "eu-central" # optional
[privacy]
mode = "strict" # "strict" or "balanced"
[database]
asn_db_path = "data/asn_db.bin"
org_db_path = "data/orgs_db.bin"cloudflare: TrustCF-Connecting-IPheader (default). Use when running behind Cloudflare CDN.nginx: TrustX-Real-IPandX-Forwarded-Forheaders. Use when running behind nginx or other standard reverse proxies without Cloudflare.
cloakprobe [OPTIONS]
OPTIONS:
-c, --config <PATH> Path to configuration file (TOML)
-h, --help Print help information
-v, --version Print version informationEnvironment variables override TOML config values (useful for containers):
CLOAKPROBE_BIND_ADDRESS: IP address to bind toCLOAKPROBE_PORT: Port numberCLOAKPROBE_MODE: Proxy mode (cloudflareornginx)CLOAKPROBE_REGION: Server region identifierCLOAKPROBE_PRIVACY_MODE: Privacy mode (strictorbalanced)CLOAKPROBE_ASN_DB_PATH: Path to ASN databaseCLOAKPROBE_ORG_DB_PATH: Path to multi-RIR organization database
Note: If database paths are not specified, CloakProbe will automatically search for databases in the data/ directory.
GET /– HTML UI (dark card-based view with detailed IP information)GET /privacy– Privacy Policy page (GDPR and CCPA compliant)GET /api/v1/json– JSON debug infoGET /api/v1/plain– Plain text output, convenient for CLIGET /healthz– Health check, returns{"status":"ok"}
CloakProbe uses two databases:
Uses the ip2asn-combined.tsv.gz database from iptoasn.com (Public Domain / PDDL).
- Format:
range_start range_end AS_number country_code AS_description - Contains both IPv4 and IPv6 ranges.
- Script:
scripts/update_asn_db.sh - Output:
data/asn_db.bin
Uses data from all 5 Regional Internet Registries (RIRs) to map ASN → Organization details.
- Sources: RIPE, APNIC, LACNIC, AFRINIC (RPSL format), ARIN (delegated stats fallback)
- Data: org_id, org_name, country, RIR, org_type, abuse_contact, last_updated
- Script:
scripts/update_org_db.sh - Output:
data/orgs_db.bin
cd /opt/cloakprobe
cargo build --release
# Update ASN database (IP ranges)
./scripts/update_asn_db.sh
# Update multi-RIR organization database
./scripts/update_org_db.shThen:
# Databases will be automatically found in ./data/ if environment variables are not set
CLOAKPROBE_PRIVACY_MODE=strict \
./target/release/cloakprobeOr explicitly specify database paths:
CLOAKPROBE_ASN_DB_PATH=/opt/cloakprobe/data/asn_db.bin \
CLOAKPROBE_ORG_DB_PATH=/opt/cloakprobe/data/orgs_db.bin \
CLOAKPROBE_PRIVACY_MODE=strict \
./target/release/cloakprobe# Update ASN database daily at 3:00 AM
0 3 * * * /opt/cloakprobe/scripts/update_asn_db.sh >> /var/log/cloakprobe-asn-update.log 2>&1
# Update multi-RIR organization database weekly on Sunday at 4:00 AM
0 4 * * 0 /opt/cloakprobe/scripts/update_org_db.sh >> /var/log/cloakprobe-org-update.log 2>&1📖 Detailed Nginx Guide: See docs/nginx-deployment.md for comprehensive nginx configurations including security hardening, Cloudflare IP restrictions, and dual-stack detection setup.
CloakProbe supports two proxy modes:
| Mode | Use Case | Trusted Header |
|---|---|---|
cloudflare |
Behind Cloudflare CDN | CF-Connecting-IP |
nginx |
Direct nginx (no CF) | X-Real-IP |
Basic nginx config:
server {
listen 443 ssl http2;
server_name ip.example.com;
ssl_certificate /etc/letsencrypt/live/ip.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ip.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
# IMPORTANT: Always use $remote_addr to prevent IP spoofing
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
}
}Never use $proxy_add_x_forwarded_for - it appends to existing headers, allowing IP spoofing. Always use $remote_addr.
For Cloudflare deployments, restrict connections to Cloudflare IPs only. See docs/nginx-deployment.md for the full security configuration.
For IPv4/IPv6 network capability detection, deploy multiple instances:
ip.example.com- Primary (Cloudflare, dual-stack)ip4.example.com- IPv4-only (A record only)ip6.example.com- IPv6-only (AAAA record only, no Cloudflare)
See docs/nginx-deployment.md for complete setup instructions
The app sets the following HTTP headers on every response:
Content-Security-PolicyReferrer-PolicyX-Frame-OptionsStrict-Transport-SecurityX-Content-Type-OptionsPermissions-Policy
No external scripts, fonts, or analytics sources; all assets come from the same domain. The only external connection allowed is to cloudflare-dns.com for the optional client-side reverse DNS lookup feature (only when user explicitly clicks the lookup button).
All Cloudflare header values are sanitized before being rendered in HTML to prevent XSS (Cross-Site Scripting) attacks. HTML special characters (<, >, &, ", ', /) are automatically escaped, ensuring that malicious header values cannot inject JavaScript or HTML into the page.
CloakProbe includes a comprehensive Privacy Policy page (/privacy) that is GDPR and CCPA compliant. The policy explains:
- What data is collected and processed
- How data is handled (no disk storage, no logging in strict mode)
- Cloudflare's data processing practices
- User rights under GDPR and CCPA
- Security measures implemented
- Reverse DNS lookup feature (client-side only, on user interaction)
The privacy policy is accessible from the main page footer and can be viewed at /privacy.
CloakProbe includes optional client-side DNS lookup features:
Reverse DNS (PTR) Lookup:
- User-initiated only: The lookup only happens when the user explicitly clicks the "Lookup Reverse DNS" button
- Client-side: Uses Cloudflare DNS over HTTPS (DoH) directly from the browser
- No server-side processing: No data is sent to the CloakProbe server
- Privacy-focused: Cloudflare DoH is privacy-focused and does not log queries
- No automatic requests: The page does not send any external requests automatically
Authoritative NS (ISP Hint) Lookup:
- Runs in parallel: When PTR lookup is triggered, NS lookup runs simultaneously
- ISP detection: Extracts ISP/provider domain from nameserver hostnames (e.g.,
ns1.telekom.hu→telekom.hu) - Useful for identification: Helps identify the actual ISP even when reverse DNS hostname doesn't contain the provider name
Contributions are welcome! Please read our Contributing Guide and Code of Conduct first.
This project is licensed under the GNU Affero General Public License v3.0 with additional commercial use restrictions.
Non-commercial use (personal, educational, research, non-profit) is permitted under AGPL-3.0.
Commercial use requires explicit written permission from the copyright holders.
See LICENSE for full details.
Please report security vulnerabilities privately. See SECURITY.md for details.
- Code Structure: Modular architecture with separate handler modules (
handlers/), header extraction (headers/), utilities (utils/), and formatters (formatters/) - ASN lookup:
src/asn.rsuses a binary prefix-range database from ip2asn. - Tor / VPN detection:
- The
NetworkInfostruct containstor_exitandvpn_or_hostingflags, these default tofalse.
- The
- Reverse DNS:
- Client-side reverse DNS lookup is available via the HTML UI using Cloudflare DNS over HTTPS (DoH)
- The lookup happens entirely in the browser when the user clicks the "Lookup Reverse DNS" button
- No server-side reverse DNS lookup is implemented (the API response does not include reverse DNS)
- Testing:
- Comprehensive test suite with 70 tests covering handlers, headers, utils, and formatters
- All handlers have dedicated test modules
- Run tests with
cargo test - Ensure code passes
cargo fmtandcargo clippywithout warnings
