node_pcap
node_pcap copied to clipboard
Packet Capture Inconsistency
Is there a pcap error event I should be monitoring? I thought I was successfully monitoring wifi traffic, but when I set up two identical devices side by side, I'm getting significantly different results from each device. The core of the code is essentially the following:
const execSync = require('child_process').execSync
const cmd = `/sbin/ifconfig ${wifiAdapter} down; /sbin/iwconfig ${wifiAdapter} mode monitor; /sbin/ifconfig ${wifiAdapter} up`;
execSync(cmd)
const pcap = require('pcap')
const pcapSession=pcap.createSession(wifiAdapter,'wlan type mgt subtype probe-req')
pcapSession.on('packet',function(rawPacket){
var packet = pcap.decode.packet(rawPacket)
processPacketInfo(packet)
})