Skip to main content

Detect VPN, Proxy, Tor, Botnets & abusive IPs using hybrid threat intelligence

Project description

VPN & Tunnel Detection CLI Tool

PyPI version Python version License: MIT Downloads

This project is a Python-based command-line tool that helps you detect whether an IP address is likely coming from a VPN, proxy, or abusive source. It uses a combination of IP metadata, ASN heuristics, and optional third-party API lookups for deeper inspection.


Features

  • Uses ASN and organization name heuristics to flag suspicious infrastructure
  • Geolocation and org data powered by IPInfo
  • Optional integration with AbuseIPDB and IPQualityScore
  • Checks against auto-updated threat feeds (Tor exit nodes, botnets, DDoS infra, etc.)
  • Confidence scoring (Low, Moderate, High)
  • Easy to use with vpnscan --ip <IP> command

Installation

  1. Clone the repository:
git clone https://github.com/your-username/vpn-tunnel-detector.git
cd vpn-tunnel-detector
  1. (Optional) Set up a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install the tool locally in editable mode:
pip install --editable .

This gives you access to the global command vpnscan.


API Keys (Optional but Recommended)

To get deeper reputation data, you can plug in:

  • AbuseIPDB API Key
  • IPQualityScore API Key

Set them securely using a .env file.

Example Setup:

  1. Create the file:
cp .env.example .env
  1. Edit the file:
ABUSEIPDB_API_KEY=your_abuseipdb_key
IPQUALITYSCORE_API_KEY=your_ipqs_key

The app will auto-load them without hardcoding into the source.


Usage

Run the scan like this:

vpnscan --ip 104.28.228.78

You’ll get an output like:

------------------------ Welcome to the VPN & Threat Detection CLI Tool ------------------------

This tool checks if an IP address is associated with VPNs, proxies, abuse sources, or threat feeds (e.g. Tor, Botnets).
It uses heuristics, APIs, and auto-updated IP threat feeds for comprehensive detection.

You can cancel the operation at any time by pressing Ctrl+C.

Starting the detection process...

Detection Result
------------------
IP                : 104.28.228.78
ORG               : Cloudflare, Inc.
ASN               : AS13335
Location          : Washington, US
Is Suspicious     : Yes
Detection Reason  : ASN AS13335 is frequently used by VPN or hosting providers. Org name includes 'cloud', commonly seen in VPN or hosting services.
Abuse Score       : 100
IPQS Fraud Score  : 100
Confidence Level  : High
Disclaimer        : This result indicates whether the IP shows characteristics of VPN/proxy, abuse, or known threat activity. It does not imply malicious intent. Many users use VPNs for privacy or remote work.

Threat Feed Matches
--------------------
No matches found in known threat feeds.

Project Structure

pymod_detection_engine/
├── detection_engine/
│   ├── __init__.py
│   ├── run_engine.py
│   ├── config/
│   │   ├── __init__.py
│   │   └── suspicious_asns.json
│   ├── engine/
│   │   ├── __init__.py
│   │   ├── detection_engine.py
│   │   ├── heuristics.py
│   │   ├── ipinfo_wrapper.py
│   │   ├── threat_feeds.py
│   │   ├── abuseipdb_checker.py
│   │   └── ipqualityscore_checker.py
│   └── feeds/
│       ├── __init__.py
│       ├── fetch_feeds.py
│       └── known_bad_ips.json
├── .env.example
├── requirements.txt
├── setup.py
├── MANIFEST.in
├── README.md

License

MIT License — use, fork, improve, or share with attribution.


🙋‍♂️ About

This is a hobby project built for learning, awareness, and experimentation.
It’s not a replacement for professional threat intelligence platforms — but it’s a great start.
Feedback, ideas, or issues? Feel free to open one on GitHub.

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

detection_engine-0.1.8.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

detection_engine-0.1.8-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file detection_engine-0.1.8.tar.gz.

File metadata

  • Download URL: detection_engine-0.1.8.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for detection_engine-0.1.8.tar.gz
Algorithm Hash digest
SHA256 4f12cac19ead5b21f5f2120951b5797d529871827471b86f2ae791325ffd2fd3
MD5 4513e0bf4296a480479e843aeae21a89
BLAKE2b-256 3ba14377a4b890c759a1c9dceefb9a381e106be8a90a8faa8579089e771aa32f

See more details on using hashes here.

File details

Details for the file detection_engine-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for detection_engine-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d11e845fd3777913839f66a94a7950185049e729038e16fa85c04cd070b5767b
MD5 c2d87b4d99a12a55a3e02890d7a97bd9
BLAKE2b-256 ce58db72b2f934141d71853279a71c6c05e856a27a30379404a2af7fe26f6137

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