Skip to content

TheGreatAzizi/IP-Security-Analyzer-Cloudflare-Worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ IP Security Analyzer

IP Security Analyzer: A pro-grade Cloudflare Worker for forensic intelligence.
Detects VPNs, Proxies & Hosting IPs via heuristic ASN auditing.
Includes Security Scoring, WebRTC Leak Test, ISP classification, and Geo-location.
Built with a modern Bento UI and live terminal logs.
Powerful, open-source and real-time network forensic tool.

πŸš€ Live Demo


✨ Features

  • πŸ” Heuristic ASN Auditing β€” Detects VPNs, Proxies, Hosting providers via ISP pattern analysis
  • πŸ›‘οΈ Security Scoring β€” Dynamic 0-100 trust score based on infrastructure risk
  • πŸ”Œ WebRTC Leak Test β€” Real-time detection of IP leaks via browser STUN probing
  • 🏷️ ISP Classification β€” Categorizes connections (Mobile, Hosting, Educational, Corporate, Residential)
  • 🌍 Geo-Location β€” Country, city, region, coordinates from Cloudflare edge data
  • πŸ–₯️ Modern Bento UI β€” Glass-morphism dashboard with responsive grid layout
  • πŸ“œ Live Terminal Logs β€” Real-time forensic logging with animated timestamps
  • ⚑ Edge Performance β€” Sub-100ms response via Cloudflare's global network
  • πŸ”Œ JSON API β€” RESTful /json endpoint for programmatic access
  • πŸ“‹ One-Click Copy β€” Copy IP address to clipboard instantly

πŸš€ Deployment

Prerequisites

  • Cloudflare account (Free tier works)
  • Wrangler CLI: npm install -g wrangler

Method 1: Wrangler CLI (Recommended)

# 1. Login
npx wrangler login

# 2. Create worker
npx wrangler init ip-security-analyzer

# 3. Paste code into src/index.js

# 4. Deploy
npx wrangler deploy

Your URL: https://ip-security-analyzer.YOUR_SUBDOMAIN.workers.dev

Method 2: Cloudflare Dashboard

  1. Go to Cloudflare Dashboard β†’ Workers & Pages
  2. Click "Create Application" β†’ "Create Worker"
  3. Name it ip-security-analyzer
  4. Click "Edit Code", paste the code, "Save and Deploy"

🌐 Custom Domain Setup

Step 1: Add Domain to Cloudflare

  • Add your domain to Cloudflare
  • Update nameservers

Step 2: Create DNS Record

Type: CNAME
Name: myip
Target: your-worker.YOUR_SUBDOMAIN.workers.dev
Proxy: Orange cloud (Proxied)

Step 3: Add Route

Via Wrangler:

npx wrangler route add "myip.yourdomain.com/*" ip-security-analyzer

Via Dashboard:

  1. Workers & Pages β†’ Your Worker β†’ Settings β†’ Triggers
  2. Click "Add Custom Domain"
  3. Enter: myip.yourdomain.com

Step 4: Verify

Visit: https://myip.yourdomain.com


πŸ“‘ API

Endpoints

Endpoint Description
/ HTML Dashboard
/json JSON Metadata

JSON Response

{
  "status": "success",
  "metadata": {
    "ip": "203.0.113.42",
    "type": "IPv4",
    "asn": "15169",
    "isp": "Google LLC",
    "connectionType": "Hosting / Proxy",
    "country": "US",
    "city": "Mountain View",
    "region": "California",
    "lat": "37.3860",
    "lon": "-122.0838",
    "colo": "SJC",
    "timezone": "America/Los_Angeles",
    "tlsVersion": "TLSv1.3",
    "httpProtocol": "HTTP/2",
    "rayId": "8f7e6d5c4b3a2190"
  }
}

Usage Examples

cURL:

curl https://myip.theazizi.ir/json

JavaScript:

const res = await fetch('https://myip.theazizi.ir/json');
const data = await res.json();
console.log(data.metadata.ip);

Python:

import requests
print(requests.get('https://myip.theazizi.ir/json').json())

πŸ” Security Analysis

Detection Categories

Type Patterns
πŸ“± Mobile Vodafone, Verizon, T-Mobile, LTE, 5G
☁️ Hosting/Proxy AWS, GCP, Azure, DigitalOcean, Hetzner, VPN
πŸŽ“ Educational University, .edu, Research networks
🏒 Corporate Enterprise, Business ASN ranges
🏠 Residential Standard consumer ISPs (default)

Scoring Algorithm

Risk Factor Deduction
Hosting/VPN detected -45 pts
Mobile network -10 pts
Bot signature -30 pts
Timezone mismatch -20 pts
WebRTC leak -15 pts

Score Ranges:

  • 🟒 80-100: Trusted
  • 🟑 50-79: Limited Trust
  • πŸ”΄ 0-49: High Risk

βš™οΈ Configuration

Environment Variables

npx wrangler secret put API_KEY

Access in code:

const apiKey = env.API_KEY;

wrangler.toml

name = "ip-security-analyzer"
main = "src/index.js"
compatibility_date = "2026-02-14"

[[routes]]
pattern = "myip.yourdomain.com"
custom_domain = true

πŸ› οΈ Development

# Local dev server
npx wrangler dev

# View logs
npx wrangler tail

πŸ“Š Performance

  • Latency: Sub-100ms globally
  • Cold Start: Near-zero (Cloudflare 2025 optimization)
  • Requests: 100K/day (Free tier)

πŸ“ License

MIT License β€” Free to use, modify, and deploy.


πŸ‘€ Author

TheGreatAzizi


Built with ❀️

About

IP Security Analyzer: A pro-grade Cloudflare Worker for forensic intelligence. Detects VPNs, Proxies & Hosting IPs via heuristic ASN auditing. Includes Security Scoring, WebRTC Leak Test, ISP classification, and Geo-location. Built with a modern Bento UI and live terminal logs. Powerful, open-source and real-time network forensic tool.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors