passivetotal rest api的客户端
passivetotal的Python项目详细描述
简介
riskiq的passivetotal api服务的python客户端
passivetotal在riskiq api中提供了一个python客户端库实现 服务。库当前支持以下服务:
- 被动DNS查询和筛选器
- whois查询(搜索和详细信息)
- SSL证书(搜索和详细信息)
- 帐户配置
- 站点操作(标记、分类等)
命令行脚本
以下命令行脚本随库一起安装:
- pt config:设置或查询 库(用户名和api密钥)。
- pt info:用于查询本地帐户信息和服务的客户端。
- pt client:主要客户端对passivetotal服务发出查询 包括被动dns、whois、ssl证书等。
有关详细信息,请参阅用法部分。
安装
从下载的源发行版:
$ python setup.py install
或者来自pypi:
$ pip install passivetotal [--upgrade]
这个包依赖于pythonRequests库。 如果未安装请求,则会将其作为依赖项安装。
设置
首次安装需要配置用于身份验证的API令牌和私钥:
$ pt-config setup <USERNAME> <API_KEY>
任何时候,都可以使用相同的实用程序查询当前的api配置参数:
$ pt-config show
配置参数存储在$home/.config/passivetotal/api_config.json中。
升级
我们的库通过futures支持python 3。在某些平台上,这会导致升级库时出现问题。执行更新时,请使用以下命令:
sudo pip install passivetotal –upgrade –ignore-installed six
用法
每个命令行脚本都有几个子命令可以传递给它。这个 命令的用法可以用-h/--help选项描述。
例如:
$ pt-client -h usage: pt-client [-h] {action,pdns,whois,ssl} ... PassiveTotal Command Line Client positional arguments: {action,pdns,whois,ssl} pdns Query passive DNS data whois Query WHOIS data ssl Query SSL certificate data action Query and input feedback optional arguments: -h, --help show this help message and exit
每个子命令都有进一步的帮助选项:
$ pt-client pdns -h usage: pt-client pdns [-h] --query QUERY [--sources SOURCES [SOURCES ...]] [--end END] [--start START] [--timeout TIMEOUT] [--unique] [--format {json,text,csv,stix,table,xml}] optional arguments: -h, --help show this help message and exit --query QUERY, -q QUERY Query for a domain, IP address or wildcard --sources SOURCES [SOURCES ...] CSV string of passive DNS sources --end END, -e END Filter records up to this end date (YYYY-MM-DD) --start START, -s START Filter records from this start date (YYYY-MM-DD) --timeout TIMEOUT, -t TIMEOUT Timeout to use for passive DNS source queries --unique Use this to only get back unique resolutons --format {json,text,csv,stix,table,xml} Format of the output from the query
所有命令都将具有--format选项以返回数字形式的原始响应 不同的格式,其中包含的信息通常比 默认,人类可读格式。
文档
有关详细信息,可以在“docs”目录中找到文档,请检查 github wiki,或者readthedocs。