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.
| Command | Purpose |
|---|---|
shodan init YOUR_API_KEY | Initialize the CLI with a Shodan API key. |
shodan info | Show available query and scan credits. |
shodan host 8.8.8.8 | Display Shodan's stored data for a public IP. |
shodan search --limit 20 --fields ip_str,port,org 'http.title:"Login"' | Return selected fields for up to twenty indexed results. |
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 progressshodan stats --facets port --query port:22 country:USStatistics: most common ports for SSH in USshodan host 8.8.8.8 --filename google-dns.jsonHost report saved to fileshodan alert create --name 'AWS Scan' --filters ip:aws 192.168.1.0/24Create monitoring alertshodan alert listList all monitoring alertsshodan alert info ALERT_IDGet alert detailsshodan alert remove ALERT_IDDelete a monitoring alertshodan init YOUR_API_KEYInitialize Shodan API keyshodan search ssl.cert.subject.cn:"Google" --fields ip_str,port --limit 10Search by SSL certificate CNLook 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.
Information Gathering
Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.
Vulnerability Analysis
Nuclei is used to send requests across targets based on templates, allowing zero false positives and providing rapid scanning over large infrastructure footprints.
Information Gathering
SpiderFoot is an open-source intelligence (OSINT) automation tool that integrates with over 200 public data sources to gather comprehensive intelligence on IP addresses, domain names, email addresses, and names. Created by Steve Micallef in 2012 and released under the MIT license, SpiderFoot automates the entire OSINT collection process with a powerful correlation engine that links findings across multiple data sources. It provides both a web-based UI (SpiderFoot HX) with interactive visualizations and a CLI for automation, making it one of the most popular OSINT frameworks for penetration testers, threat intelligence analysts, and security researchers. SpiderFoot is intended exclusively for authorized security testing, educational purposes, and defensive research.
Information Gathering
DMitry (Deepmagic Information Gathering Tool) is a command-line application that can gather as much information as possible about a host, including subdomains, email addresses, uptime information, and TCP port scans.
Information Gathering
Learn how to use theHarvester in Kali Linux: gather emails, subdomains, employee names, open ports, and banners from public sources with a step-by-step first scan, API keys, and worked examples for authorized OSINT recon.
Information Gathering
Learn how to use Maltego, the graphical OSINT and link analysis tool: install the free Community Edition, add entities to a graph, run transforms and read the relationships between domains, IP addresses, organizations, people, and other entities.
Learn to use Shodan for discovering internet-connected devices, analyzing exposed services, and identifying vulnerable systems through search queries.
OSINT · IntermediateLearn a complete reconnaissance workflow combining OSINT, DNS enumeration, subdomain discovery, and active scanning for comprehensive target profiling.
OSINT · BeginnerLearn the fundamentals of OSINT including data sources, essential tools, the intelligence gathering methodology, and ethical considerations for open source investigations.
OSINT · BeginnerMaster DNS enumeration techniques from basic queries to advanced zone transfers, subdomain brute forcing, and DNS security assessment using Kali Linux tools.
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.