Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A cross-platform Node.js wrapper around the standard Unix computer program, df.
node-df
(abbreviation of disk free) is a cross-platform Node.js wrapper around the standard Unix computer program, df.
$ npm install node-df
var
df = require('node-df');
df(function (error, response) {
if (error) { throw error; }
console.log(JSON.stringify(response, null, 2));
});
Output from df
looks like this:
[
{
"filesystem": "/dev/disk0s2",
"size": 487546976,
"used": 164493356,
"available": 322797620,
"capacity": 0.34,
"mount": "/"
},
{
"filesystem": "devfs",
"size": 186,
"used": 186,
"available": 0,
"capacity": 1,
"mount": "/dev"
},
{
"filesystem": "map -hosts",
"size": 0,
"used": 0,
"available": 0,
"capacity": 1,
"mount": "/net"
},
{
"filesystem": "map auto_home",
"size": 0,
"used": 0,
"available": 0,
"capacity": 1,
"mount": "/home"
},
{
"filesystem": "localhost:/CPYpGwk1x_UGJYGx-93flp",
"size": 487546976,
"used": 487546976,
"available": 0,
"capacity": 1,
"mount": "/Volumes/MobileBackups"
}
]
Values for size
, used
and available
are expressed in KiB
(1024 bytes).
Value for capacity
is a number between 0
and 1
. capacity
is also known as used%
node-df
correctly parsed output from df
unix program for filesystems and mount folders with whitespaces in the name.
var
options = {
file: '/',
prefixMultiplier: 'GB',
isDisplayPrefixMultiplier: true,
precision: 2
};
df(options, function (error, response) {
if (error) { throw error; }
console.log(JSON.stringify(response, null, 2));
});
Output from df
now looks like this:
[
{
"filesystem": "/dev/disk0s2",
"size": "499.25GB",
"used": "168.44GB",
"available": "330.54GB",
"capacity": 0.34,
"mount": "/"
}
]
size
, used
and available
values from KiB
to MiB
, GiB
, PiB
, EiB
, ZiB
, YiB
, MB
, GB
, PB
, EB
, ZB
, YB
;true
, values for size
, used
and available
are converted to strings and prefixMultiplier
is displayed (see example above).size
, used
and available
values to precision
decimal digits.FAQs
A cross-platform Node.js wrapper around the standard Unix computer program, df.
The npm package node-df receives a total of 9,854 weekly downloads. As such, node-df popularity was classified as popular.
We found that node-df 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.