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 端點已棄用。
可以使用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 版獲得許可