CLI Reference

censys

usage: censys [-h] [-v] {account,asm,config,hnri,search,subdomains,view} ...
-h, --help

show this help message and exit

-v, --version

display version

censys account

Check Censys account details and quota

usage: censys account [-h] [--api-id API_ID] [--api-secret API_SECRET] [-j]
-h, --help

show this help message and exit

--api-id <api_id>

a Censys API ID (alternatively you can use the env variable CENSYS_API_ID)

--api-secret <api_secret>

a Censys API SECRET (alternatively you can use the env variable CENSYS_API_SECRET)

-j, --json

Output in JSON format

censys asm

Interact with the Censys ASM API

usage: censys asm [-h]
                  {config,add-seeds,delete-seeds,delete-all-seeds,delete-labeled-seeds,replace-labeled-seeds,list-seeds,list-saved-queries,add-saved-query,get-saved-query-by-id,edit-saved-query-by-id,delete-saved-query-by-id}
                  ...
-h, --help

show this help message and exit

censys asm add-saved-query

Add a saved query to ASM

usage: censys asm add-saved-query [-h] [--api-key API_KEY] --query-name
                                  QUERY_NAME --query QUERY [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

--query-name <query_name>

Name of the saved query

--query <query>

Query string

-v, --verbose

verbose output

censys asm add-seeds

Add seeds to ASM

usage: censys asm add-seeds [-h] [--api-key API_KEY] [-v]
                            [--default-type {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}]
                            [--csv]
                            (--input-file INPUT_FILE | --json JSON | --nmap-xml NMAP_XML)
                            [-l LABEL]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-v, --verbose

verbose output

--default-type {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}

type of the seed(s) if type is not already provided (default: IP_ADDRESS)

--csv

process input in CSV format

--input-file <input_file>, -i <input_file>

input file name containing valid seeds in JSON format, unless –csv is specified (use - for stdin)

--json <json>, -j <json>

input string containing valid json seeds

--nmap-xml <nmap_xml>

input file name containing valid xml nmap output

-l <label>, --label <label>

label to apply to seeds without label (default: “”)

censys asm config

Configure Censys ASM API Settings

usage: censys asm config [-h]
-h, --help

show this help message and exit

censys asm delete-all-seeds

Delete all ASM seeds

usage: censys asm delete-all-seeds [-h] [--api-key API_KEY] [-f] [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-f, --force

force delete all (no confirmation prompt)

-v, --verbose

verbose output

censys asm delete-labeled-seeds

Delete all ASM seeds with specified label

usage: censys asm delete-labeled-seeds [-h] [--api-key API_KEY] -l LABEL [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-l <label>, --label <label>

label for which to delete all seeds

-v, --verbose

verbose output

censys asm delete-saved-query-by-id

Delete a saved query by ID

usage: censys asm delete-saved-query-by-id [-h] [--api-key API_KEY] --query-id
                                           QUERY_ID [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

--query-id <query_id>

ID of the saved query

-v, --verbose

verbose output

censys asm delete-seeds

Delete ASM seeds

usage: censys asm delete-seeds [-h] [--api-key API_KEY] [-v] [--csv]
                               (--input-file INPUT_FILE | --json JSON | --nmap-xml NMAP_XML)
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-v, --verbose

verbose output

--csv

process input in CSV format

--input-file <input_file>, -i <input_file>

input file name containing valid seeds in JSON format, unless –csv is specified (use - for stdin)

--json <json>, -j <json>

input string containing valid json seeds

--nmap-xml <nmap_xml>

input file name containing valid xml nmap output

censys asm edit-saved-query-by-id

Edit a saved query by ID

usage: censys asm edit-saved-query-by-id [-h] [--api-key API_KEY] --query-id
                                         QUERY_ID --query-name QUERY_NAME
                                         --query QUERY [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

--query-id <query_id>

ID of the saved query

--query-name <query_name>

Name of the saved query

--query <query>

Query string

-v, --verbose

verbose output

censys asm get-saved-query-by-id

Get a saved query by ID

usage: censys asm get-saved-query-by-id [-h] [--api-key API_KEY] --query-id
                                        QUERY_ID [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

--query-id <query_id>

ID of the saved query

-v, --verbose

verbose output

censys asm list-saved-queries

List all ASM saved queries, optionally filtered by query name prefix and filter term

usage: censys asm list-saved-queries [-h] [--api-key API_KEY]
                                     [--query-name-prefix QUERY_NAME_PREFIX]
                                     [--filter-term FILTER_TERM]
                                     [--page-size PAGE_SIZE] [--page PAGE]
                                     [--csv] [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

--query-name-prefix <query_name_prefix>

Prefix for the saved query name to filter by

--filter-term <filter_term>

Term used to filter the list of saved query names and the saved queries

--page-size <page_size>

Number of results to return. Defaults to 50.

--page <page>

Page number to begin at when searching. Defaults to 1.

--csv

output in CSV format (otherwise JSON)

-v, --verbose

verbose output

censys asm list-seeds

List all ASM seeds, optionally filtered by label and type

usage: censys asm list-seeds [-h] [--api-key API_KEY]
                             [-t {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}] [-l LABEL]
                             [--csv] [-v]
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-t {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}, --type {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}

type of the seed to list, if not specified, all types returned

-l <label>, --label <label>

label of seeds to list, if not specified, all labels returned

--csv

output in CSV format (otherwise JSON)

-v, --verbose

verbose output

censys asm replace-labeled-seeds

Replace all ASM seeds with specified label with new seeds

usage: censys asm replace-labeled-seeds [-h] [--api-key API_KEY] -l LABEL [-v]
                                        [--default-type {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}]
                                        [--csv]
                                        (--input-file INPUT_FILE | --json JSON | --nmap-xml NMAP_XML)
-h, --help

show this help message and exit

--api-key <api_key>

a Censys ASM API Key (alternatively you can use the env variable CENSYS_ASM_API_KEY)

-l <label>, --label <label>

label for which to replace all seeds

-v, --verbose

verbose output

--default-type {IP_ADDRESS,DOMAIN_NAME,CIDR,ASN}

type of the seed(s) if type is not already provided (default: IP_ADDRESS)

--csv

process input in CSV format

--input-file <input_file>, -i <input_file>

input file name containing valid seeds in JSON format, unless –csv is specified (use - for stdin)

--json <json>, -j <json>

input string containing valid json seeds

--nmap-xml <nmap_xml>

input file name containing valid xml nmap output

censys config

Configure Censys Search API Settings

usage: censys config [-h]
-h, --help

show this help message and exit

censys hnri

Home Network Risk Identifier (H.N.R.I.)

usage: censys hnri [-h] [--api-id API_ID] [--api-secret API_SECRET] [-O]
-h, --help

show this help message and exit

--api-id <api_id>

a Censys API ID (alternatively you can use the env variable CENSYS_API_ID)

--api-secret <api_secret>

a Censys API SECRET (alternatively you can use the env variable CENSYS_API_SECRET)

-O, --open

open your IP in browser

censys subdomains

Enumerates subdomains using the Censys Search Certificates index

usage: censys subdomains [-h] [--api-id API_ID] [--api-secret API_SECRET]
                         [--pages PAGES] [-j]
                         domain
domain

The base domain to search for

-h, --help

show this help message and exit

--api-id <api_id>

a Censys API ID (alternatively you can use the env variable CENSYS_API_ID)

--api-secret <api_secret>

a Censys API SECRET (alternatively you can use the env variable CENSYS_API_SECRET)

--pages <pages>

Max records to query

-j, --json

Output in JSON format

censys view

View a document in Censys Search by providing a document id and the resource index

usage: censys view [-h] [--api-id API_ID] [--api-secret API_SECRET]
                   [--index-type hosts|certificates] [-o OUTPUT] [-O]
                   [--at-time YYYY-MM-DD (HH:mm)]
                   document_id
document_id

a document id (IP address or SHA-256 certificate fingerprint) to view

-h, --help

show this help message and exit

--api-id <api_id>

a Censys API ID (alternatively you can use the env variable CENSYS_API_ID)

--api-secret <api_secret>

a Censys API SECRET (alternatively you can use the env variable CENSYS_API_SECRET)

--index-type {hosts,certificates}

which resource index to query

-o <output>, --output <output>

json output file path

-O, --open

open document in browser

--at-time <yyyy-mm-dd (hh:mm)>

Fetches a document at a given point in time