Pybinaryedge API¶
pybinaryedge¶
Python 3 Wrapper for the BinaryEdge API https://www.binaryedge.io/ https://github.com/Te-k/pybinaryedge
copyright: | Tek |
---|---|
license: | MIT Licence |
-
class
pybinaryedge.api.
BinaryEdge
(key: str, verify: bool = True)¶ Initializes a new instance of the BinaryEdge class.
- Args:
- key: The BinaryEdge API key verify: Enable or disable SSL verification. Default is enabled.
-
dataleaks_email
(email: str) → Dict[str, Any]¶ Allows you to search across multiple data breaches to see if any of your email addresses has been compromised. https://docs.binaryedge.io/api-v2/#v2querydataleaksemailemail
- Args:
- email: email address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeNotFound: if the email address is not found by BE BinaryEdgeException: if anything else than 200 is returned by BE
-
dataleaks_info
() → Dict[str, Any]¶ Get the list of dataleaks our platform keeps track. https://docs.binaryedge.io/api-v2/#v2querydataleaksinfo
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
dataleaks_organization
(domain: str) → Dict[str, Any]¶ Verify how may emails are affected by dataleaks for a specific domain We don’t provide the list of affected emails. https://docs.binaryedge.io/api-v2/#v2querydataleaksorganizationdomain
- Args:
- email: email address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
domain_dns
(domain: str, page: int = 1) → Dict[str, Any]¶ Return list of dns results known from the target domain. https://docs.binaryedge.io/api-v2/#v2querydomainsdnstarget
- Args:
- domain: domain queried page: page result (default is 1)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
-
domain_ip
(ip: str, page: int = 1) → Dict[str, Any]¶ Return records that have the specified IP in their A or AAAA records. https://docs.binaryedge.io/api-v2/#v2querydomainsiptarget
- Args:
- IP: IP address queried page: page result (default is 1)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
-
domain_search
(query: str, page: int = 1) → Dict[str, Any]¶ List of Domains/DNS data based on a Query. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2querydomainssearch
- Args:
- query: Search query in BinaryEdge page: page result (default is 1)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
-
domain_subdomains
(domain: str, page: int = 1) → Dict[str, Any]¶ Get a list of known subdomains for this domain https://docs.binaryedge.io/api-v2/#v2querydomainssubdomaintarget
- Args:
- domain: domain queried page: page result (default is 1)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
-
host
(ip: str) → Dict[str, Any]¶ Details about an Host. List of recent events for the specified host, including details of exposed ports and services. https://docs.binaryedge.io/api-v2/#host
- Args:
- ip: IP address (string)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
host_historical
(ip: str) → Dict[str, Any]¶ Details about an Host, with data up to 6 months. List of events for the specified host, with events for each time that: * A port was detected open * A service was found running * Other modules were successfully executed https://docs.binaryedge.io/api-v2/#v2queryiphistoricaltarget
- Args:
- ip: IPv4 address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
host_score
(ip: str) → Dict[str, Any]¶ IP Risk Score. Scoring is based on all information found on our databases regarding an IP and refers to the level of exposure of a target, i.e, the higher the score, the greater the risk of exposure. https://docs.binaryedge.io/api-v2/#v2queryscoreiptarget
- Args:
- ip: IPv4 address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
host_search
(query: str, page: int = 1) → Dict[str, Any]¶ Events based on a Query. List of recent events for the given query, including details of exposed ports and services. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2querysearch
- Args:
- query: Search query in BinaryEdge page: page number
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
host_vulnerabilities
(ip: str) → Dict[str, Any]¶ Give list of CVE vulnerabilities that may affect a given IP
- Args:
- ip: IP address (string)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
image_ip
(ip: str) → Dict[str, Any]¶ Details about Remote Desktops found on an Host. List of screenshots and details extracted from them for the specified host, including OCR and whether faces were found or not, with data up to 2 months. https://docs.binaryedge.io/api-v2/#v2queryimageipip
- Args:
- ip: IPv4 address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
image_search
(query: str, page: int = 1) → Dict[str, Any]¶ Remote Desktops based on a Query. List of screenshots and details extracted from them for the given query, including OCR and whether faces were found or not. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2queryimagesearch
- Args:
- query: Search query in BinaryEdge page: page number
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
Get the list of possible tags for the images https://docs.binaryedge.io/api-v2/#v2queryimagetags
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
sensor_ip
(target: str) → Dict[str, Any]¶ Details about an Scanner. List of recent events form the specified host, including details of scanned ports, payloads and tags. https://docs.binaryedge.io/api-v2/#v2querysensorsiptarget
- Args:
- target: [String] target IP address or CIDR up to /24
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned BinaryEdgeNotFound: if the target has not been seen by sensors
-
sensor_search
(query: str, page: int = 1) → Dict[str, Any]¶ Events based on a Query. List of recent events for the given query, including details of scanned ports, payloads and tags. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2querysensorssearch
- Args:
- query: [String] String used to query our data. If no filters are
- used, it will perform a full-text search on the entire events
page: [Int] Optional. Default 1, Maximum: 500 (10,000 results)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
- Example:
- be.sensor_search(‘tags:ssh_scanner’)
-
sensor_search_stats
(query: str, type: str, days: int = 60) → Dict[str, Any]¶ Statistics of events for the given query. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2querysensorssearchstats
- Args:
- query: [String] String used to query our data. If no filters are
- used, it will perform a full-text search on the entire events.
- type: [String] Type of statistic we want to obtain.
- Possible types include: ports, tags, countries, asn, ips, payloads, http_path.
- days: [Integer] Number of days to get the stats for.
- For example days=1 for the last day of data.
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
- or if type is not correct
- Example:
- be.sensor_search_stats(‘tags:ssh_scanner’, ‘ports’)
-
stats
(query: str, type: str, page: int = 1) → Dict[str, Any]¶ Statistics of recent events for the given query. Can be used with specific parameters and/or full-text search. https://docs.binaryedge.io/api-v2/#v2querysearchstats
- Args:
query: String used to query our data type: Type of statistic we want to obtain. Possible types include:
ports, products, versions, tags, services, countries, asn.page: page result (default is 1)
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned
-
torrent_historical_ip
(ip: str) → Dict[str, Any]¶ Details about torrents transferred by an Host, with data up to 6 months List of torrent events for the specified host, with events for each time that a new transfer was detected on the DHT. https://docs.binaryedge.io/api-v2/#v2querytorrenthistoricaltarget
- Args:
- ip: IPv4 address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
torrent_ip
(ip: str) → Dict[str, Any]¶ Details about torrents transferred by an Host. List of recent torrent events for the specified host, including details of the peer and torrent. https://docs.binaryedge.io/api-v2/#v2querytorrentiptarget
- Args:
- ip: IPv4 address
- Returns:
- A dict created from the JSON returned by BinaryEdge
- Raises:
- BinaryEdgeException: if anything else than 200 is returned by BE
-
exception
pybinaryedge.api.
BinaryEdgeException
(message: str)¶ Exception raised if a request to BinaryEdge returns anything else than 200
-
exception
pybinaryedge.api.
BinaryEdgeNotFound
¶ Exception raised if a request to BinaryEdge returns a 404 code