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.
dom-goggles
Advanced tools
What an adorable name, isn't it? i'm kind of proud of it myself. ANYWAY. This tool basically takes an array of websites, an array of strings to look up and will tell you to the best of its skills (it uses phantomjs so modern javascript might break this poor thing) how many times each one appears, per webpage and total
npm install dom-goggles
& then
import domGoggles from 'dom-goggles'
domGoggles(
['http://facebook.com','http://youtube.com','http://yahoo.com'],
['<div'],
{report: true}
).then(results => {
console.log(results);
}).catch(e => {
console.error(e);
})
Not for much really (unless you are like VERY into counting things. No judgement there). You can, for example, use it to scan the dom on pages you serve to find the most common web components & load those into the main app bundle, leaving the rest as chunks on demand.
I mean you might think this is overkill and there's probably better ways to do this but if you are plugging this directly into a php monolyth it's actually like the lightest way? I tried grepping the templates folder first, that actually took longer.
Let me know if this helped you! PR's for deeper DOM introspection (such as having queryselectorAll or any js really in addition to regex) are EXTREMELY welcome, I just didn't have the need for its particular usage.
FAQs
Look up keywords & their frequence over a list of pages
The npm package dom-goggles receives a total of 0 weekly downloads. As such, dom-goggles popularity was classified as not popular.
We found that dom-goggles 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.