
Research
wget to Wipeout: Malicious Go Modules Fetch Destructive Payload
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
express-ua-middleware
Advanced tools
Express middleware to parse user-agent header
npm i express-ua-middleware
#or
yarn add express-ua-middleware
This is a middleware to provide parsed user agent header, to use simply, import module, then use it on express.use
method.
const userAgent = require("express-ua-middleware");
const express = require("express");
const server = express();
server.use(userAgent);
server.get("/", (req, res) => {
console.log(req.userAgent);
/**
* Example
* {
* raw: "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Mobile Safari/537.36",
* browser: {
* name: "Chrome",
* version: "77"
* },
* os: {
* name: "Android",
* version: "5.0"
* },
* device: {
* vendor: "Samsung",
* model: "SM-G900P"
* }
* }
*/
})
Or you can use as parser, with method userAgentFromString
server.get("/", (req, res) => {
console.log(req.userAgentFromString(req.headers["user-agent"]));
/**
* Example
* {
* browser: {
* name: "Chrome",
* version: "77"
* },
* os: {
* name: "Android",
* version: "5.0"
* },
* device: {
* vendor: "Samsung",
* model: "SM-G900P"
* }
* }
*/
})
To contribute with the project, open a issue on Github or create a Pull Request
FAQs
Express middleware to parse user-agent header
The npm package express-ua-middleware receives a total of 33 weekly downloads. As such, express-ua-middleware popularity was classified as not popular.
We found that express-ua-middleware 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
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.