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.
compoundjs-device-detective
Advanced tools
#Compoundjs Device Detective
Device Detective is a featherweight CompoundJs module which determines whether a user agent is a phone, tablet, desktop, text browser (e.g., Lynx), or a search engine crawler (e.g., GoogleBot, BingBot, Baiduspider, etc.). And it makes this info easy to get at.
Like all UA sniffers, Device Detective relies on a handful of regular expressions to determine what sort of device has issued the HTTP request. Device Detective implements MDN recommendations for detecting mobiles, and allows the developer to choose whether to use the distinction between tablets and smaller mobile devices, which is available via the UA header (it's not recommended for the general use case).
Simply cd
to your project's root directory and issue the following command.
npm install compoundjs-device-detective
//environment.js
...
var device = require('compoundjs-device-detective');
app.locals.device = compound.controllerExtensions.device = device;
...
//your_controller.js
load('application');
action('main', function (req, res){
...
device.isDesktop(req ) // true|false
...
});
detect( req )
=> {
"phone" : [boolean],
"tablet" : [boolean],
"mobile" : [boolean],
"desktop" : [boolean],
"lynx" : [boolean],
"crawler" : [boolean]
}
isPhone( req ) => [boolean]
isTablet( req ) => [boolean]
isMobile( req ) => [boolean]
isDesktop( req ) => [boolean]
isLynx( req ) => [boolean]
isCrawler( req ) => [boolean]
FAQs
## What it does
We found that compoundjs-device-detective 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.