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.
Metadata
Release files for osint-security-threat-pkg 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| osint_security_threat_pkg-0.1.0.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| osint_security_threat_pkg-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / osint_security_threat_pkg-0.1.0.tar.gz
| Download URL | osint_security_threat_pkg-0.1.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
521923803c5c07f119dfafe9d67d8a68b2066cd22adb846c56cbd6c71d31ed17
|
|
BLAKE2b-256 checksum How to use checksums |
5cd852f86fecfc66d5f420a485cd717cd48692e72cf369d8fa340422418cf866
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / osint_security_threat_pkg-0.1.0-py3-none-any.whl
| Download URL | osint_security_threat_pkg-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b24e9fda2df363826d1c4a8066760a62215054da00c59d08062fcf93889710cf
|
|
BLAKE2b-256 checksum How to use checksums |
f329c3e58a95295306c7f9713679b97092c080c30934ed2b5acec7e828eb7e08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|