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.
Ultra simple async retrieval of remote files over http or https inspired by wgetjs
npm install node-wget
var wget = require('node-wget');
wget(url);
wget(url, callback);
wget({url: url, dest: destination_folder_or_filename}, callback);
wget({url: url, dry: true}); // dry run, nothing loaded, callback passing parsed options as data
var wget = require('node-wget');
wget('https://raw.github.com/angleman/wgetjs/master/angleman.png'); // angleman.png saved to current folder
wget({
url: 'https://raw.github.com/angleman/wgetjs/master/package.json',
dest: '/tmp/', // destination path or path with filenname, default is ./
timeout: 2000 // duration to wait for request fulfillment in milliseconds, default is 2 seconds
},
function (error, response, body) {
if (error) {
console.log('--- error:');
console.log(error); // error encountered
} else {
console.log('--- headers:');
console.log(response.headers); // response headers
console.log('--- body:');
console.log(body); // content of package
}
}
);
// dry run
wget({
url: 'https://raw.github.com/angleman/wgetjs/master/package.json',
dest: '/tmp/',
dry: true
}, function(err, data) { // data: { headers:{...}, filepath:'...' }
console.log('--- dry run data:');
console.log(data); // '/tmp/package.json'
}
);
Install:
$ npm install -g node-wget
Use:
Usage: wget [options] <url>
Ultra simple async retrieval of remote files over http or https
Options:
-h, --help output usage information
-v, --version output version number
-d, --destination <folder> specify download destination
Usage:
# Download file
$ wget https://github.com/NodeOS/NodeOS/archive/master.zip
# Download file to location
$ wget https://github.com/NodeOS/NodeOS/archive/master.zip -d path/to/here/
FAQs
Ultra simple async retrieval of remote files over http or https
The npm package node-wget receives a total of 1,507 weekly downloads. As such, node-wget popularity was classified as popular.
We found that node-wget 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.