
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Node.js utility package for working with IP addresses and CIDR ranges.
$ npm install netaddr --save
var Addr = require('netaddr').Addr;
// Create a fixed IP address from a string
var localhost = Addr('127.0.0.1');
// Create CIDR range from a string
var subnet = Addr('10.0.0.0/16');
// Create a CIDR range from an integer and prefix
var subnet = Addr(167772160, 16);
// Convert an IP address to an integer
var intval = Addr('127.0.0.1').toInt();
// Get the network address
var network = subnet.network();
// Get the broadcast address
var broadcast = subnet.broadcast();
// Mask the address with a new prefix
var masked = subnet.mask(24);
// Check if one CIDR contains another CIDR or IP
subnet.contains(Addr('10.0.3.0/24')); // true
// Check where two CIDRs intersect
subnet.intersect(Addr('10.0.3.0/24'));
// Increment an address (non-mutating)
localhost.increment();
// Decrement an address (non-mutating)
localhost.decrement();
// Find the next adjacent subnet
subnet.nextSibling();
// Find the previous adjacent subnet
subnet.prevSibling();
Attempts to create an invalid Addr
will throw an Error
.
Currently only IPv4 is supported, though there are plans to add IPv6 support. This is complicated by the fact JavaScript does not support 64-bit integers, let alone 128-bit integers.
Copyright © 2015 Chris Corbyn. See the LICENSE file for details.
FAQs
Utility for IP addresses and CIDR expressions
The npm package netaddr receives a total of 2,400 weekly downloads. As such, netaddr popularity was classified as popular.
We found that netaddr 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.