
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
securitytrails
Advanced tools
npm install securitytrails-js
In Node.js to create a new API Client:
const securitytrails = require("securitytrails-js");
const STAPI = new securitytrails(API_KEY);
You can then run the API functions which will return a node-fetch Promise, and handle the responses as needed.
See (SecurityTrails API Reference)
const securitytrails = require("securitytrails-js");
const STAPI = new securitytrails(process.env.API_KEY);
const domain = "example.com";
const associatedDomains = await STAPI.domains_associated_domains(domain)
.then(STAPI.handleErrors)
.then((response) => {
return response.json();
})
.catch((err) => console.error("error:" + err));
console.log(associatedDomains);
You can use this simple endpoint to test your authentication and access to the SecurityTrails API.
STAPI.ping();
Usage statistics of the API for the current month
STAPI.usage();
A fast and easy way to fetch many results. Currently only available for the DSL API endpoints.
STAPI.scroll(scrollId);
Returns details for a company domain.
STAPI.company_details(domain);
Returns associated IPs for a company domain. The result is not paginated nor limited. The data is based on whois data with the names matched to the domains.
STAPI.company_associated_ips(domain);
Returns the current data about the given hostname. In addition to the current data, you also get the current statistics associated with a particular record. For example, for a records you'll get how many other hostnames have the same IP
STAPI.domains_details(hostname);
Returns child and sibling subdomains for a given hostname. Limited to 2000 results for the Free plan and to 10000 for all paid subscriptions.
STAPI.domains_subdomains(
hostname,
(childrenOnly = false),
(includeInactive = true)
);
Returns tags for a given hostname
STAPI.domains_tags(hostname);
Returns the current WHOIS data about a given hostname with the stats merged together
STAPI.domains_whois(hostname);
Filter and search specific records using this endpoint. With pagination a maximum of 10000 results can be retrieved. To access more results you can use scrolling.
STAPI.domains_search(
(includeIps = false),
(page = 1),
(scroll = false),
(body = {})
);
Domain statistics
STAPI.domains_statistics((body = {}));
Find all domains that are related to a hostname you input. Limited to 10000 results.
STAPI.domains_associated_domains(hostname, (page = 1));
Fetch current and historical certificate information for any hostname. Limited to 10000 results
STAPI.domains_ssl(
hostname,
(includeSubdomains = false),
(status = "valid"),
(page = 1)
);
Fetch current and historical certificate information for any hostname. Returns all results.
STAPI.domains_ssl_stream(
hostname,
(includeSubdomains = false),
(status = "valid")
);
Lists out specific historical information about the given hostname parameter. In addition of fetching the historical data for a particular type, the count statistic is returned as well, which represents the number of that particular resource against current data. (a records will have an ip_count field which will represent the number of records that has the same IP as that particular record) The results are sorted first_seen descending. The number of results is not limited.
STAPI.history_dns(hostname, (type = "a"), (page = 1));
Returns historical WHOIS information about the given domain. The number of results is not limited.
STAPI.history_whois(hostname, (page = 1));
Returns the neighbors in any given IP level range and essentially allows you to explore closeby IP addresses. It will divide the range into 16 groups. Example: a /28 would be divided into 16 /32 blocks or a /24 would be divided into 16 /28 blocks
STAPI.ips_neighbors(ipAddress);
Search for IP addresses. A maximum of 10000 results can be retrieved.
STAPI.ips_dsl((page = 1), (body = {}));
Statistics like Reverse DNS pattern identification (RDNS entries are grouped and displayed as x), ports (number of open ports found) or total results are returned
STAPI.ips_statistics((body = {}));
Fetch current IP information for a single IPv4 address.
STAPI.ips_whois(ipAddress);
Fetch user agents seen during the last 30 days for a specific IPv4 address. It shows devices with egressing traffic based on large scale web server logs. The number of results is not limited.
STAPI.ips_useragents(ipAddress, (page = 1));
Fetch zone files including authoritative nameservers with ease. The method returns a .csv.gz file if successful. If ns is true the columns are apex_domain,nameservers (namerservers delimiter: |) and just apex_domain if ns is false.
STAPI.feeds_domains(
(type = "all"),
(filter = ""),
(tld = ""),
(ns = ""),
(date = "")
);
Download a list of DMARC records. The column is apex_domain.
STAPI.feeds_dmarc((type = "all"), (date = ""));
Download a list of subdomains, with the possibility of filtering by TLD. The response itself is streamed to a file, which means the data is received in chunks. When using filter you must specify the tld parameter and vise versa. The method returns a .csv.gz file if successful. The columns are apex_domain,hostname.
STAPI.feeds_subdomains((type = "all"), (filter = ""), (tld = ""), (date = ""));
Stream Certificate Transparency entries
STAPI.firehose_ct((start = ""), (end = ""));
Submit discovered hostnames. With the request header 'Content-Encoding: gzip' it is also possible to submit gzip'd data
STAPI.misc_submit(filePath);
FAQs
Node.js wrapper for the SecurityTrails API
The npm package securitytrails receives a total of 0 weekly downloads. As such, securitytrails popularity was classified as not popular.
We found that securitytrails demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.