
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
request-stream
Advanced tools
Request-Stream allows you to send a JSON request and wait for a JSON reply over a stream
npm install request-stream
Request-Stream makes it easy to implement request-response services over streams.
To listen and reply to requests you just need to listen to the request event
var r = rs();
fromStream.pipe(r).pipe(fromStream);
r.on('request', function(request, respond) {
respond(null, request[0]+request[1]); // send a reply back to the requester
});
To send requests and wait for replies you call r.request(message, callback)
var rs = require('request-stream');
var r = rs();
toStream.pipe(r).pipe(toStream);
r.request([1,2], function(err, reply) {
console.log(err, reply); // prints 3
});
r.request([2,3], function(err, reply) {
console.log(err, reply); // prints 5
});
If you don't care about replying to requests you should probably use something like emit-stream instead
Lets try to setup a simple server
var rs = require('request-stream');
var net = require('net');
net.createServer(function(socket) {
var r = rs();
socket.pipe(r).pipe(socket);
r.on('request', function(request, respond) {
r.request({server:request}, respond);
});
}).listen(9000);
To make a request to the server we need to create a socket to the server and pipe our request to that.
var socket = net.connect(9000);
var r = rs();
socket.pipe(r).pipe(socket);
r.on('request', function(request, respond) {
respond(null, {client:request});
});
r.request('echo me please', function(err, reply) {
console.log(err, reply); // prints {client:{server:'echo me please'}}
});
r.request('echo me please again', function(err, reply) {
console.log(err, reply); // prints {client:{server:'echo me please again'}}
});
If we wanted to use tls instead of tcp we could just have implemented the above example using tls streams.
We could even use WebSockets using shoe.
FAQs
Extremely minimal wrapper around node core http/https to conveniently get request and response streams
The npm package request-stream receives a total of 198 weekly downloads. As such, request-stream popularity was classified as not popular.
We found that request-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.