npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

odin-sdk

v2.0.1

Published

ODIN SDK provides search across IP Services, CVEs, Certificates, Exposed Files/Buckets, Domains and more

Downloads

3

Readme

Odin SDK for Javascript

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.

Installation

For Node.js

npm

Then install it via:

npm install odin-sdk --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false,
      },
    },
  ];
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var Odin = require("odin-sdk");

var defaultClient = Odin.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications["ApiKeyAuth"];
ApiKeyAuth.apiKey = "YOUR API KEY";
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-Key'] = "Token"

// search exposed buckets (using pagination)
var api = new OdinApis.ExposedBucketsApi();
var buckets = [];

for (var i = 0; i < 10; i++) {
  var query = new OdinApis.ExposedCountRequest();
  query.query = "name:'lit-link-prd.appspot.com'";
  var callback = function (error, data, response) {
    if (error) {
      console.error(error);
    } else {
      buckets.push(data);
    }
  };
  api.exposedBucketsCountPost(query, callback);
  console.log(JSON.stringify(buckets));
}

// search files in a exposed bucket
var api = new OdinApis.ExposedFilesApi();
var query = {
  query: "provider: aws",
  limit: 1,
  sortDir: "desc",
  sortBy: "files",
};
var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log(JSON.stringify(data));
  }
};
api.exposedFilesSearchPost(query, callback);

// search hosts
var api = new OdinApis.ExposedHostsApi();
var query = {
  query:
    '(last_updated_at:["2024-07-08T02:41:15.528Z" TO *] AND services.port:80) OR asn.number:AS63949',
  limit: 1,
};
var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log(JSON.stringify(data));
  }
};
api.exposedHostsSearchPost(query, callback);

// certificates search
var api = new OdinApis.CertificateApi();
var query = {
  query:
    "certificate.subject_alt_name.dns_names:'cloudflare.com' AND certificate.validity.not_after:\"2024-09-20T18:19:24\"",
  limit: 1,
};
var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log(JSON.stringify(data));
  }
};
api.certificatesSearchPost(query, callback);

// certificates count
var api = new OdinApis.CertificateApi();
var query = new OdinApis.CertificateCertCountRequest();
var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log(JSON.stringify(data));
  }
};
api.certificatesCountPost(query, callback);

Documentation for API Endpoints

All URIs are relative to https://api.odin.io

| Class | Method | HTTP request | Description | | ------------------------ | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------- | | Odin.CertificateApi | v1CertificatesCountPost | POST /v1/certificates/count | Get records count | | Odin.CertificateApi | v1CertificatesHashGet | GET /v1/certificates/{hash} | Get the complete certificate | | Odin.CertificateApi | v1CertificatesScrollNextPost | POST /v1/certificates/scroll/next | Get the next batch of record | | Odin.CertificateApi | v1CertificatesScrollPost | POST /v1/certificates/scroll | Get the record based on query | | Odin.CertificateApi | v1CertificatesSearchPost | POST /v1/certificates/search | Search records | | Odin.CertificateApi | v1CertificatesSummaryPost | POST /v1/certificates/summary | Get summary | | Odin.DomainApi | v1DomainCountPost | POST /v1/domain/count | Get domains count | | Odin.DomainApi | v1DomainSearchPost | POST /v1/domain/search | Search domains | | Odin.DomainApi | v1DomainSubdomainCountPost | POST /v1/domain/subdomain/count | Fetch the total no. of subdomain records | | Odin.DomainApi | v1DomainSubdomainSearchPost | POST /v1/domain/subdomain/search | Fetch the subdomain record | | Odin.DomainApi | v1DomainWhoisDomainNameGet | GET /v1/domain/whois/{domain-name} | Fetch the domain whois record details | | Odin.DomainApi | v1DomainWhoisDomainNameHistoricalGet | GET /v1/domain/whois/{domain-name}/historical | Fetch all the domain whois historical records | | Odin.DomainApi | v1DomainWhoisDomainNameIsExpiredGet | GET /v1/domain/whois/{domain-name}/is-expired | Get the expiry for a particular domain | | Odin.DomainApi | v1DomainWhoisDomainNameIsRegisteredGet | GET /v1/domain/whois/{domain-name}/is-registered | Fetch all the domain whois historical records | | Odin.ExposedBucketsApi | v1ExposedBucketsCountPost | POST /v1/exposed/buckets/count | Get exposed bucket count | | Odin.ExposedBucketsApi | v1ExposedBucketsSearchPost | POST /v1/exposed/buckets/search | Search exposed buckets | | Odin.ExposedBucketsApi | v1ExposedBucketsSummaryPost | POST /v1/exposed/buckets/summary | Get Exposed buckets summary | | Odin.ExposedFilesApi | v1ExposedFilesCountPost | POST /v1/exposed/files/count | Get file count | | Odin.ExposedFilesApi | v1ExposedFilesSearchPost | POST /v1/exposed/files/search | Search exposed files | | Odin.ExposedFilesApi | v1ExposedFilesSummaryPost | POST /v1/exposed/files/summary | Get file summary | | Odin.FieldsApi | v1FieldsCertificatesCategoryGet | GET /v1/fields/certificates/{category}/ | Get the fields for certificates | | Odin.FieldsApi | v1FieldsExposedBucketsGet | GET /v1/fields/exposed/buckets/ | Get the fields for exposed | | Odin.FieldsApi | v1FieldsExposedFilesGet | GET /v1/fields/exposed/files/ | Get the fields data | | Odin.FieldsApi | v1FieldsHostsCategoryGet | GET /v1/fields/hosts/{category}/ | Get the fields for hosts | | Odin.HealthApi | v1PingGet | GET /v1/ping | Health Check | | Odin.HostsApi | v1CvesAllIpPageGet | GET /v1/cves/all/{ip}/{page} | Get cve details | | Odin.HostsApi | v1HostsCountPost | POST /v1/hosts/count | Get the record count | | Odin.HostsApi | v1HostsCveIpGet | GET /v1/hosts/cve/{ip}/ | Get ip cve details | | Odin.HostsApi | v1HostsCvesIpCveGet | GET /v1/hosts/cves/{ip}/{cve} | Get cve | | Odin.HostsApi | v1HostsExploitsIpCveGet | GET /v1/hosts/exploits/{ip}/{cve} | Get exploits for ip and cve | | Odin.HostsApi | v1HostsExploitsIpGet | GET /v1/hosts/exploits/{ip}/ | Get exploits for ip | | Odin.HostsApi | v1HostsIpGet | GET /v1/hosts/{ip}/ | Get the latest ip details | | Odin.HostsApi | v1HostsSearchPost | POST /v1/hosts/search | Search hosts | | Odin.HostsApi | v1HostsSummaryPost | POST /v1/hosts/summary | Get summary | | Odin.HostsApi | v2HostsCountPost | POST /v2/hosts/count | Fetch the record count | | Odin.HostsApi | v2HostsIpPost | POST /v2/hosts/{ip} | Fetch the latest ip details | | Odin.HostsApi | v2HostsSearchPost | POST /v2/hosts/search | Fetch the record based on query | | Odin.HostsApi | v2HostsSummaryPost | POST /v2/hosts/summary | Create the summary of the field based on query |

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

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 Javascript. 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.