censys python
v2.2.16
用于 Censys API (censys.io) 的易于使用且轻量级的 API 包装器。目前支持 Python 3.8+。该库已在 Python 3.8 和 3.x(当前版本 3.10)上进行了测试。
注意:自 2021 年 11 月 30 日起,Censys Search v1 端点已弃用。请开始使用 v2 端点来查询主机和证书,并查看我们的支持中心以获取资源。
可以使用pip
安装该库。
pip install censys
使用pip
进行升级。
pip install --upgrade censys
或者,您可以使用poetry
安装库。
git clone https://github.com/censys/censys-python.git
cd censys-python/
poetry install
或者,您可以通过将此行添加到~/.bashrc
、 ~/.zshrc
或等效项来为 CLI 启用制表符补全。
请注意,
search
命令中的字段名称支持自动完成。
eval " $( register-python-argcomplete censys ) "
要配置搜索凭据,请运行censys config
或设置CENSYS_API_ID
和CENSYS_API_SECRET
环境变量。
$ censys config
Censys API ID: XXX
Censys API Secret: XXX
Do you want color output ? [y/n]: y
Successfully authenticated for [email protected]
如果您有 Censys ASM 帐户,则可以通过运行censys asm config
来配置 ASM 凭据或设置两个CENSYS_ASM_API_KEY
环境变量。
$ censys asm config
Censys ASM API Key: XXX
Do you want color output ? [y/n]: y
Successfully authenticated
位于examples/
目录中的示例是一个很好的起点。您还可以在使用文档中找到更多示例。
我们始终欢迎所有贡献(无论多小)。请参阅为 Censys Python 做出贡献
该项目使用诗歌进行依赖管理。请确保您已安装最新版本。
git clone [email protected]:censys/censys-python.git
cd censys-python/
poetry install
# Run tests
poetry run pytest
# With coverage report
poetry run pytest --cov-report html
该软件根据 Apache 许可证 2.0 版获得许可