OSINT tool for security threats and global firepower.
Project description
OSINT Security Threat Package
A specialized Open Source Intelligence (OSINT) tool designed for cybersecurity threat intelligence and geopolitical military capability analysis. This package combines the power of the AlienVault Open Threat Exchange (OTX) API with an automated Global Firepower index scraper.
Features
| Module | Source | Description |
|---|---|---|
| OTX Scanner | AlienVault OTX | Asynchronous wrapper for the OTX API. Fetches pulse counts, malware analyses, and threat intelligence for domains, IPs, and file hashes. |
| Firepower Scraper | Global Firepower | Selenium-based automated scraper that extracts structured military statistics, financial metrics, manpower, and logistics data for any country. |
Prerequisites
- Python 3.8+
- Google Chrome: Required for the
GlobalFirePowerScraper(Selenium manages the ChromeDriver automatically viawebdriver-manager). - AlienVault API Key: Required for the
OtxScanner.
Installation
Navigate to the root directory of the package and install it via pip:
cd OSINT-SECURITY-THREAT-PKG
pip install osint-security-threat-pkg
This will automatically install necessary dependencies including selenium, beautifulsoup4, and the official OTXv2 Python SDK.
Configuration
To use the OTX Scanner, you must provide an AlienVault OTX API key. You can get a free key by signing up at otx.alienvault.com.
Method 1: Environment Variable (Recommended) Set the variable in your terminal or .env file. The package will automatically detect it.
Linux / macOS:
export ALIENTVAULT_OTX_API_KEY="your_api_key_here"
Windows (PowerShell):
$env:ALIENTVAULT_OTX_API_KEY="your_api_key_here"
Method 2: Direct Initialization Pass the key directly when initializing the class in Python.
from osint_security_threat_pkg import OtxScanner
scanner = OtxScanner(api_key="your_api_key_here")
Usage Examples
- Threat Intelligence (AlienVault OTX) Scan a domain asynchronously to check for associated malicious pulses and threat data.
import asyncio
from osint_security_threat_pkg import OtxScanner
async def check_threats():
# Will use ALIENTVAULT_OTX_API_KEY from environment if not passed
scanner = OtxScanner()
domain = "pastebin.com"
print(f"--- Scanning Domain: {domain} ---")
result = await scanner.scan(domain)
if result["success"]:
data = result["data"]
general_info = data.get("general", {})
pulse_info = general_info.get("pulse_info", {})
print(f"Total Pulses (Threat Reports): {pulse_info.get('count', 0)}")
# Print the first few related pulses
for pulse in pulse_info.get("pulses", [])[:3]:
print(f"- {pulse.get('name')} (Tags: {', '.join(pulse.get('tags', []))})")
else:
print(f"Error: {result.get('error')}")
if __name__ == "__main__":
asyncio.run(check_threats())
- Geopolitical Military Data (Global Firepower) Scrape comprehensive military strength data for a specific country. Using the with statement (context manager) ensures the headless browser closes automatically when finished.
from osint_security_threat_pkg import GlobalFirePowerScraper
def check_military_strength():
country = "nigeria"
print(f"--- Fetching Military Data for: {country.upper()} ---")
# Initialize the scraper (headless=True runs the browser invisibly)
with GlobalFirePowerScraper(headless=True) as scraper:
# Search and optionally save the raw JSON output to a file
data = scraper.search(country, save_to_file=False)
if data:
overview = data.get('overview', {}).get('ranks', {})
print(f"Global Firepower Rank: {overview.get('GFP Rank', 'N/A')}")
manpower = data.get('manpower', {}).get('statistics', {})
if 'Available Manpower' in manpower:
print(f"Available Manpower: {manpower['Available Manpower'].get('value')}")
financials = data.get('financials', {}).get('statistics', {})
if 'Defense Budget' in financials:
print(f"Defense Budget: {financials['Defense Budget'].get('value')}")
else:
print("Failed to retrieve data.")
if __name__ == "__main__":
check_military_strength()
Disclaimer
This tool is intended for educational purposes and legitimate Open Source Intelligence (OSINT) research.
The OtxScanner usage is subject to the AlienVault OTX Terms of Service.
The GlobalFirePowerScraper automates interactions with a public website. Users are responsible for adhering to the site's robots.txt and avoiding excessive request rates that could degrade the service.
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 osint_security_threat_pkg-0.1.0.tar.gz.
File metadata
- Download URL: osint_security_threat_pkg-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
521923803c5c07f119dfafe9d67d8a68b2066cd22adb846c56cbd6c71d31ed17
|
|
| MD5 |
1a7ba4dd4e460e605945a696fb53f7f4
|
|
| BLAKE2b-256 |
5cd852f86fecfc66d5f420a485cd717cd48692e72cf369d8fa340422418cf866
|
File details
Details for the file osint_security_threat_pkg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: osint_security_threat_pkg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b24e9fda2df363826d1c4a8066760a62215054da00c59d08062fcf93889710cf
|
|
| MD5 |
a2e5739d106a4c55cd86b2613448368a
|
|
| BLAKE2b-256 |
f329c3e58a95295306c7f9713679b97092c080c30934ed2b5acec7e828eb7e08
|