Skip to content

shodansploit is a powerful CLI tool for interacting with the Shodan API. It provides both an interactive menu-driven interface and robust command-line capabilities for security researchers, penetration testers, and DevOps professionals.

License

Notifications You must be signed in to change notification settings

offsec-toolkit/shodansploit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

shodansploit

πŸ“– About

shodansploit is a powerful CLI tool for interacting with the Shodan API. It provides both an interactive menu-driven interface and robust command-line capabilities for security researchers, penetration testers, and DevOps professionals.

Shodan is the world's first search engine for Internet-connected devices. With shodansploit, you can:

  • πŸ” Search for vulnerable hosts and services
  • πŸ›‘οΈ Discover exposed devices (cameras, databases, industrial systems)
  • πŸ’Ύ Export results for reporting and analysis
  • πŸ“š Use pre-built search queries (Dorks) for common vulnerabilities
  • ⚑ Integrate into automated security workflows

✨ Features

Core Features

  • Interactive Menu Mode: User-friendly terminal UI with rich formatting
  • CLI Mode: Script-friendly command-line interface
  • Comprehensive API Coverage: Access all Shodan API endpoints
    • Host information & search
    • Exploit database queries
    • DNS operations
    • Account & tools

Advanced Features (v2.0)

  • 🎯 Shodan Dorks Library: Pre-configured queries for finding:

    • Vulnerable webcams & IP cameras
    • Exposed databases (MongoDB, MySQL, Elasticsearch)
    • Industrial Control Systems (ICS/SCADA)
    • Default credentials & admin panels
    • Remote access services (VNC, RDP, SSH)
  • πŸ’Ύ Data Export: Save results in multiple formats

    • JSON (structured data)
    • CSV (spreadsheet-compatible)
    • TXT (human-readable)
  • πŸ“ Search History: Track your queries automatically

    • View recent searches
    • Search history by keyword
    • Persistent storage
  • 🎨 Rich UI: Enhanced terminal experience with syntax highlighting and formatted output

πŸš€ Installation

Prerequisites

Install Dependencies

git clone https://github.com/ismailtasdelen/shodansploit.git
cd shodansploit
pip install -r requirements.txt

Docker Installation

Build the Docker image:

docker build -t shodansploit -f .Dockerfile .

Run with Docker:

docker run --rm -it shodansploit

πŸ“š Usage

Interactive Mode

Simply run the script without arguments:

python shodansploit.py

On first run, you'll be prompted to enter your Shodan API key. The key is stored in api.txt for future use.

You can also set the API key via environment variable:

export SHODAN_API_KEY="your_api_key_here"
python shodansploit.py

CLI Mode

The tool supports command-line arguments for automation and scripting:

Basic Examples

# Get information about a specific host
python shodansploit.py --host 8.8.8.8

# Search for hosts
python shodansploit.py --search "port:22 country:US"

# Count search results
python shodansploit.py --count "apache"

# Get your public IP
python shodansploit.py --myip

# View account profile
python shodansploit.py --profile

Exploit Database

# Search exploits by CVE
python shodansploit.py --exploit-cve CVE-2021-44228

# Search exploits by author
python shodansploit.py --exploit-author "metasploit"

DNS Operations

# Resolve hostnames to IPs
python shodansploit.py --dns-resolve "google.com,github.com"

# Reverse DNS lookup
python shodansploit.py --dns-reverse "8.8.8.8,1.1.1.1"

Shodan Dorks

# Use a pre-configured dork
python shodansploit.py --dork webcam
python shodansploit.py --dork mongodb

Export Results

# Export to JSON (default)
python shodansploit.py --search "nginx" --output results.json

# Export to CSV
python shodansploit.py --search "port:3306" --output mysql_hosts.csv --format csv

# Export to TXT
python shodansploit.py --host 1.1.1.1 --output cloudflare.txt --format txt

Help

python shodansploit.py --help

πŸ“‚ Project Structure

shodansploit/
β”œβ”€β”€ shodansploit.py       # Main entry point
β”œβ”€β”€ requirements.txt      # Python dependencies
β”œβ”€β”€ api.txt              # Your Shodan API key (auto-generated)
β”œβ”€β”€ .Dockerfile          # Docker configuration
β”œβ”€β”€ src/                 # Source modules
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ api.py           # Shodan API wrapper
β”‚   β”œβ”€β”€ config.py        # Configuration management
β”‚   β”œβ”€β”€ ui.py            # User interface
β”‚   β”œβ”€β”€ export.py        # Data export functionality
β”‚   β”œβ”€β”€ dorks.py         # Shodan dorks library
β”‚   └── history.py       # Search history tracking
└── results/             # Exported results (auto-created)

🎯 Shodan Dorks Categories

The tool includes a curated library of Shodan search queries organized by category:

  • Webcams & Cameras: Find exposed surveillance systems
  • Industrial Control Systems: Discover ICS/SCADA devices
  • Databases: Locate exposed database servers
  • Default Credentials: Find systems with default passwords
  • Remote Access: Identify RDP, VNC, SSH services
  • Web Services: Locate web servers and frameworks
  • IoT Devices: Find smart home and IoT systems
  • Vulnerable Services: Search for known CVEs

πŸ”§ API Key Setup

Method 1: Interactive Prompt

On first run, the tool will prompt you for your API key:

[*] Please enter a valid Shodan.io API Key: YOUR_KEY_HERE

Method 2: Environment Variable

export SHODAN_API_KEY="YOUR_KEY_HERE"

Method 3: Manual File

Create api.txt in the project directory:

echo "YOUR_KEY_HERE" > api.txt

πŸ“Š Menu Options

Option Description
1-5 Host operations (info, count, search, tokens, ports)
6-16 Exploit database queries
17-19 DNS & Labs operations
20-23 Account & tools
24 Exit
25 Shodan Dorks Library
26 View Search History

πŸ›‘οΈ Security & Privacy

  • API keys are stored locally in api.txt
  • Search history is saved in .shodansploit_history (local only)
  • No telemetry or external data transmission beyond Shodan API calls
  • Results are stored locally in the results/ directory

πŸ“– API Documentation

For detailed information about the Shodan API:

🀝 Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Code Style

  • Follow PEP 8 guidelines
  • Add docstrings to functions
  • Keep code modular and maintainable

πŸ“ Changelog

Version 2.0.0 (2026-01-01)

  • ✨ Complete refactor to modular architecture
  • 🎯 Added Shodan Dorks library
  • πŸ’Ύ Added export functionality (JSON, CSV, TXT)
  • πŸ“ Added search history tracking
  • ⚑ Added CLI mode with argparse
  • 🎨 Enhanced UI with Rich library
  • 🐳 Updated Docker support
  • πŸ”§ Environment variable support for API key

Version 1.2.0 (Previous)

  • Initial release with basic functionality

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Ismail Tasdelen

πŸ’– Support

If you find this tool useful, consider supporting the development:

PayPal: paypal.me/ismailtsdln

LiberaPay: Donate using Liberapay

⚠️ Disclaimer

This tool is intended for security research and ethical hacking purposes only. Always obtain proper authorization before scanning or testing systems you don't own. The authors are not responsible for misuse or damage caused by this tool.

🌟 Star History

If you find this project useful, please consider giving it a ⭐!

About

shodansploit is a powerful CLI tool for interacting with the Shodan API. It provides both an interactive menu-driven interface and robust command-line capabilities for security researchers, penetration testers, and DevOps professionals.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages