Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
subnet-check
Advanced tools
Check if an IPv4 or IPv6 address is contained in the given CIDR subnet
This is a fork which works independantly of node.js to be able to be used in the browser.
Check if an IPv4 or IPv6 address is contained in the given CIDR subnet.
npm i -S louispvb/subnet-check
const { isInSubnet } = require('subnet-check');
console.log( isInSubnet('10.5.0.1', '10.4.5.0/16') ); // false
console.log( isInSubnet('10.5.0.1', '10.4.5.0/15') ); // true
console.log( isInSubnet('2001:db8:f53a::1', '2001:db8:f53b::1:1/48') ); // false
console.log( isInSubnet('2001:db8:f53a::1', '2001:db8:f531::1:1/44') ); // true
You can pass an array instead of a single subnet.
const inAnySubnet = isInSubnet('10.5.0.1', [ '10.4.5.0/16', '192.168.1.0/24' ]);
This module recognizes several special classes of addresses.
isPrivate(address);
True if the address is in a private/internal address range, such as 192.168.1.1
or similar, or an IPv6 Unique Local Address.
isLocalhost(address);
True if the address represents the localhost, such as 127.0.0.1
or ::1
.
FAQs
Check if an IPv4 or IPv6 address is contained in the given CIDR subnet
The npm package subnet-check receives a total of 9,674 weekly downloads. As such, subnet-check popularity was classified as popular.
We found that subnet-check 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.