Skip to content

Shodan and IPInfo

Shodan

Shodan is a search engine for devices connected to the internet. For each IP it returns information about the services it has exposed.

What it returns

from src.tools.shodan_tool import shodan_host_lookup
result = await shodan_host_lookup("185.220.101.34")
FieldDescription
portsList of open ports
hostnamesAssociated hostnames
domainsDomains
country_nameCountry
cityCity
orgOrganization
ispISP
asnASN
vulnsCVEs detected in exposed services
dataService banners with detailed information

Service information

For each open port, Shodan returns the service banner:

{
"port": 22,
"transport": "tcp",
"product": "OpenSSH",
"version": "8.9p1",
"data": "SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.6"
}

This allows you to identify:

  • Software versions (and therefore known vulnerabilities)
  • Technologies in use
  • Unusual configurations

Detected CVEs

If Shodan detects vulnerable versions, it lists the CVEs:

vulns: ["CVE-2023-38408", "CVE-2023-51384"]

Free tier

Shodan has a very limited free tier: 100 queries/month. The 24h cache helps, but use this tool selectively.

Use cases in OSINT

  • Identify Tor nodes / VPNs (port 9001, 9030)
  • Detect C2 servers (non-standard ports with suspicious banners)
  • Verify infrastructure of a domain
  • Find exposed IoT devices

IPInfo

IPInfo provides accurate geolocation and network context for IPs.

What it returns

from src.tools.ipinfo import ipinfo_lookup
result = await ipinfo_lookup("185.220.101.34")
FieldDescription
ipIP queried
hostnameReverse hostname (PTR)
cityCity
regionRegion/state
countryCountry code (ISO)
locGPS coordinates
orgOrganization (ASN + name)
postalPostal code
timezoneTime zone

Advantage over other services

IPInfo has one of the best free tiers: 50,000 requests/month. For most use cases, it is effectively unlimited.

IPInfo’s geolocation is especially accurate for:

  • Identifying proxies and VPNs (org usually shows the provider name)
  • Detecting shared vs dedicated hosting
  • Correlating with geographic patterns of a campaign

Example output

[IPInfo] 185.220.101.34
├─ Hostname: tor-exit-nl-01.example.net
├─ City: Amsterdam
├─ Region: North Holland
├─ Country: NL (Netherlands)
├─ Coordinates: 52.3667, 4.9000
├─ Organization: AS53667 Frantech Solutions
└─ Timezone: Europe/Amsterdam