
Automatisiere die Ausführung von Exploit/PoC gegen Shodan-Suchergebnisse – gleichzeitiger Versand, Filterung, strukturierte Ausgabe und Export.
Automatisieren Sie die Ausführung von Exploits und PoCs gegen Shodan-Suchergebnisse. Durchsuchen Sie Shodan, filtern Sie Ziele und führen Sie Ihre Skripte gegen jeden Treffer aus – parallel, mit strukturierter Ausgabe und Export.
Sie haben ein PoC-Skript, das eine IP und einen Port akzeptiert. Sie möchten es gegen jeden Host ausführen, der einer Shodan-Abfrage entspricht. ShodScript schließt die Lücke: suchen, filtern, ausführen, Ergebnisse sammeln.
pip install git+https://github.com/momenbasel/shodscript.git
Oder klonen und lokal installieren:
git clone https://github.com/momenbasel/shodscript.git
cd shodscript
pip install -e .
Setzen Sie Ihren Shodan-API-Schlüssel:
export SHODAN_API_KEY="your-api-key-here"
Oder übergeben Sie ihn mit --api-key / -k bei jedem Befehl.
# Table output
shodscript search "apache 2.4.49"
# Filter by port and country
shodscript search "nginx" --port 443 --country US --limit 50
# JSON output
shodscript search "apache" --json
# Run check_http.py against each host matching "apache 2.4.49"
shodscript run "apache 2.4.49" ./exploit.py
# 20 concurrent workers, 60s timeout per target
shodscript run "apache 2.4.49" ./exploit.py -w 20 -t 60
# Filter to port 80 in Germany, save results
shodscript run "apache" ./exploit.py --port 80 --country DE -o results.json
# CSV export
shodscript run "nginx" ./check.py -o results.csv --format csv
# Only show successful hits
shodscript run "apache" ./exploit.py --quiet
Drei Modi über --pass-via:
| Modus | Wie Ihr Skript das Ziel erhält |
|---|---|
arg (Standard) | python3 script.py <ip> <port> |
env | Umgebungsvariablen TARGET_IP, TARGET_PORT, TARGET_HOST |
stdin | ip:port\n wird an stdin geschrieben |
# Pass via environment variables
shodscript run "nginx" ./script.py --pass-via env
# Pass via stdin
shodscript run "nginx" ./script.py --pass-via stdin
# Forward extra arguments to the script
shodscript run "nginx" ./script.py -e "--verbose" -e "--ssl"
# One IP per line - pipe to other tools
shodscript ips "apache 2.4.49" | xargs -I{} curl -s http://{}
# Include port
shodscript ips "apache 2.4.49" --with-port
# Pipe to nuclei, httpx, etc.
shodscript ips "apache 2.4.49" -n 500 | httpx -silent
shodscript host 1.2.3.4
shodscript host 1.2.3.4 --json
shodscript info
Ihr Skript muss lediglich eine IP und einen Port akzeptieren. Minimalbeispiel:
#!/usr/bin/env python3
import sys
ip = sys.argv[1]
port = int(sys.argv[2])
# Your exploit/check logic here
print(f"[+] {ip}:{port} - vulnerable")
# Exit 0 = success (marked green), non-zero = failure (marked red)
Weitere Muster, darunter umgebungsbasierte und Banner-Grabbing-Skripte, finden Sie im Verzeichnis examples/.
Ergebnisse können als JSON, JSONL oder CSV gespeichert werden:
shodscript run "query" ./script.py -o results.json # JSON (default)
shodscript run "query" ./script.py -o results.jsonl --format jsonl # One JSON object per line
shodscript run "query" ./script.py -o results.csv --format csv # CSV
Jeder Datensatz enthält: ip, port, host, org, country, returncode, success, stdout, stderr, elapsed, error.
MIT
Nur für autorisierte Sicherheitstests und Forschung.