0.1.4 • Published 5 months ago

crtsh v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

node-crtsh

Version npm node.js version Module type: CJS js-semistandard-style Unit test status License

Query Crtsh (crt.sh) from node.js.

Crtsh is a platform that permits you search for certificates that have been logged by CT. Many people use this to enumerate subdomains.

How to install

npm i crtsh

Usage

Getting all domain and subdomains certificate names

const { hostnames: crtshHostnames } = require('crtsh');

(async () => {
  const hostnames = await crtshHostnames('%.example.org');
  console.log(JSON.stringify(hostnames, null, 2);

  // Will print:
  // [
  //   "example.org",
  //   "www.example.org",
  //   "www.testdomain.example.org"
  // ]
})();

More examples can be found at examples.

API

hostnames(pattern, options)

  • pattern (string, required):

    For example, if you want to list certificate names for "example.org" domain and subdomains, you can use "%.example.org".

  • options (object, optional):

    • axiosConfig: optional config to pass to axios.
    • proxy: optional proxy to use, eg: "localhost:8080"

      For example, if you want to use proxy when calling crt.sh, you can use syntax like this:

      const { hostnames } = require('crtsh');
      await hostnames('%.example.org', { proxy: 'localhost:8080' });

Changelog

See CHANGELOG.md.

License

License under MIT License.

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.0.3

5 months ago