News for hackers. Stuff that matters.
Re:NAT-to-NAT direct connections with no proxy/STUN needed by tptacek on Sunday March 28, 2010 @03:19PM (#1225076)
Cheat sheet version: one side sends packets to a bogus IP, the other side sends ICMP TTL Exceeded packets back. Some NATs will pass the TTL Exceeded packets because that's how traceroute works; the ICMP packets are indistinguishable from "real" traceroute responses. Once both sides know each other's IP addresses, they open a tunnel by simultaneously talking outbound UDP to each other.

This is a clever trick for home NATs, but most corporate networks are doing more than NAT'ing; they're dropping everything but DNS and HTTP from a proxy.

Re:NAT-to-NAT direct connections with no proxy/STUN needed by alecco on Sunday March 28, 2010 @04:13PM (#1225144)
The forest, dude, the forest.

Think about the masses behind home NAT routers and P2P. From my comments on reddit http://www.reddit.com/r/programming/comments/bjc0g/pwnat_ser...

    Server publishes it's NAT external IP and a hash of its (RSA) public key.
    [ICMP] Client MAC(client public key + server public key hash) -> Server
      (Server checks the key hash the client got is valid)
    [UDP] Server MAC(server public key + hash of client public key) -> Client
      (Client checks the public key hash matches the server's public key) ...

    The publishing first step could be just an URI like:
    pwnat://<server external ip>/pubkey_hash:<pub key hash>
    The hash could be base64 encoded in just 24 chars. Of course this
    is thinking out loud. There are protocols for this already.
Thats of course drafty and not really checked, but you can get the idea and improve on it. It looks very doable.

Also think about P2P and privacy, so far the middle men (e.g. Skype) would know who is talking to who. This is a major step.

And there's plenty of space on the spoofed ICMP reply to put anything relevant to start a conversation (randomized ports, hashes, keys, nonce).

Re:NAT-to-NAT direct connections with no proxy/STUN needed by tptacek on Sunday March 28, 2010 @04:21PM (#1225155)
You're right. It's a big deal. It's just not a big deal for corporate networks.
Re:NAT-to-NAT direct connections with no proxy/STUN needed by alecco on Sunday March 28, 2010 @04:34PM (#1225170)
Yeah, it's not for corporate networks.

But, for example, corporate network (and security) could benefit from this, too. Virtual P2P meetings could be done this way without a third party central server or the need to install a special server software. The meeting initiator can send an email with an URI and everyone else just clicks on it running the relevant client software. Much better security-wise than most scenarios nowadays.

Cross-continent meetings are a major pain when it's over VPN or centralized.

Re:NAT-to-NAT direct connections with no proxy/STUN needed by latitude on Sunday March 28, 2010 @05:26PM (#1225256)
> Much better security-wise than most scenarios nowadays.

Can you elaborate on this?

Re:NAT-to-NAT direct connections with no proxy/STUN needed by alecco on Sunday March 28, 2010 @09:51PM (#1225614)
Note I'm kind of thinking out loud, and in this idea was about P2P conferencing, so it's not for local network or well connected offices. More like a very typical scenario of several people connecting from different locations (e.g. working from home plus remote offices.)

Using a VPN (centralized) adds a lot of latency and degrades the experience. Using a third party service (MS, WebEx, Lotus) often adds trusting them with your dearest corporate secrets and allows them (and the authorities on their respective countries) to spy on the conference or even simply detect your users's IPs to direct attacks to their more vulnerable home computers full of interesting data.

With some service set up like this the users can just have an "initiator" "server", who's software just checks its NAT external IP (thousands of existing free services and web pages give you this) and creates a meeting URI. They send it by some secure channel (e.g. email over vpn) to the other parties. The rest conenct to the initiator "server" and discover each other's IP. If the protocol is carefully designed the clients and server can have a shared secret on the URI to avoid Man-in-the-middle. Voilà!

This can easily be an open source product with zero server costs (unlike WebEx, Skype, MS.) Of course, this works only for clients with NAT access and others should connect in other ways (e.g. HTTPS and/or UPnP.)

My point was that even the corporate network and security teams can benefit from this in some way. It's not just to set up quake servers on college networks.

Re:NAT-to-NAT direct connections with no proxy/STUN needed by gcb on Monday March 29, 2010 @12:22PM (#1226818)
basically you are trying to hack a solution for one thing that can be solved with your wallet.

And i dont mean to pay for the most expensive option becausw that's what you isp wants.

I'm talking about hiring a smaller isp that does not goes extra lengths to block your connections

Re:NAT-to-NAT direct connections with no proxy/STUN needed by aidenn0 on Sunday March 28, 2010 @07:00PM (#1225388)
This is clearly only designed for home NATs. The simple fact of the matter is that most home users don't want to know how to forward ports so that they can use p2p software.

This allows one to write software so that such users can use p2p software without having a central server to discover IP addresses.

Re:NAT-to-NAT direct connections with no proxy/STUN needed by miles on Sunday March 28, 2010 @05:06PM (#1225217)
they're dropping everything but DNS and HTTP from a proxy

That won't help them either anymore:

Weaponizing dnscat with shellcode and Metasploit http://news.ycombinator.com/item?id=1204931

Re:NAT-to-NAT direct connections with no proxy/STUN needed by tptacek on Sunday March 28, 2010 @05:13PM (#1225236)
(a) My point isn't that enterprises can solve the (fundamentally intractable) covert channel problem. It's that this NAT tunnelling code won't work on corporate networks.

(b) DNS tunneling is also clever, but it's loud, easily detected, easily defeated, and extremely likely to get you fired.

Re:NAT-to-NAT direct connections with no proxy/STUN needed by miles on Monday March 29, 2010 @02:30AM (#1225954)
Thank you for the followup! A quick question: after reading over "Detecting and preventing the use of DNScat" on this page:

http://tadek.pietraszek.org/projects/DNScat/ ,

it seems as if uncovering small amounts of data sent this way might be difficult. Here are the detection techniques mentioned:

  detecting unusual and malformed DNS packets (DNScat will evade this)
  detecting high number of unusual types of DNS queries (e.g. TXT) (DNScat will also evade this)
  Anomaly detection: DNS query and response length
  Anomaly detection: profiling the amount of traffic per client source IP address
Are there any other detection methods?