NAT traversal

From Kicksecure
Jump to navigation Jump to search

todo

Documentation for this is incomplete. Contributions are happily considered! See this for potential alternatives.

pwnat[edit]

To make the client’s browser access http://127.0.0.1 (port 80) and get your HTTP server behind NAT, here’s the correct setup:

On Your Server (behind NAT, running the HTTP service on port 8080):

sudo ./pwnat -s 0.0.0.0 2222 127.0.0.1:8080

This:

  • Listens for pwnat clients on UDP port 2222
  • Only allows proxy access to your local port 8080 (your HTTP server)

Make sure your HTTP server is running:

python3 -m http.server 8080

On the Client (behind another NAT, allows browser to connect):

Note: Replace your.server.public.ip with the actual IP address of your server.

sudo ./pwnat -c 0.0.0.0 80 your.server.public.ip 2222 127.0.0.1 8080

This:

  • Binds to port 80 on the client (accessible via http://127.0.0.1)
  • Proxies requests through your server’s pwnat to its local 8080
  • Now, on the client machine, just open:

http://127.0.0.1

Expected result:

Client should see the server’s content.

Actual Result[edit]

client:

Listening on TCP 0.0.0.0:80

Then nothing happening.

server:

Listening on UDP 0.0.0.0:2222

Then nothing happening.

Setup:

  • server: ISP home router -> notebook -> Qubes -> VM (with direct internet connection)
  • client test 1: ISP home router -> notebook -> Qubes -> different VM (with direct internet connection)
  • client test 1: ISP home router -> notebook -> Qubes -> different VM (with VPN connection)

Functionality tests:

  • HTTP server is functional locally on the server: Yes. Command curl 127.0.0.1:8080 shows HTML output.
  • Behind normal NAT according to https://tomchen.github.io/symmetric-nat-test/archive.org iconarchive.today icon. (Not behind symmetric NAT.)
  • server internet functionality test (visit any website): yes
  • client test 1 internet functionality test (visit any website): yes
  • client test 2 internet functionality test (visit any website): yes

Debian[edit]

See Also[edit]

Notification image

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 13 year success story and maybe DONATE!