Finding Your Own Exposed Cameras, Databases and Devices with Shodan and Censys

6 min read188 courses on OnlySecurity

Internet-wide scanners connect to public addresses continuously, record what answers and let anyone search the result. Attackers read the same index, so look yourself to learn what they can see. This article shows how to scope Shodan and Censys to your own address ranges, domains and certificates, what usually turns up, and what to do about it. Test only networks and systems you own or are authorised to assess, and search only for assets that belong to you. Part of Penetration Testing Field Notes.

What the scanners are, and why attackers use them

Shodan describes itself as a search engine for internet-connected devices. It stores each service’s response, called a banner, as its unit of data, and a default search covers only the banner text, so other properties need filters. Censys continually scans the public IPv4 address space, using automatic protocol detection, and says it never tries to log in or gain authenticated access. It finds IPv6 addresses through redirects and DNS.

MITRE ATT&CK lists searching scan databases as sub-technique T1596.005, and cites Volt Typhoon as a group that used FOFA, Shodan and Censys to search for exposed victim infrastructure. The entry’s mitigation note says preventive controls cannot easily stop this, so effort should go into minimising the data available to outsiders. If a service answers on a public address, assume it is indexed.

Scope to what you own

Start from three inventories you can defend as yours: the address ranges (and any autonomous system number) you are assigned, the domains and subdomains you control, and the certificates issued for them. Everything below filters by one of these; searching by product or port alone returns other people’s systems. The labs in the Domain, IP and Certificate Recon course build these inventories for a domain of your own.

Shodan filters for your own assets

The Shodan filter reference lists the filters below. Written as filtername:value with no space, and with quotes around values that contain spaces:

  1. net: restricts results to a CIDR range.
  2. asn: matches an autonomous system number, useful only if your organisation holds its own. Avoid org:: it matches the owner of the address space, often your ISP or cloud provider, so it returns other customers’ systems.
  3. hostname: matches hostnames containing the value, so check that each result’s name is yours.
  4. ssl.cert.subject.cn: matches the subject common name of a certificate, which finds hosts serving your certificates on addresses you did not list. Shodan’s examples show a bare domain such as lab.example also matching certificates for *.lab.example.
  5. port: and product: narrow results to a port or a software product.

The reference marks only tag and vuln as restricted, but plan rules change.

Searches are a snapshot you run by hand. Shodan Monitor does the watching: you add your network ranges or domains (a domain covers its subdomains), it crawls them continuously, and it sends notifications by email or to chat and ticketing tools when something new appears. It also offers on-demand scans to confirm a fix, but a domain covers every address in its zone, so a match may be a provider’s, CDN’s or vendor’s: confirm an address is yours before scanning it.

Censys for your hosts and certificates

Censys has moved from Legacy Search to the Censys Platform, which has a new data model, so older query examples need rewriting (its Query Converter helps). The Platform’s query language, CenQL, is documented on the Censys Query Language page. A field-value query is written field: value for a case-insensitive tokenised match or field=value for an exact match (case-sensitive for strings), combined with and, or and not. Useful fields include host.ip (a CIDR block goes in quotes), host.services.port, host.services.protocol, host.autonomous_system.asn and cert.names. With :, cert.names also matches subdomains, so cert.names: "lab.example" returns certificates for corp.lab.example too. Censys also sells attack surface management that takes your domains, ranges and AS numbers as seeds and tracks what it finds. Field names changed with the move (services.service_name became host.services.protocol), so check the in-app data definitions.

The categories that most often appear

Describe a finding by its category, then verify it:

  1. Remote desktop and remote administration reachable from anywhere.
  2. Databases and search or cache servers listening on a public address with no authentication configured.
  3. Cameras and network video recorders, sometimes installed by a facilities contractor and never added to the asset list.
  4. Building, energy and industrial controllers, and their protocol gateways.
  5. VPN, firewall and admin web panels, including management interfaces left on the outside.
  6. Test, staging and forgotten hosts, which show up through your certificates.

If you operate vessels or fleet terminals, include ship-side systems such as satellite terminals in the review. The Transport Tracking: Aviation, Maritime and Rail course covers the position data ships broadcast and what outsiders can read from it.

What to do with a finding

  1. Confirm the address, hostname or certificate is yours and find its owner.
  2. Confirm the service is really exposed by checking from a host outside your network. The scanners hold a past observation, so the service may have changed since.
  3. Remove it from the internet, or place it behind a VPN or a firewall rule that names the sources that need it.
  4. Change default or shared credentials, enforce authentication, and patch.
  5. Record the asset, owner and decision in your inventory, then trigger a rescan and watch the alert clear.

Commands

Checked against the Shodan filter reference and search examples, and the Censys Query Language page (updated 5 November 2026) and host dataset page, as of 27 November 2026. These are web services with no version number. 198.51.100.0/24 is a documentation range, AS64496 a documentation AS number and lab.example a placeholder, so replace them with what you own.

# Shodan search box
net:198.51.100.0/24
asn:AS64496
hostname:lab.example
ssl.cert.subject.cn:lab.example
net:198.51.100.0/24 port:3389

# Censys Platform search box (CenQL)
host.ip: "198.51.100.0/24"
host.ip: "198.51.100.0/24" and host.services.port=3389
host.autonomous_system.asn=64496
cert.names: "lab.example"

To check a range with a tool you run yourself, see Nmap scanning.

Detection and defence

A search of a scan database never touches your network. MITRE’s detection strategy for this sub-technique (DET0858) notes that the activity may happen outside the target’s visibility with a very high false positive rate, and points detection at later stages such as initial access. What you can see is the scanner traffic arriving at your edge. Censys publishes the IP ranges and AS numbers its scanners use on its opt-out page, and its HTTP scans send a CensysInspect/1.1 user agent, so you can recognise that traffic. Blocklisting those ranges stops Censys indexing a host from then on, but does not remove its historical data. Blocking one provider does not remove a service from other scanners or from an attacker’s own scan.

Defence is reducing exposure:

  1. Keep a current asset inventory of ranges, domains and certificates, and run the searches above on a schedule or through Shodan Monitor or Censys attack surface management.
  2. Close or filter services that need no public access, and require a VPN with multi-factor authentication for remote access.
  3. For operational technology, CISA and its partners (fact sheet, 6 May 2025) say to identify public-facing assets, remove OT connections to the public internet, change default passwords at once, and use a VPN with phishing-resistant multi-factor authentication where remote access is essential.
  4. Review certificate issuance, since a certificate names the hosts it is used on.

Where to go next

Practise this on your own footprint in the Domain, IP and Certificate Recon course, then confirm what is really open with a scan of your own ranges as described in Nmap scanning.

This article replaces the KSEC ARK notes first published in 2019.

More from this author