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.
HTTP request logger middleware for node.js based on morgan
"use strict";
var logger = require( 'devlogger' );
var express = require( 'express' );
var app = express();
function response( req, res ) {
res.json( {result: "ok"} );
}
app.use( logger( 'dev' ) );
app.use( "/", response );
app.listen( 5000 );
result
-> 10:28:39.849 GET > 304 > / - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
-> 10:36:55.310 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
Or even
"use strict";
var logger = require( 'devlogger' );
var express = require( 'express' );
var app1 = express();
var app2 = express();
require( "colors" );
function response( req, res ) {
res.json( {result: "ok"} );
}
app1.use( logger( 'SERVER1 '.green + logger.dev ) );
app1.use( "/", response );
app1.listen( 5000 );
app2.use( logger( 'SERVER2 '.blue + logger.dev ) );
app2.use( "/", response );
app2.listen( 5001 );
result
SERVER1 -> 10:36:55.310 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
SERVER2 -> 10:45:30.287 GET > 304 > / - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
SERVER2 -> 10:45:30.319 GET > 304 > /favicon.ico - Chrome 38.0.2125 > Other > Mac OS X 10.10.0 > 127.0.0.1
SERVER1 -> 10:45:42.220 GET > 304 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
SERVER2 -> 10:45:44.415 GET > 200 > / - Mobile Safari 8.0 > iPhone > iOS 8.1 > 10.58.100.201
The :date token takes a pattern parameter and formats the date using dateformat.
logger( '-> :date[HH:MM:ss.l] :method > :status ...' );
result
-> 10:28:39.849 GET > 304 ...
Devlogger also benefits of using ua-parser
logger( '-> :os > :device > :browser' )
result
-> Mobile Safari 8.0 > iPhone > iOS 8.1
-> Chrome 38.0.2125 > Other > Mac OS X 10.10.0
FAQs
HTTP request logger middleware for node.js
The npm package devlogger receives a total of 0 weekly downloads. As such, devlogger popularity was classified as not popular.
We found that devlogger 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.