reconnaissance

Shodan for Offensive Reconnaissance

A field guide to Shodan — the search engine for internet-connected devices. Learn the filters offensive operators use to map exposed infrastructure, services, and misconfigurations before an engagement.

What Is Shodan?

Shodan is a search engine that continuously scans the public IPv4 (and increasingly IPv6) address space, fingerprints every responding service, and indexes the banners it collects. Where Google indexes web content, Shodan indexes the machines themselves — open ports, TLS certificates, SSH keys, SCADA controllers, webcams, databases, and everything in between.

For an offensive security practitioner, Shodan collapses hours of active scanning into a single query. You can map a target's external footprint without sending a packet to their network — critical when stealth matters or when scope only permits passive reconnaissance.

Core Search Filters

Shodan's filter syntax uses filter:value pairs you can chain together. Strings with spaces need quotes. Negate a filter with a leading -.

FilterDescriptionExample
port:Match services on a specific TCP/UDP portport:22
hostname:Match results whose hostname contains a stringhostname:example.com
net:Restrict to a CIDR blocknet:198.51.100.0/24
os:Match a specific operating system fingerprintos:"Windows Server 2019"
country:ISO 3166-1 alpha-2 country codecountry:DE
city:Restrict to a citycity:"Berlin"
org:Match an organization name from WHOISorg:"Acme Corp"
product:Service product name detected in the bannerproduct:"nginx"
version:Service version stringversion:1.18.0
ssl:Match a string in the TLS certificatessl:"example.com"
ssl.cert.subject.cn:Common Name in the certificate subjectssl.cert.subject.cn:example.com
http.title:HTTP page titlehttp.title:"index of /"
http.favicon.hash:MurmurHash3 of the favicon — pivot across infrahttp.favicon.hash:-1234567890
vuln:Match a CVE (paid tier)vuln:CVE-2021-44228
tag:Pre-computed tag (e.g. compromised, ics, vpn)tag:ics

Combine filters to narrow the noise: net:198.51.100.0/24 port:443 ssl:"example.com" returns HTTPS endpoints in that block whose certificate references the target domain.

Infrastructure Discovery

Start broad, then narrow. The goal of the recon phase is to understand what a target owns before deciding what to probe.

Map a target's external surface

01hostname:example.com
02ssl:"example.com"
03ssl.cert.subject.cn:example.com
04org:"Example Corporation"
05http.html:"example.com"

ssl: is particularly powerful — TLS certificates often reveal infrastructure that isn't linked from the main site (staging, internal admin panels, mail gateways) because the certificate's Subject Alternative Names enumerate every hostname it covers.

Pivot across related hosts

01http.favicon.hash:-1234567890
02http.html_hash:123456789
03ssl.cert.serial:"01:23:45:67:89:AB:CD:EF"

Favicon hashes are a classic pivot: if a target self-hosts a custom admin panel, every instance of that panel anywhere on the internet shares the same favicon hash. One query and you find the rest of their fleet.

Finding Exposed Services

Once you know what a target owns, look for services that shouldn't be reachable from the public internet. These are the high-value findings in any external assessment.

Common exposed services

01port:3389 hostname:example.com // exposed RDP
02port:5900 "VNC" -authentication // unauthenticated VNC
03product:"MongoDB" port:27017 // exposed MongoDB
04product:"Elasticsearch" port:9200 // open Elasticsearch
05port:6379 product:"Redis" // exposed Redis
06http.title:"Jenkins" port:8080
07http.title:"Grafana"
08http.component:"kibana"
# Combine with org filter to scope to your target
org:"Acme Corp" (port:3389 OR port:5900 OR port:23)

Anything that returns a banner without authentication is fair game to flag in a report. A misconfigured Elasticsearch or Redis instance is usually a direct path to data exfiltration.

Hunting Known Vulnerabilities

Shodan tags services it can fingerprint as vulnerable to specific CVEs. The vuln: filter is paid-tier, but the same results are often reachable by querying the vulnerable version string directly.

Version-based hunting

01product:"OpenSSH" version:"7.4"
02product:"Apache httpd" version:"2.4.49" // CVE-2021-41773
03product:"Microsoft Exchange" "15.2"
04tag:vpn product:"Fortinet"
05http.html:"log4j" port:443

A version match is a hypothesis, not proof — confirm exploitability against scope before claiming an active vulnerability. Many banners lie because operators backport patches without bumping the displayed version.

Defensive Measures

If you're defending a perimeter, treat Shodan as part of your standard external monitoring. Search for your own organization weekly:

org:"Your Company"
ssl:"yourcompany.com"
hostname:yourcompany.com
  • Inventory everything Shodan sees. Anything indexed that you don't recognize is either shadow IT or an attacker's beachhead — investigate both.
  • Close unintended ports at the edge. Management interfaces (SSH, RDP, database ports, Kubernetes API) should never be reachable from arbitrary source IPs.
  • Mint dedicated certificates for internal infra. Don't list staging or admin hostnames in the SAN of your public certificate — it leaks your internal topology.
  • Subscribe to Shodan Monitor. Get alerted the moment a new service in your IP space starts answering.
  • Patch on the version Shodan sees, not the one you shipped. If banners advertise vulnerable versions, that's what attackers will target — even if you've backported the fix.

Train your team on this, hands-on.

Hackshire is a CTF-based training platform for security teams. Real exposure hunting scenarios, built by offensive security experts. Opening December 2026.

$