crtsh

0.1.4 • Public • Published

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.

Package Sidebar

Install

npm i crtsh

Weekly Downloads

1

Version

0.1.4

License

MIT

Unpacked Size

8.28 kB

Total Files

6

Last publish

Collaborators

  • kucingbasah737