Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pwnat in place of upnp #1

Open
TACIXAT opened this issue Mar 19, 2018 · 1 comment
Open

Implement pwnat in place of upnp #1

TACIXAT opened this issue Mar 19, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@TACIXAT
Copy link
Owner

TACIXAT commented Mar 19, 2018

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 TACIXAT added the enhancement New feature or request label Mar 19, 2018
@TACIXAT
Copy link
Owner Author

TACIXAT commented Mar 19, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant