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.
node-sizzle
Advanced tools
A node.js plugin that brings sizzle and libxmljs together. Currently it passes all relevant sizzle tests when used with an HTML document.
npm install node-sizzle
To run the tests, go to the project's root directory and run node test.js
To run the tests, go to the examples
directory and run
node web.js
var http = require('http'),
events = require('events'),
inherits = require('sys').inherits,
dominiq = require('node-sizzle/dominiq'),
sizzFact = require('node-sizzle');
function WebClient(host, path) {
var self = this,
transport = http.createClient(80, host),
request = transport.request('GET', path, {'host': host});
request.end();
request.on('response', function (response) {
if (response.statusCode != 200) {
self.emit('done', response.statusCode, '');
}
else {
var html = '';
response.setEncoding('utf8');
response.on('data', function (chunk) {
html += chunk;
});
response.on('end', function (chunk) {
self.emit('done', 200, html);
});
}
});
}
inherits(WebClient, events.EventEmitter);
var client = new WebClient('www.yahoo.com', '/');
client.on('done', function(status, html) {
if (status != 200) {
throw 'unable to download page';
}
var doc = dominiq.createHTMLDocument(html),
window = {document:doc},
sizzle = sizzFact.sizzleInit(window),
divs = sizzle('div');
for (var i = 0; i < divs.length; i++) {
console.log(divs[i].toString());
}
});
FAQs
Sizzle powered selectors for libxmljs
The npm package node-sizzle receives a total of 1 weekly downloads. As such, node-sizzle popularity was classified as not popular.
We found that node-sizzle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.