Odin SDK provides a way to search across various services related to cybersecurity, IP services, certificates, exposed files and more
Project description
Odin SDK for Python
ODIN's primary focus is to equip infosec teams with a precise depiction of the internet, enabling them to strengthen their security defences and proactively detect threats within their attack surface.
The Odin SDK for Go provides a simple way to interact with the Odin API and access various services related to cybersecurity, ip services, certificates, exposed files, domains and more.
Requirements
Python 2.7 and 3.4+
Installation & Usage
pip install
pip install odin-sdk
(you may need to run pip
with root permission: sudo pip install odin-sdk
)
Then import the package:
import odin
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import odin
from odin.rest import ApiException
from pprint import pprint
# Configure API key authorization: ApiKeyAuth
configuration = odin.Configuration()
configuration.api_key['X-API-Key'] = '<API-Key>'
# search exposed buckets (using pagination)
api_instance = odin.ExposedBucketsApi(odin.ApiClient(configuration))
try:
results, last = [], None
for _ in range(3):
resp = api_instance.v1_exposed_buckets_search_post(
{
"query": 'name:"lit-link-prd.appspot.com"',
"limit": 1,
"start": last,
}
)
results.extend(resp)
last = resp.get("pagination", {}).get("last")
except ApiException as e:
...
# search files in a exposed bucket
api_instance = odin.ExposedFilesApi(odin.ApiClient(configuration))
try:
resp = api_instance.v1_exposed_files_search_post(
{
"query": 'provider: aws',
"limit": 1,
"sortDir": "desc",
"sortBy": "files"
}
)
resp
except ApiException as e:
...
# search hosts
api_instance = odin.HostsApi(odin.ApiClient(configuration))
try:
resp = api_instance.v1_hosts_search_post(
{
"query": "(last_updated_at:[\"2024-07-08T02:41:15.528Z\" TO *] AND services.port:80) OR asn.number:AS63949",
"limit": 1
}
)
resp
except ApiException as e:
...
# certificates search
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
try:
resp = api_instance.v1_certificates_search_post(
{
"query": "certificate.subject_alt_name.dns_names:'cloudflare.com' AND certificate.validity.not_after:\"2024-09-20T18:19:24\"",
"limit": 1
}
)
resp
except ApiException as e:
...
# hosts cve ip
api_instance = odin.HostsApi(odin.ApiClient(configuration))
try:
resp = api_instance.v1_hosts_cve_ip_get("<ip>")
resp.to_dict()
except ApiException as e:
...
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
body = odin.CertificateCertCountRequest() # CertificateCertCountRequest | Count Query
try:
# Get records count
api_response = api_instance.v1_certificates_count_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_count_post: %s\n" % e)
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
hash = 'hash_example' # str | get the complete cert by hash
try:
# Get the complete certificate
api_response = api_instance.v1_certificates_hash_get(hash)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_hash_get: %s\n" % e)
# Configure API key authorization: ApiKeyAuth
configuration = odin.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
body = odin.CertificateNextBatchRequest() # CertificateNextBatchRequest | Search Query
try:
# Get the next batch of record
api_response = api_instance.v1_certificates_scroll_next_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_scroll_next_post: %s\n" % e)
# Configure API key authorization: ApiKeyAuth
configuration = odin.Configuration()
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
body = odin.CertificateCertScrollRequest() # CertificateCertScrollRequest | Search Query
try:
# Get the record based on query
api_response = api_instance.v1_certificates_scroll_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_scroll_post: %s\n" % e)
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
body = odin.CertificateCertSearchRequest() # CertificateCertSearchRequest | Search Query
try:
# Search records
api_response = api_instance.v1_certificates_search_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_search_post: %s\n" % e)
# create an instance of the API class
api_instance = odin.CertificateApi(odin.ApiClient(configuration))
body = odin.CertificateCertSummaryRequest() # CertificateCertSummaryRequest | Summary
try:
# Get summary
api_response = api_instance.v1_certificates_summary_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling CertificateApi->v1_certificates_summary_post: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.odin.io/
Class | Method | HTTP request | Description |
---|---|---|---|
CertificateApi | v1_certificates_count_post | POST /v1/certificates/count | Get records count |
CertificateApi | v1_certificates_hash_get | GET /v1/certificates/{hash} | Get the complete certificate |
CertificateApi | v1_certificates_scroll_next_post | POST /v1/certificates/scroll/next | Get the next batch of record |
CertificateApi | v1_certificates_scroll_post | POST /v1/certificates/scroll | Get the record based on query |
CertificateApi | v1_certificates_search_post | POST /v1/certificates/search | Search records |
CertificateApi | v1_certificates_summary_post | POST /v1/certificates/summary | Get summary |
ExposedBucketsApi | v1_exposed_buckets_count_post | POST /v1/exposed/buckets/count | Get exposed bucket count |
ExposedBucketsApi | v1_exposed_buckets_search_post | POST /v1/exposed/buckets/search | Search exposed buckets |
ExposedBucketsApi | v1_exposed_buckets_summary_post | POST /v1/exposed/buckets/summary | Get Exposed buckets summary |
ExposedFilesApi | v1_exposed_files_count_post | POST /v1/exposed/files/count | Get file count |
ExposedFilesApi | v1_exposed_files_search_post | POST /v1/exposed/files/search | Search exposed files |
ExposedFilesApi | v1_exposed_files_summary_post | POST /v1/exposed/files/summary | Get file summary |
FieldsApi | v1_fields_certificates_category_get | GET /v1/fields/certificates/{category}/ | Get the fields for certificates |
FieldsApi | v1_fields_exposed_buckets_get | GET /v1/fields/exposed/buckets/ | Get the fields for exposed |
FieldsApi | v1_fields_exposed_files_get | GET /v1/fields/exposed/files/ | Get the fields data |
FieldsApi | v1_fields_hosts_category_get | GET /v1/fields/hosts/{category}/ | Get the fields for hosts |
HealthApi | v1_ping_get | GET /v1/ping | Health Check |
HostsApi | v1_cves_all_ip_page_get | GET /v1/cves/all/{ip}/{page} | Get cve details |
HostsApi | v1_hosts_count_post | POST /v1/hosts/count | Get the record count |
HostsApi | v1_hosts_cve_ip_get | GET /v1/hosts/cve/{ip}/ | Get ip cve details |
HostsApi | v1_hosts_cves_ip_cve_get | GET /v1/hosts/cves/{ip}/{cve} | Get cve |
HostsApi | v1_hosts_exploits_ip_cve_get | GET /v1/hosts/exploits/{ip}/{cve} | Get exploits for ip and cve |
HostsApi | v1_hosts_exploits_ip_get | GET /v1/hosts/exploits/{ip}/ | Get exploits for ip |
HostsApi | v1_hosts_ip_get | GET /v1/hosts/{ip}/ | Get the latest ip details |
HostsApi | v1_hosts_search_post | POST /v1/hosts/search | Search hosts |
HostsApi | v1_hosts_summary_post | POST /v1/hosts/summary | Get summary |
HostsApi | v2_hosts_count_post | POST /v2/hosts/count | Fetch the record count |
HostsApi | v2_hosts_ip_post | POST /v2/hosts/{ip} | Fetch the latest ip details |
HostsApi | v2_hosts_search_post | POST /v2/hosts/search | Fetch the record based on query |
HostsApi | v2_hosts_summary_post | POST /v2/hosts/summary | Create the summary of the field based on query |
DomainApi | v1_domain_count_post | POST /v1/domain/count | Get domains count |
DomainApi | v1_domain_search_post | POST /v1/domain/search | Search domains |
DomainApi | v1_domain_subdomain_count_post | POST /v1/domain/subdomain/count | Fetch the total no. of subdomain records |
DomainApi | v1_domain_subdomain_search_post | POST /v1/domain/subdomain/search | Fetch the subdomain record |
DomainApi | v1_domain_whois_domain_name_get | GET /v1/domain/whois/{domain-name} | Fetch the domain whois record details |
DomainApi | v1_domain_whois_domain_name_historical_get | GET /v1/domain/whois/{domain-name}/historical | Fetch all the domain whois historical records |
DomainApi | v1_domain_whois_domain_name_is_expired_get | GET /v1/domain/whois/{domain-name}/is-expired | Get the expiry for a particular domain |
DomainApi | v1_domain_whois_domain_name_is_registered_get | GET /v1/domain/whois/{domain-name}/is-registered | Fetch all the domain whois historical records |
Documentation For Models
- APIResponse
- CertCount
- CertificateAPIResponse
- CertificateCertCount
- CertificateCertCountRequest
- CertificateCertScroll
- CertificateCertScrollRequest
- CertificateCertSearchRequest
- CertificateCertSummaryRequest
- CertificateCertificateHashResponse
- CertificateCertificateHashResponseData
- CertificateCertificateHashResponseDataCertificate
- CertificateCertificateHashResponseDataCertificateExtensions
- CertificateCertificateHashResponseDataCertificateExtensionsAuthorityInfoAccess
- CertificateCertificateHashResponseDataCertificateExtensionsBasicConstraints
- CertificateCertificateHashResponseDataCertificateExtensionsCertificatePolicies
- CertificateCertificateHashResponseDataCertificateExtensionsExtendedKeyUsage
- CertificateCertificateHashResponseDataCertificateExtensionsKeyUsage
- CertificateCertificateHashResponseDataCertificateExtensionsSubjectAltName
- CertificateCertificateHashResponseDataCertificateIssuer
- CertificateCertificateHashResponseDataCertificateSignature
- CertificateCertificateHashResponseDataCertificateSignatureSignatureAlgorithm
- CertificateCertificateHashResponseDataCertificateSubject
- CertificateCertificateHashResponseDataCertificateSubjectAltName
- CertificateCertificateHashResponseDataCertificateSubjectAltNameExtendedDnsNames
- CertificateCertificateHashResponseDataCertificateSubjectKeyInfo
- CertificateCertificateHashResponseDataCertificateSubjectKeyInfoPublicKey
- CertificateCertificateHashResponseDataCertificateValidity
- CertificateCertificateSearchData
- CertificateCertificateSearchResponse
- CertificateCertificateSearchResponsePagination
- CertificateCertificateSummaryResponse
- CertificateCertificateSummaryResponseData
- CertificateCertificateSummaryResponseDataBuckets
- CertificateErrorResponse
- CertificateNextBatchRequest
- CertificateSearchPagination
- CountRequest
- CybleComOdinApiControllersV2FieldsAPIResponse
- CybleComOdinApiControllersV2FieldsErrorResponse
- CybleComOdinApiControllersV2FieldsField
- CybleComOdinApiControllersV2IpservicesAPIResponse
- CybleComOdinApiControllersV2IpservicesCertCount
- CybleComOdinApiControllersV2IpservicesCountRequest
- CybleComOdinApiControllersV2IpservicesErrorResponse
- CybleComOdinApiControllersV2IpservicesSearchPagination
- CybleComOdinApiControllersV2IpservicesSearchRequest
- CybleComOdinApiControllersV2IpservicesSummaryRequest
- DnsAPIResponse
- DnsDNSCountRequest
- DnsData
- DnsDomainRequest
- DnsErrorResponse
- DnsSearchPagination
- Encoding
- ErrorResponse
- EshandlerAggregate
- EshandlerDNS
- EshandlerEXTDNSName
- ExposedAPIResponse
- ExposedAggregate
- ExposedBucket
- ExposedBucketAPIResponse
- ExposedCountRequest
- ExposedFile
- ExposedFileAPIResponse
- ExposedSearchCount
- ExposedSearchPagination
- ExposedSearchRequest
- ExposedSummaryRequest
- Field
- IPASN
- IPCVE
- IPDomain
- IPExploitDetails
- IPHostname
- IPLocation
- IPService
- IPServiceMeta
- IPServiceSoftware
- IPTag
- IPWhois
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse20011
- InlineResponse20012
- InlineResponse20013
- InlineResponse20014
- InlineResponse20015
- InlineResponse20016
- InlineResponse20017
- InlineResponse20018
- InlineResponse20019
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- InlineResponse400
- IpservicesHostsSummaryResponse
- IpservicesHostsSummaryResponseData
- IpservicesHostsSummaryResponseDataBuckets
- IpservicesIPSummaryData
- IpservicesIpCveDetails
- IpservicesIpCveDetailsExploit
- IpservicesIpCveResponse
- PaginationStruct
- SchemaAPIResponse
- SchemaAudit
- SchemaContact
- SchemaDomainWhoisResponse
- SchemaPaginationMeta
- SchemaRegistrar
- SearchPagination
- SearchRequest
- ServiceCoordinates
- ServiceEncoding
- ServiceFullCveData
- ServiceIPASN
- ServiceIPDomain
- ServiceIPHostname
- ServiceIPLocation
- ServiceIPServiceMeta
- ServiceIPServiceSoftware
- ServiceIPTag
- ServiceIPWhois
- ServiceService
- SummaryRequest
- TokensDetailStat
- TokensErrorResponse
- TokensFinalStats
- TokensSearchStat
- TokensUserTokenStats
- VisionExploitDetails
Documentation For Authorization
ApiKeyAuth
- Type: API key
- API key parameter name: X-API-Key
- Location: HTTP header
Generate your Odin API key from the odin dashboard.
Thank you for using the Odin SDK for Python. If you encounter any issues, find a bug, or want to contribute, feel free to open an issue or submit a pull request. Your feedback and contributions are highly appreciated!
For more information about our other projects and services, visit our website at https://odin.io.
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0
- Package version: 2.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file odin_sdk-2.0.0.tar.gz
.
File metadata
- Download URL: odin_sdk-2.0.0.tar.gz
- Upload date:
- Size: 92.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a0da341e7ce50f46bd18a14d09962ade0cb80334ab9d7ba34f2f25266c99283 |
|
MD5 | f30e9ac0858d9b46feac1dfce5b7c776 |
|
BLAKE2b-256 | bf60895282861bf3e4ede71177c30dc06444a2b811da98cc935367a3f77fb20f |
File details
Details for the file odin_sdk-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: odin_sdk-2.0.0-py3-none-any.whl
- Upload date:
- Size: 338.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51151cdd35446752961e2afc560f735c91ca2b26e846b80a4b70d01ae51c0657 |
|
MD5 | 9b5787cd664953aeafceb434a59fb34b |
|
BLAKE2b-256 | 44958c491eee40c404c5b02def0b2d9c9e104e3c04975088b29e8a59875754eb |