This script allows a user to query the Censys API from the command. The results from the query can be written to CSV, JSON, or simply to the screen.
pip install censys-command-line
Or
pip install git+https://github.com/censys/censys-command-line
usage: censys [-h] [--fields FIELDS [FIELDS ...]] --query_type
ipv4|certs|websites [--append {true,false}]
[--output json|csv|screen]
[--start_page START_PAGE]
[--max_pages MAX_PAGES]
[--censys_api_id XXXXXXXXXX]
[--censys_api_secret XXXXXXXXXX]
query
Search The Censys Data Set via the command line
positional arguments:
query
optional arguments:
-h, --help show this help message and exit
--fields FIELDS [FIELDS ...]
--query_type ipv4|certs|websites
--append {true,false}
Append the given list of fields to the default fields
--output json|csv|screen
--start_page START_PAGE
--max_pages MAX_PAGES
--censys_api_id XXXXXXXXXX
(optional) You must provide your Censys API ID here or
as an environmental variable CENSYS_API_ID
--censys_api_secret XXXXXXXXXX
(optional) You must provide your Censys API SECRET
here or as an environmental variable CENSYS_API_SECRET
censys "ip: [ 134.54.0.0 TO 134.54.65.255 ]" --query_type ipv4 --fields ip protocols --output json
censys "parsed.issuer.organization: Let's Encrypt" --query_type=certs