
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
IP header serialization object stream.
var IpStream = require('ip-stream');
var EtherStream = require('ether-stream');
var PcapStream = require('pcap-stream');
var pstream = new PcapStream(PCAP_FILE);
var estream = new EtherStream();
var ipstream = new IpStream();
pstream.pipe(estream).pipe(ipstream);
ipstream.on('readable', function() {
var msg = ipstream.read();
msg.ether.src === '12:34:56:65:43:21'; // Ethernet frame is still available
msg.ip.src === '1.1.1.1'; // IP header data is available at .ip property
msg.ip.dst === '2.2.2.2';
msg.ip.protocol === 'udp';
var payload = msg.data; // IP packet data is available at .data property
});
// Packets that cannot be parsed as IP are emitted with 'ignored' event
ipstream.on('ignored', function(error, msg) {
console.log('Ignored message [' + msg + '] due to [' + error + ']');
});
ipstream.read(0);
// you can also control how fragments are handled
var ipsream2 = new IpStream({fragments: 'reassemble'}); // the default
var ipsream3 = new IpStream({fragments: 'drop'}); // ignore fragments
var ipsream4 = new IpStream({fragments: 'pass'}); // passthrough frags
// When reassembling, unmatched fragments are timed-out after 30 seconds by
// default, but you can configure that:
var ipstream5 = new IpStream({fragmentTimeout: 5000});
var IpStream = require('ip-stream');
var EtherStream = require('ether-stream');
var IpHeader = require('ip-header');
var EtherFrame = require('ether-frame');
var estream = new EtherStream();
var ipstream = new IpStream();
estream.pipe(ipstream);
// define the content to write out to the buffer
var input = {
ether: new EtherFrame({ dst: '01:23:45:54:32:10' }),
ip: new IpHeader({ dst: '1.1.1.1', dataLength: 500 }),
data: new Buffer(8*1024) // adequate storage for header
};
// NOTE: packet payload is not input.data, that must be appended later
estream.write(input);
var output = ipstream.read();
// header values have been written to the buffer
out.offset === (input.ether.length * input.ip.length);
test.deepEqual(input.ether, new EtherFrame(out.data, 0));
test.deepEqual(input.ip, new IpHeader(out.data, input.ether.length));
FAQs
IP header serialization object stream.
The npm package ip-stream receives a total of 18 weekly downloads. As such, ip-stream popularity was classified as not popular.
We found that ip-stream 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.