SocialKraken Blog

Shodan for OSINT & Forensics: CLI Commands, Search Filters and Query Recipes

2026-08-09

Shodan is the search engine for internet-connected devices - and one of the most versatile tools for OSINT and digital forensics. This guide walks through the practice in three parts: the CLI commands, the search filters (dorks), and ready-to-use query recipes for real investigative scenarios.

A quick reminder on syntax: filters take the form filtername:value with no space between the filter and its value. Values containing spaces need quotes, and on the command line the whole query needs an extra set of single quotes, e.g. 'ssl.cert.subject.cn:"example.com"'. Filters combine simply by placing them next to each other.

Use responsibly. Shodan indexes banners that devices expose publicly - searching is passive. Active scanning (shodan scan submit) and any follow-up interaction with a host require proper authorization. Everything below is intended for legitimate research, defensive security, and lawful investigations only.

Part 1 - The Shodan CLI

The command-line tool shodan (part of the shodan Python package) covers nearly the full feature set. After pip install shodan, run shodan init <API-KEY> once - then every command is available.

Account and setup

CommandPurpose
shodan init <key>store the API key
shodan infoaccount info, incl. remaining credits
shodan myipprint your external IP
shodan versiontool version

Lookups

CommandPurpose
shodan host <ip>all information for an IP: open ports, banners, vulnerabilities, last-seen state
shodan domain <domain>all information for a domain: subdomains and DNS records (passive)
shodan host 8.8.8.8
shodan domain example.com --details --save

Search, count, statistics

CommandPurpose
shodan search <query>search the Shodan database
shodan count <query>just the number of matches - without spending query credits
shodan stats --facets <f> <query>faceted census: most common values per property
shodan search --fields ip_str,port,org 'product:nginx country:DE'
shodan count 'ssl.version:tlsv1'
shodan stats --facets org,country port:445

Save and process data

CommandPurpose
shodan download <file> <query>save results as compressed JSON
shodan parse <file>process saved JSON offline
shodan convert <file> <format>convert to another format (e.g. CSV, KML, GeoJSON)
shodan download berlin-nginx 'product:nginx city:"Berlin"'
shodan parse --fields ip_str,port berlin-nginx.json.gz

Monitoring (alerts) and on-demand scans

CommandPurpose
shodan alert create <name> <net>continuously monitor a network
shodan alert domain <domain>alert based on a domain
shodan alert list / info / remove / clearview and manage alerts
shodan alert triggers / enable / disablecontrol notification triggers
shodan alert export / importsave / restore the monitoring configuration
shodan scan submit <ip/net>request an active scan (authorization required)
shodan scan status / list / protocolstrack scans; scannable protocols
shodan honeyscore <ip>honeypot probability (0-1)

A documentation quirk worth knowing: the help text of shodan alert import mistakenly starts with "Export…" in the source (copied from alert export). The function does, however, import a previously exported monitoring configuration.

Streaming and more

CommandPurpose
shodan streamread data in real time (requires the right subscription)
shodan radarreal-time map of new findings in the terminal
shodan trends <query>search the historical Shodan database
shodan data / shodan orgbulk datasets; managing your organization

Part 2 - Search filters (dorks): the reference

Filters take the form filtername:value (no space); values with spaces go in quotes. By default Shodan only searches the banner's data property - everything else is reachable only through the filters below.

Host and network

FilterMatches
ip, netIP address / CIDR range
hostname, domainhostname in the banner / domain
portport number of the service
org, isp, asnorganization, provider, AS number
product, version, cpedetected software, version, CPE identifier
os, device, linkoperating system, device type, network link type
hashhash of the data property (identical banners)
has_screenshot, has_ssl, has_ipv6, has_vulnyes/no markers
tagautomatic Shodan tags (higher plan)

Plus a few meta filters: all (searches all fields), shodan.module (the collecting crawler module), scan (scan ID) and asset.

Location

FilterMatches
country, state, region, city, postalcountry / state / region / city / postal code
geolatitude, longitude, optional radius in km

HTTP

FilterMatches
http.title, http.htmlpage title / HTML body
http.statusHTTP status code
http.component, http.component_categorydetected web technology / category
http.favicon.hashfavicon hash (fingerprint)
http.wafdetected web application firewall
http.securitytxtcontents of security.txt
http.html_hash, http.title_hash, http.dom_hash, http.headers_hash, http.server_hash, http.robots_hashhashes of individual HTTP parts (pivoting/dedup)

SSL/TLS

FilterMatches
ssl, ssl.version, ssl.alpncertificate text, TLS version(s), ALPN protocols
ssl.jarm, ssl.ja3sTLS-stack fingerprints (JARM, JA3S)
ssl.cert.subject.cn, ssl.cert.issuer.cnCommon Name of subject / issuer
ssl.cert.serial, ssl.cert.fingerprintserial, fingerprint (exact certificate)
ssl.cert.expired, ssl.cert.alg, ssl.cert.extensionexpired?, signature algorithm, extensions
ssl.cert.pubkey.bits, ssl.cert.pubkey.typepublic-key length and type
ssl.cipher.name, ssl.cipher.bits, ssl.cipher.versionnegotiated cipher suite
ssl.chain_countcertificate chain length

Screenshots and cloud

FilterMatches
screenshot.hash, screenshot.labelscreenshot hash / ML label (e.g. ics, login)
cloud.provider, cloud.region, cloud.servicecloud provider / region / service

Tracking pixels and web markers - strong for attribution: linking different sites via the same ID.

FilterMatches
google_analytics, google_tag_manager, google_adsGoogle tracking IDs in the page source
meta_pixel, tiktok_pixel, x_pixelMeta, TikTok and X pixel IDs

Protocol-specific

FilterMatches
ssh.hassh, ssh.typeSSH HASSH fingerprint, host-key type
snmp.name, snmp.location, snmp.contactSNMP system fields
ntp.ip, ntp.port, ntp.more, ntp.ip_countNTP monlist data
telnet.option, telnet.do/dont/will/wontnegotiated Telnet options
bitcoin.ip, bitcoin.port, bitcoin.version, bitcoin.ip_countBitcoin node characteristics

Vulnerabilities, category and time

FilterMatches
vuln, has_vulnCVE / "has a vulnerability" (higher plan)
categorycrawl category, e.g. ics, malware
before, aftertime window in dd/mm/yyyy format

Part 3 - Query recipes: combining filters

Knowing the individual filters is one thing - combining them into precise, repeatable queries is where the real investigative value lives. The recipes below are starting points for OSINT and forensic work.

Infrastructure pivoting

The strongest OSINT use of Shodan is pivoting: starting from one artifact and finding related infrastructure.

Find every host serving the same favicon. A favicon hash is a compact fingerprint that often reveals a whole fleet of related servers, even across different IPs and domains.

http.favicon.hash:-1234567890

Pivot on a TLS certificate Common Name. Useful for mapping infrastructure tied to a domain or organization.

ssl.cert.subject.cn:"example.com"

Group hosts by JARM fingerprint. JARM clusters servers with identical TLS-stack behavior - handy for spotting matching C2 or panel infrastructure.

ssl.jarm:<jarm-hash>

Scope everything an organization or ASN exposes.

org:"Target Organization"
asn:AS15169

Find hosts by hostname. hostname matches the name carried in the banner - useful for surfacing sub-domains and forgotten hosts belonging to a domain.

hostname:example.com

Pivot more precisely on the certificate. The Common Name can be ambiguous; the serial and SHA-256 fingerprint identify one specific certificate - and the issuer CN finds everything signed by the same (often internal) CA.

ssl.cert.fingerprint:<sha256-fingerprint>
ssl.cert.serial:<serial>
ssl.cert.issuer.cn:"Internal CA"

Group identical banners or screenshots. hash is the hash of the data property - hosts with an identical banner share it; screenshot.hash does the same for screenshots.

hash:-1937681632
screenshot.hash:<image-hash>

Exposed and misconfigured services

Databases reachable from the internet.

product:MongoDB
product:Elasticsearch port:9200
product:"Redis" port:6379

Remote-access surfaces.

port:3389 has_screenshot:true
product:OpenSSH port:22

Web panels and login pages by title.

http.title:"Login" country:DE
http.title:"Index of /"

Web technology and content fingerprinting

Detected HTTP components and page content let you re-find technologies, campaigns or reused markers across many hosts.

Search by the web technology in use. Shodan detects CMSs, frameworks and libraries automatically; the related http.component_category groups whole categories.

http.component:"WordPress"
http.component:"jQuery" country:DE

Find pages carrying a specific marker in the HTML. http.html searches the HTML body - ideal for tracking a tracking ID, a template fragment or a reused string across many hosts. http.status narrows further by response code.

http.html:"ua-000000-1"
http.html:"Powered by AcmeCMS" http.status:200

Detect web application firewalls.

http.waf:Cloudflare

Certificates and TLS hygiene

Expired certificates on a network you own. A fast way to surface neglected assets.

ssl.cert.expired:true net:203.0.113.0/24

Outdated TLS versions still in use. Note Shodan's value for TLS 1.0 is tlsv1 (not tlsv1.0); accepted values are sslv2, sslv3, tlsv1, tlsv1.1, tlsv1.2, tlsv1.3.

ssl.version:tlsv1 country:DE

For the cipher layer there is also ssl.cipher.name (the exact cipher-suite name) - useful for surfacing outdated or weak suites.

Geographic and organizational scoping

These filters narrow any query to a place, an organization or a platform - usually combined with a service filter.

country:DE city:"Berlin"
geo:"52.52,13.40,50"
postal:"10115" product:nginx
org:"Deutsche Telekom AG" os:"Windows"
asn:AS3320 isp:"Vodafone"

geo takes latitude, longitude and an optional radius in kilometers; os, isp and device narrow further by platform, provider and device type.

Vulnerability-oriented triage

These filters generally require a paid or academic Shodan account.

Hosts flagged with known vulnerabilities.

has_vuln:true org:"Target Organization"

A specific CVE across a region.

vuln:CVE-2014-0160 country:DE

Shodan tags

Shodan labels banners automatically with tags. They are a fast entry point - and an effective noise filter.

tag:vpn country:DE
tag:database -tag:honeypot
tag:self-signed
tag:eol-os
tag:compromised

-tag:honeypot is especially handy: it excludes suspected honeypots (the honeypot tag is mutually exclusive with real device tags such as ics). The tag vocabulary is data-driven - list the values currently in use with shodan stats --facets tag <query>. Common values: vpn, cloud, self-signed, starttls, cdn, eol-os, eol-product, scanner, database, iot, compromised.

Industrial control systems (ICS)

ICS exposure is high-impact and worth a dedicated recipe set.

category:ics
product:Modbus
screenshot.label:ics country:DE

Time-boxing results

Narrow a query to a window - useful when correlating with an incident timeline. Dates use dd/mm/yyyy.

product:nginx after:01/01/2025 before:01/07/2025

Putting it together

The recipes above are starting points. Chaining constraints is what produces a short, high-signal result set instead of noise:

product:nginx country:DE port:443 ssl.cert.expired:true

Two practical habits:

One important caveat: by default Shodan only searches the banner's data property. Everything else - organization, location, port, certificate fields - is only reachable through the filters shown here. And because Shodan's filter set is account-tier dependent and evolves over time, the authoritative, current list is always available from the API endpoint https://api.shodan.io/shodan/host/search/filters?key=YOUR_API_KEY.


Sources

Fact status: 2026-08-09. CLI commands verified against the shodan-python source; filter set based on the official Filter Reference. The binding, current filter list is tier-dependent and retrievable via the shodan/host/search/filters API endpoint.