# searchDevice

**Identifier:** `shodan_searchDevice`

**Provider:** [Shodan](https://kirha.com/providers/shodan.md)

Search for internet-connected devices using Shodan's database

## Run it with the CLI

```bash
kirha tools run shodan_searchDevice \
  --input '{
    "query": "country:US"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "shodan_searchDevice",
  "input": {
    "query": "country:US"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "facets": {
      "description": "Comma-separated list of properties to get summary information. Available facets: country, city, org, isp, port, asn, product, version, os, domain, link, cloud.provider, cloud.region, cloud.service. Example: 'country,port,org'",
      "type": "string"
    },
    "limit": {
      "default": 10,
      "description": "Number of results to keep from the page (Shodan returns up to 100 per page, max 20 kept)",
      "maximum": 20,
      "minimum": 1,
      "type": "number"
    },
    "offset": {
      "default": 0,
      "description": "Number of results to skip, counted from the start of `page`. Pass the previous `nextOffset` (with `page` omitted) to walk every result; a new Shodan page is only fetched when crossing a multiple of 100",
      "maximum": 9007199254740991,
      "minimum": 0,
      "type": "integer"
    },
    "page": {
      "default": 1,
      "description": "Shodan page of 100 results to start from (each Shodan page fetched costs a query credit)",
      "minimum": 1,
      "type": "number"
    },
    "query": {
      "description": "Shodan search query. Format: 'keywords filter:value'. Common filters: country:CODE (e.g., 'country:US'), city:NAME, org:OrganizationName, port:NUMBER, product:NAME, os:NAME, hostname:DOMAIN, net:CIDR (e.g., 'net:192.168.0.0/16'), asn:NUMBER, has_screenshot:true, has_ssl:true, has_vuln:true, vuln:CVE-ID (e.g., 'vuln:CVE-2014-0160'), http.title:PageTitle, http.status:CODE, ssl.cert.subject.cn:DOMAIN, hash:NUMBER (banner hash). Use quotes for multi-word values. Example: 'apache country:US port:443 has_ssl:true' or 'org:Amazon product:nginx'",
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "facets": {
      "anyOf": [
        {
          "additionalProperties": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "count": {
                  "type": "number"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "count"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "propertyNames": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "matches": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "asn": {
            "type": [
              "string",
              "null"
            ]
          },
          "data": {
            "description": "Raw service banner, cut to the first 3000 characters",
            "type": "string"
          },
          "domains": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "hostnames": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ip": {
            "type": "string"
          },
          "isp": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "additionalProperties": false,
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "country": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "region": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "country",
              "city",
              "region"
            ],
            "type": "object"
          },
          "organization": {
            "type": [
              "string",
              "null"
            ]
          },
          "os": {
            "type": [
              "string",
              "null"
            ]
          },
          "port": {
            "type": "number"
          },
          "product": {
            "type": [
              "string",
              "null"
            ]
          },
          "timestamp": {
            "type": "string"
          },
          "transport": {
            "type": "string"
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "vulns": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "CVE IDs, first 50 listed"
          },
          "vulnsCount": {
            "description": "Total CVE IDs reported for this service",
            "type": "number"
          }
        },
        "required": [
          "ip",
          "port",
          "organization",
          "hostnames",
          "domains",
          "location",
          "asn",
          "isp",
          "product",
          "version",
          "os",
          "transport",
          "data",
          "timestamp",
          "vulns",
          "vulnsCount"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "nextOffset": {
      "description": "Offset of the next result to request, null when none remain",
      "type": [
        "number",
        "null"
      ]
    },
    "total": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "total",
    "nextOffset",
    "matches",
    "facets"
  ],
  "type": "object"
}
```

-----

[All Shodan tools](https://kirha.com/providers/shodan.md) · [< Back to tools list](https://kirha.com/tools.md)