Information Gathering
The Shodan Command-Line Interface allows you to interact with the Shodan search engine database directly from the terminal to query internet-connected assets and vulnerability data feeds.
sudo apt install shodan && shodan init <API_KEY>
shodan [command] [options]
Shodan CLI is the command-line interface for the Shodan search engine, the world's first search engine for internet-connected devices. It allows you to query Shodan's massive database of internet devices directly from your terminal.
Created by John Matherly in 2009, Shodan indexes banners, ports, vulnerabilities, and metadata from internet-connected devices worldwide. The CLI provides access to host lookups, vulnerability scans, and infrastructure searches without using the web interface.
Shodan is invaluable for security professionals who need to discover exposed infrastructure, check for vulnerabilities, and understand their organization's internet footprint. It provides historical data that real-time scanners cannot match.
shodan host 8.8.8.8Host lookup - View historical open ports, vulnerabilities, and location info for a public IPshodan search apache port:22Global engine search - Find exposed servers indexing specific technologies globallyshodan init API_KEYInitialize API keyshodan search "apache"Search devicesshodan search "port:22 country:US"Filtered searchshodan stats --facets country port:22Statisticsshodan infoShow API plan and query countshodan myipGet your public IP addressshodan search http.title:"Login" --fields ip_str,port,org --limit 20Search for login pages with field filteringshodan scan submit --periodic 1week 192.168.1.0/24Schedule recurring scanshodan network 192.168.1.0/24 --filename network-report.jsonNetwork report to JSON fileshodan download --filename apache-scan 200 apache country:USDownload scan results as compressed archiveshodan parse --filename apache-scan.json.gz --limit 100Parse downloaded scan resultsshodan honeyscore 192.168.1.1Check if IP is a honeypotshodan scan status --id SCAN_IDCheck scan progressLook up any public IP to see its historical open ports, services, and vulnerabilities.
Search for exposed devices by technology, country, port, or organization.
Check if specific IPs or domains have known vulnerabilities in Shodan's database.
Monitor your organization's internet-facing assets for unauthorized exposure.
Discover cameras, routers, industrial systems, and other IoT devices online.
Shodan CLI output shows internet-connected devices matching your search query. Results include IP addresses, open ports, service banners, vulnerabilities (CVEs), organization, and geolocation data. Host lookups reveal historical port data and known vulnerabilities.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.