{
  "id": "shodan",
  "name": "Shodan",
  "homepage": "https://www.shodan.io/",
  "description": "Shodan is a search engine for Internet-connected devices.",
  "executables": [
    "shodan"
  ],
  "dotfiles": {
    "paths": [],
    "secret": [
      "~/.shodan/api_key",
      "~/.config/shodan/api_key"
    ]
  },
  "commands": {
    "format": 1,
    "label": "Shodan",
    "description": "Search Shodan, look up a host or domain, and count results. Needs an API key set with shodan init. Download, stream, alerts and scanning are left out.",
    "quality": "ai-draft",
    "parser": {
      "end_of_options": "--",
      "interleave": "permute",
      "long_equals": true,
      "short_attached": true,
      "short_bundles": false
    },
    "subcommand": [
      {
        "path": [
          "search"
        ],
        "label": "Search",
        "description": "Search Shodan and print matching banners.",
        "source": [
          {
            "id": "shodan-src",
            "kind": "manual",
            "url": "https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py",
            "revision": "shodan-python master",
            "evidence": "@main.command()\n@click.option('--fields', help='List of properties to show in the search results.', default='ip_str,port,hostnames,data')\n@click.option('--limit', help='The number of search results that should be returned. Maximum: 1000', default=100, type=int)\n@click.option('--separator', help='The separator between the properties of the search results.', default='\\t')\n@click.argument('query', metavar='<search query>', nargs=-1)\ndef search(color, fields, limit, separator, query):"
          }
        ],
        "field": [
          {
            "id": "query",
            "label": "Search query",
            "type": "string",
            "position": 0,
            "multiple": true,
            "min": 1,
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "limit",
            "label": "Result limit",
            "type": "integer",
            "option": [
              "--limit"
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "fields",
            "label": "Fields",
            "description": "Comma-separated properties.",
            "type": "string",
            "option": [
              "--fields"
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "separator",
            "label": "Separator",
            "type": "string",
            "option": [
              "--separator"
            ],
            "sources": [
              "shodan-src"
            ]
          }
        ],
        "task": [
          {
            "id": "search",
            "label": "Search",
            "fields": [
              "query",
              "limit",
              "fields"
            ],
            "required": [
              "query"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "query",
              "limit",
              "fields"
            ]
          },
          {
            "id": "advanced",
            "label": "Advanced",
            "fields": [
              "separator"
            ]
          }
        ]
      },
      {
        "path": [
          "host"
        ],
        "label": "Host lookup",
        "description": "Show everything known about an IP address.",
        "source": [
          {
            "id": "shodan-src",
            "kind": "manual",
            "url": "https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py",
            "revision": "shodan-python master",
            "evidence": "@main.command()\n@click.option('--format', help='The output format for the host information. Possible values are: pretty, tsv.', default='pretty', type=click.Choice(['pretty', 'tsv']))\n@click.option('--history', help='Show the complete history of the host.', default=False, is_flag=True)\n@click.option('--filename', '-O', help='Save the host information in the given file (append if file exists).', default=None)\n@click.argument('ip', metavar='<ip address>')\ndef host(format, history, filename, save, ip):"
          }
        ],
        "field": [
          {
            "id": "ip",
            "label": "IP address",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "history",
            "label": "Include history",
            "type": "boolean",
            "option": [
              "--history"
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "format",
            "label": "Format",
            "type": "enum",
            "option": [
              "--format"
            ],
            "choices": [
              {
                "value": "pretty",
                "label": "Pretty"
              },
              {
                "value": "tsv",
                "label": "TSV"
              }
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "filename",
            "label": "Save to file",
            "type": "path",
            "option": [
              "--filename",
              "-O"
            ],
            "path": {
              "kind": "file",
              "role": "output"
            },
            "sources": [
              "shodan-src"
            ]
          }
        ],
        "task": [
          {
            "id": "host",
            "label": "Look up an IP",
            "fields": [
              "ip",
              "history",
              "format"
            ],
            "required": [
              "ip"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "ip",
              "history",
              "format",
              "filename"
            ]
          }
        ]
      },
      {
        "path": [
          "count"
        ],
        "label": "Count results",
        "description": "Count how many results match a query.",
        "source": [
          {
            "id": "shodan-src",
            "kind": "manual",
            "url": "https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py",
            "revision": "shodan-python master",
            "evidence": "@main.command()\n@click.argument('query', metavar='<search query>', nargs=-1)\ndef count(query):"
          }
        ],
        "field": [
          {
            "id": "query",
            "label": "Search query",
            "type": "string",
            "position": 0,
            "multiple": true,
            "min": 1,
            "sources": [
              "shodan-src"
            ]
          }
        ],
        "task": [
          {
            "id": "count",
            "label": "Count",
            "fields": [
              "query"
            ],
            "required": [
              "query"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "query"
            ]
          }
        ]
      },
      {
        "path": [
          "domain"
        ],
        "label": "Domain info",
        "description": "Show DNS records and subdomains for a domain.",
        "source": [
          {
            "id": "shodan-src",
            "kind": "manual",
            "url": "https://github.com/achillean/shodan-python/blob/master/shodan/__main__.py",
            "revision": "shodan-python master",
            "evidence": "@main.command(name='domain')\n@click.argument('domain', metavar='<domain>')\n@click.option('--details', '-D', help='Lookup host information for any IPs in the domain results', default=False, is_flag=True)\n@click.option('--history', '-H', help='Include historical DNS data in the results', default=False, is_flag=True)\n@click.option('--type', '-T', help='Only returns DNS records of the provided type', default=None)"
          }
        ],
        "field": [
          {
            "id": "domain",
            "label": "Domain",
            "type": "string",
            "position": 0,
            "min": 1,
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "details",
            "label": "Look up host details",
            "type": "boolean",
            "option": [
              "--details",
              "-D"
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "history",
            "label": "Historical DNS data",
            "type": "boolean",
            "option": [
              "--history",
              "-H"
            ],
            "sources": [
              "shodan-src"
            ]
          },
          {
            "id": "type",
            "label": "Record type",
            "type": "string",
            "option": [
              "--type",
              "-T"
            ],
            "suggestions": [
              {
                "value": "A",
                "label": "A"
              },
              {
                "value": "MX",
                "label": "MX"
              },
              {
                "value": "TXT",
                "label": "TXT"
              }
            ],
            "sources": [
              "shodan-src"
            ]
          }
        ],
        "task": [
          {
            "id": "domain",
            "label": "Look up a domain",
            "fields": [
              "domain",
              "type"
            ],
            "required": [
              "domain"
            ]
          }
        ],
        "group": [
          {
            "id": "basic",
            "label": "Basic",
            "fields": [
              "domain",
              "details",
              "history",
              "type"
            ]
          }
        ]
      }
    ]
  }
}
