TACIXAT / party-line

OFFICIOUS CHAT APPLICATION OF ALL HACKERS EVER
http://party-line.lol
Other
6 stars 0 forks source link

Implement pwnat in place of upnp #1

Open TACIXAT opened 6 years ago

TACIXAT commented 6 years ago

https://samy.pl/pwnat/

  1. Server: ICMP to a dead host
  2. Client: Reply to server with TTL exceeded
  3. Server: Spam client with udp on fixed port
  4. Client: Spam server with udp on fixed port
  5. Connection established

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.

TACIXAT commented 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));