二进制边缘API的Python3包装https://www.binary edge.io/
pybinaryedge的Python项目详细描述
PybinaryEdge
BinaryEdge API的Python3包装器https://www.binaryedge.io/。有关详细信息,请参阅APIv2 documentation,或Read the Docs上此库的文档。
安装
要安装此工具,建议使用virtual environments。
您可以使用pip install pybinaryedge
从pypi直接安装它。
然后您可以直接从以下来源安装:
git clone https://github.com/Te-k/pybinaryedge.git
cd pybinaryedge
pip install .
如果使用pipenv,则可以运行:
git clone https://github.com/Te-k/pybinaryedge.git
cd pybinaryedge
pipenv install
您需要在Binary Edge platform上拥有一个帐户,创建一个api密钥,并将cli工具配置为与binaryedge config --key KEY
API
请参阅Read the Docs上的文档。
示例:
frompybinaryedgeimportBinaryEdgebe=BinaryEdge(API_KEY)# Iterate over the first page of IPs having specific ssh configurationsearch='ssh.algorithms.encryption.keyword:"aes256-cbc" ssh.banner.keyword:"SSH-2.0-OpenSSH_LeadSec"'results=be.host_search(search)foripinresults['events']:print("%s"%(ip['target']['ip']))
实现的功能列表:
host(IP)
:Details about an Hosthost_historical(IP)
:Details about an Host, with data up to 6 monthshost_search(QUERY, PAGE)
:List of recent events for the given queryhost_score(IP)
:IP Scoring of an host.host_vulnerabilities(IP)
:可能影响主机的CVE漏洞列表image_ip(IP)
:Details about Remote Desktops found on an Hostimage_search(QUERY, PAGE)
:Remote Desktops based on a Queryimage_tags()
:Get the list of possible tags for the imagestorrent_ip(IP)
:Details about torrents transferred by an Hosttorrent_historical_ip(IP)
:Details about torrents transferred by an Host, with data up to 6 monthsdataleaks_email(EMAIL)
:Verify which dataleaks affect the target emaildataleaks_organization(DOMAIN)
:Verify how many emails are affected by dataleaks for a specific domaindataleaks_info()
:Get the list of dataleaks our platform keeps track.domain_subdomains(DOMAIN, PAGE)
:Return list of subdomains known from the target domaindomain_dns(DOMAIN, PAGE)
:Return list of dns results known from the target domain.domain_ip(IP, PAGE)
:Return records that have the specified IP in their A or AAAA records.sensor_ip(TARGET)
:Details about an Scanner. List of recent events form the specified host, including details of scanned ports, payloads and tags.sensor_search(QUERY, PAGE)
:Events based on a Query.sensor_search_status(QUERY, TYPE, DAYS)
:Statistics of events for the given query. :stats(QUERY, TYPE, PAGE)
:Statistics of recent events for the given query.
cli
此库还实现了一个cli binaryedge工具:
usage: binaryedge [-h] {config,ip,search,dataleaks} ...
Request BinaryEdge API
positional arguments:
{config,ip,search,dataleaks}
Commands
config Configure pybinary edge
ip Query an IP address
search Search in the database
dataleaks Search in the leaks database
domains Search information on a domain
optional arguments:
-h, --help show this help message and exit
示例:
$ binaryedge config --key KEY
$ binaryedge ip -i 149.202.178[.]130
{
"events": [
{
"port": 27017,
"results": [
{
"origin": {
"country": "sg",
"ip": "172.104.173.35",
"module": "grabber",
"ts": 1536782325059,
"type": "service-simple"
[SNIP]
更改日志
- 0.5:修复文档和代码中的错误。添加对
host_vulnerabilities
的支持
- 0.4:添加对BinaryEdge sensors 的支持
许可证
此代码在麻省理工学院许可下发布