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
- 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
-
π― 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
- Python 3.6+
- Shodan API Key (Get one free)
git clone https://github.com/ismailtasdelen/shodansploit.git
cd shodansploit
pip install -r requirements.txtBuild the Docker image:
docker build -t shodansploit -f .Dockerfile .Run with Docker:
docker run --rm -it shodansploitSimply run the script without arguments:
python shodansploit.pyOn 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.pyThe tool supports command-line arguments for automation and scripting:
# 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# Search exploits by CVE
python shodansploit.py --exploit-cve CVE-2021-44228
# Search exploits by author
python shodansploit.py --exploit-author "metasploit"# 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"# Use a pre-configured dork
python shodansploit.py --dork webcam
python shodansploit.py --dork mongodb# 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 txtpython shodansploit.py --helpshodansploit/
βββ 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)
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
On first run, the tool will prompt you for your API key:
[*] Please enter a valid Shodan.io API Key: YOUR_KEY_HERE
export SHODAN_API_KEY="YOUR_KEY_HERE"Create api.txt in the project directory:
echo "YOUR_KEY_HERE" > api.txt| 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 |
- 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
For detailed information about the Shodan API:
Contributions are welcome! Please feel free to submit pull requests or open issues.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly
- Submit a pull request
- Follow PEP 8 guidelines
- Add docstrings to functions
- Keep code modular and maintainable
- β¨ 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
- Initial release with basic functionality
This project is licensed under the MIT License - see the LICENSE file for details.
Ismail Tasdelen
- π§ Email: ismailtasdelen@protonmail.com
- πΌ LinkedIn: linkedin.com/in/ismailtasdelen
- π GitHub: github.com/ismailtasdelen
If you find this tool useful, consider supporting the development:
PayPal: paypal.me/ismailtsdln
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.
If you find this project useful, please consider giving it a β!
