Skip to main content

Shodan Integration Guide

Overview

The Shodan integration allows your NINA workflows to connect with Shodan, a search engine for internet-connected devices. This integration enables automated asset discovery, vulnerability scanning, network monitoring, and threat intelligence enrichment directly from your workflows.

Status

The integration currently supports 26 operations across 6 resources:

  • Host Lookup & Search: Look up IP addresses, search for devices, count results, and explore available search facets and filters
  • DNS Intelligence: Resolve hostnames, reverse DNS lookup, and enumerate subdomains and DNS entries for domains
  • On-Demand Scanning: Request Shodan to crawl IP addresses and netblocks, check scan status, and list available ports and protocols
  • Network Alerts: Create and manage network monitoring alerts with configurable triggers for change detection
  • Account Management: View API plan details, remaining credits, and account profile information
  • Utility Tools: Get your public IP address and inspect HTTP headers

Advanced features include:

  • Faceted Search: Break down search results by country, organization, port, OS, and 80+ other properties
  • Query Tokenization: Analyze and validate search queries before execution
  • Alert Triggers: Monitor for malware, industrial control systems, uncommon services, and more
  • CIDR Support: Scan and monitor entire network ranges using CIDR notation

Credential Configuration

Before using the Shodan integration in your workflows, you need to configure credentials for authentication. The integration uses API key authentication.

Authentication Method

FieldDescriptionExample
API KeyYour Shodan API keyaBcDeFgHiJkLmNoPqRsTuVwXyZ123456

How to obtain your API Key:

  1. Visit Shodan and create an account
  2. Confirm your email address
  3. Your API key is displayed on the account dashboard
  4. Copy the API key for use in your credential configuration

API Plans:

  • Free (OSS): Basic access to count, facets, filters, tokens, ports, protocols, tools, and account endpoints
  • Membership ($49 one-time): Adds host lookup, search, DNS resolve/reverse, and 100 query/scan credits
  • Freelancer ($69/month): 10,000 query credits, 5,120 scan credits, commercial use
  • Small Business ($359/month): 200,000 query credits, vulnerability search
  • Corporate ($1,099/month): Unlimited queries, all filters, batch lookups

Important Notes:

  • Free tier is limited to 1 request per second
  • Some operations (host lookup, search, DNS) require at least a Membership plan
  • On-demand scanning and alerts require a paid subscription plan
  • Query credits are consumed when using search filters or accessing results past page 1

Creating a Shodan Credential

  1. Navigate to the Credentials section in NINA
  2. Click Add New Credential
  3. Fill in the credential details:
    • Name: A descriptive name (e.g., "Shodan Production")
    • Description: Optional details about the credential's purpose
    • Integration Service: Select "Shodan"
    • API Key: Paste your Shodan API key
  4. Click Test Connection to verify credentials
  5. Click Save to store the credential

Supported Resources and Operations

Host

OperationNameDescriptionPlan Required
getGet HostGet all information on an IP (ports, services, location)Membership+
searchSearch HostsSearch Shodan using query syntaxMembership+
countCount HostsGet match count and facet info without resultsFree
facetsList Search FacetsGet available facet propertiesFree
filtersList Search FiltersGet available search filter keywordsFree
tokensBreak Search Into TokensAnalyze a query string into componentsFree

DNS

OperationNameDescriptionPlan Required
resolveResolve DomainResolve hostnames to IP addressesMembership+
reverseReverse DNS LookupLook up hostnames for IP addressesMembership+
domainDomain InformationGet subdomains and DNS entries for a domainMembership+ (1 credit)

Account

OperationNameDescriptionPlan Required
infoAPI InfoGet API plan details and remaining creditsFree
profileAccount ProfileGet account informationFree

Scan

OperationNameDescriptionPlan Required
createRequest ScanCrawl IP/netblock (1 IP = 1 scan credit)Paid
statusGet Scan StatusCheck scan progressPaid
listList ScansList all active on-demand scansPaid
portsList PortsList port numbers Shodan crawlers checkFree
protocolsList ProtocolsList protocols for on-demand scansFree

Alert

OperationNameDescriptionPlan Required
createCreate AlertCreate network monitoring alertPaid
listList AlertsList all active alertsPaid
getGet AlertGet details for a specific alertPaid
editEdit AlertUpdate monitored networksPaid
deleteDelete AlertRemove an alertPaid
listTriggersList TriggersList available alert triggersPaid
enableTriggerEnable TriggerEnable trigger on an alertPaid
disableTriggerDisable TriggerDisable trigger on an alertPaid

Tools

OperationNameDescriptionPlan Required
myipMy IP AddressGet your public IP addressFree
httpheadersHTTP HeadersShow client HTTP headersFree

Parameter Merging

The Shodan integration takes full advantage of NINA's parameter merging capabilities:

Parameter Sources (in order of precedence)

  1. Node Parameters: Parameters configured directly in the Shodan Integration Node
  2. Extracted Parameters: Parameters automatically extracted from the input data
  3. Input Data: The complete input data from upstream nodes

When a Shodan Integration Node executes:

  • It combines parameters from all sources
  • Node parameters take precedence over extracted parameters
  • The combined parameters are used to execute the Shodan operation

Examples

Looking Up a Host

{
"resource": "host",
"operation": "get",
"parameters": {
"ip": "8.8.8.8",
"minify": false
}
}

This returns all available information about the IP address including open ports, running services, banners, location data, and organization details.

Searching for Devices

{
"resource": "host",
"operation": "search",
"parameters": {
"query": "apache country:US port:443",
"facets": "org,country",
"page": 1,
"minify": true
}
}

This searches for Apache servers in the US on port 443, with faceted breakdowns by organization and country.

Counting Search Results

{
"resource": "host",
"operation": "count",
"parameters": {
"query": "port:22 os:Linux",
"facets": "country,org"
}
}

This returns the total number of matching hosts and facet breakdowns without consuming query credits.

Analyzing a Search Query

{
"resource": "host",
"operation": "tokens",
"parameters": {
"query": "Raspbian port:22 country:DE"
}
}

This breaks the query into its filters and string components, useful for validating queries before execution.

Resolving Hostnames

{
"resource": "dns",
"operation": "resolve",
"parameters": {
"hostnames": "google.com,github.com,cloudflare.com"
}
}

This resolves multiple hostnames to their IP addresses in a single call.

Reverse DNS Lookup

{
"resource": "dns",
"operation": "reverse",
"parameters": {
"ips": "8.8.8.8,1.1.1.1,208.67.222.222"
}
}

This looks up the hostnames associated with each IP address.

Domain Enumeration

{
"resource": "dns",
"operation": "domain",
"parameters": {
"domain": "example.com"
}
}

This returns all subdomains and DNS entries for the domain. Uses 1 query credit.

Requesting an On-Demand Scan

{
"resource": "scan",
"operation": "create",
"parameters": {
"ips": "203.0.113.0/24,198.51.100.1"
}
}

This requests Shodan to crawl the specified network range and IP. Each IP costs 1 scan credit.

Checking Scan Status

{
"resource": "scan",
"operation": "status",
"parameters": {
"id": "R2Vx5LcK3x8PQWKN"
}
}

This checks the progress of a scan. Status values: SUBMITTING, QUEUE, PROCESSING, DONE.

Creating a Network Alert

{
"resource": "alert",
"operation": "create",
"parameters": {
"name": "Production Servers Monitor",
"ips": "203.0.113.0/24,198.51.100.1",
"expires": 0
}
}

This creates a persistent alert to monitor the specified IP ranges for changes.

Enabling a Trigger on an Alert

{
"resource": "alert",
"operation": "enableTrigger",
"parameters": {
"id": "HKVGAIRWD79Z7W2T",
"trigger": "malware"
}
}

This enables malware detection notifications on the specified alert.

Getting Your Public IP

{
"resource": "tools",
"operation": "myip",
"parameters": {}
}

Returns your current public IP address as seen from the Internet.

Response Structure

Host Lookup Response

{
"ip_str": "8.8.8.8",
"org": "Google LLC",
"os": null,
"ports": [443, 53],
"city": "Mountain View",
"country_code": "US",
"country_name": "United States",
"isp": "Google LLC",
"asn": "AS15169",
"last_update": "2024-01-15T10:30:00.000000",
"data": [
{
"port": 443,
"transport": "tcp",
"product": "Google Frontend",
"ssl": { "cert": { "subject": { "CN": "dns.google" } } }
}
]
}

Search Response

{
"matches": [
{
"ip_str": "203.0.113.10",
"port": 443,
"org": "Example Corp",
"product": "Apache httpd",
"version": "2.4.41"
}
],
"facets": {
"country": [
{ "count": 4158554, "value": "US" },
{ "count": 1500465, "value": "JP" }
]
},
"total": 15521401
}

Count Response

{
"total": 15521401,
"facets": {
"country": [
{ "count": 4158554, "value": "US" },
{ "count": 1500465, "value": "JP" }
]
}
}

API Info Response

{
"plan": "dev",
"query_credits": 95,
"scan_credits": 100,
"monitored_ips": 16,
"usage_limits": {
"query_credits": 100,
"scan_credits": 100,
"monitored_ips": 16
}
}

DNS Resolve Response

{
"google.com": "142.250.185.238",
"facebook.com": "157.240.1.35"
}

Alert Response

{
"id": "HKVGAIRWD79Z7W2T",
"name": "Production Servers Monitor",
"created": "2024-01-15T10:30:00.000000",
"filters": {
"ip": ["203.0.113.0/24", "198.51.100.1"]
},
"triggers": {
"any": { "enabled": true },
"malware": { "enabled": false }
},
"expires": 0
}

Shodan Search Query Syntax

Shodan uses a powerful query syntax for searching. Here are commonly used filters:

FilterDescriptionExample
portFilter by port numberport:22
countryFilter by country codecountry:US
orgFilter by organizationorg:"Google LLC"
productFilter by software productproduct:nginx
osFilter by operating systemos:Linux
cityFilter by citycity:"San Francisco"
netFilter by CIDR rangenet:203.0.113.0/24
hostnameFilter by hostnamehostname:example.com
has_sslFilter for SSL supporthas_ssl:true
http.titleFilter by page titlehttp.title:"Dashboard"
http.statusFilter by HTTP statushttp.status:200
ssl.cert.subject.cnFilter by SSL cert CNssl.cert.subject.cn:example.com
vulnFilter by vulnerabilityvuln:CVE-2021-44228

Use the host.facets and host.filters operations to get the complete list of available properties.

Alert Trigger Types

TriggerDescription
anyAny change detected on the monitored network
malwareMalware detected on monitored IPs
industrial_control_systemICS/SCADA systems detected
internet_scannerKnown scanner detected
new_serviceNew service/port detected
open_databaseOpen database detected
ssl_expiredExpired SSL certificate detected
uncommonUncommon service or port detected
vulnerabilityKnown vulnerability detected

Integration in Workflow Context

The Shodan integration is particularly effective for security operations and threat intelligence workflows:

Common Workflow Patterns:

  1. Asset Discovery & Inventory:

    • Schedule Node -> Shodan Node (search) -> Script Node (parse results) -> Database Node (update inventory) -> Alert Node (new assets)
  2. Vulnerability Monitoring:

    • Schedule Node -> Shodan Node (alert create) -> Shodan Node (enableTrigger: vulnerability) -> Webhook -> Incident Response Workflow
  3. DNS Reconnaissance:

    • Input Node (domain list) -> Shodan Node (dns domain) -> Script Node (enumerate subdomains) -> Shodan Node (host get per IP) -> Report Node
  4. Perimeter Monitoring:

    • Schedule Node -> Shodan Node (search: net:your-range) -> Script Node (diff with baseline) -> Alert Node (unexpected services)
  5. Threat Intelligence Enrichment:

    • IOC Feed Node -> Shodan Node (host get) -> Script Node (extract service banners) -> SIEM Node (enrich indicators)
  6. On-Demand Security Assessment:

    • Trigger Node (new asset) -> Shodan Node (scan create) -> Wait Node -> Shodan Node (scan status) -> Shodan Node (host get) -> Report Node
  7. Certificate Monitoring:

    • Schedule Node -> Shodan Node (search: ssl.cert.subject.cn:yourdomain.com) -> Script Node (check expiry) -> Alert Node (expiring certs)

Best Practices

  1. Use Count Before Search: Use host.count to estimate result size before executing host.search to manage query credit consumption.

  2. Leverage Facets: Use faceted search to get statistical breakdowns without iterating through all results.

  3. Respect Rate Limits: Free tier allows 1 request per second. Implement delays between calls in workflows.

  4. Monitor Credit Usage: Use account.info to check remaining query and scan credits before running credit-consuming operations.

  5. Use Minify for Large Searches: Enable the minify parameter when you only need basic host information to reduce response size.

  6. Set Alert Expiration: Use the expires parameter on alerts to auto-cleanup temporary monitoring configurations.

  7. Validate Queries First: Use host.tokens to validate and analyze search queries before executing them.

  8. Batch DNS Lookups: Both dns.resolve and dns.reverse accept comma-separated lists, so batch multiple lookups into single calls.

  9. Cache Reference Data: Cache results from host.facets, host.filters, scan.ports, and scan.protocols as they change infrequently.

  10. Handle Paid-Only Errors: Many operations return 403 on free plans. Implement graceful fallbacks in workflows.

Troubleshooting

Common Issues and Solutions

IssuePossible Solution
401 UnauthorizedVerify API key is valid on the account page
403 Requires membershipOperation needs at least a Membership plan ($49 one-time)
403 Requires paid planScanning and alerts require a paid subscription
Rate limit exceededImplement 1-second delays between requests on free tier
No results for host lookupIP may not have been recently scanned by Shodan crawlers
Query credits exhaustedCheck credits via account.info; upgrade plan or wait for monthly reset
Scan credits exhaustedCheck remaining credits; each IP costs 1 scan credit
Empty search resultsVerify query syntax using host.tokens; check if filters require paid plan
Connection timeoutCheck network connectivity; Shodan API may be under heavy load

Error Response Format

{
"error": "Requires membership or higher to access"
}

Common Error Codes

Status CodeDescription
401Unauthorized - Invalid or missing API key
403Forbidden - Operation requires a higher plan tier
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Shodan service issue

Support

If you encounter issues with the Shodan integration, please contact our support team with:

  • The operation you were attempting
  • Your API plan tier (visible via account.info)
  • Any error messages received
  • The parameters you were using
  • The workflow context where the issue occurred

Additional Resources

Updated: 2026-03-25