
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
packet-socket
Advanced tools
Node.js package implementing socket for receiving OSI layer 2 packets
Assume that packet-socket module is required in following examples.
var packet = require('packet-socket')
var socket = packet.openSocket({device: 'lo'})
openSocket call accepts options object as argument. Option device should contain interface name on which open raw packet socket.
socket.close()
Some functions require address as an argument. Formats accepted:
socket.joinMC(packet.PROMISCIOUS)
socket.joinMC(packet.ALL_MULTICAST)
socket.joinMC('11:00:de:ad:be:ef')
socket.leaveMC(packet.PROMISCIOUS)
socket.leaveMC(packet.ALL_MULTICAST)
socket.leaveMC('11:00:de:ad:be:ef')
joinMC or leaveMC method accepts as argument either multicast address or integer constant:
packet.send(new Buffer('message to send'), '58:00:00:00:00:01', function(err, bytes) {
})
Callback function argument will provide information if send failed, then err will contain information, if it is null, then bytes will contain number of bytes transferred.
Socket returned by openSocket can emit events:
packet.on('message', function(message, source, destination) {
});
packet.on('error', function(error) {});
Opening packet (man 7 packet) socket requires root permission or cap_net_raw capability
Module contains unit test, which can be invoked by command
npm test
This however requires build suite ready, with CppUTest libraries installed.
FAQs
Node.js package implementing socket for receiving OSI layer 2 packets
We found that packet-socket 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.