Open TACIXAT opened 6 years ago
Untested ICMP code.
var raw = require ("raw-socket");
//[type]x1, [code]x1, [chksum]x2, [id]x2, [seq]x2, [data]x4
var header = Buffer.alloc(12);
header.writeUInt8(0x8, 0); //type
header.writeUInt16LE(0, 4); //id
header.writeUInt16LE(checksum(header), 2);
var rawSocket = raw.createSocket({
protocol: raw.Protocol.ICMP
});
rawSocket.send(header, 0, 12, '203.0.113.15', function(err, bytes));
https://samy.pl/pwnat/
This seems like a lot of overhead for each connection. Would be cool to not use UPNP though. Would need to add message queues so when a connection was established the original (intended) message could be sent.