Slashdot Mirror


How Skype Punches Holes in Firewalls

An anonymous reader writes "Ever wondered, how P2P software like Skype directly exchanges data — despite the fact, that both machines are sitting behind a firewall that only permits outgoing traffic? Read about the hole punching techniques, that make a firewall admin's nightmares come true."

215 comments

  1. Great article by Nasarius · · Score: 5, Interesting

    I'm impressed, this is really good stuff. The article describes a general technique that can be used to trick most firewalls into believing that a UDP connection has already been established. Is this technique being used or considered by any P2P apps? I've run into the situation several times where I'm firewalled, and the only seeder of a torrent is too.

    --
    LOAD "SIG",8,1
    1. Re:Great article by BarkLouder · · Score: 2, Insightful
      The article describes a general technique that can be used to trick most firewalls into believing that a UDP connection has already been established.

      There is no such thing as a "UDP connection". UDP is connection-less. TCP uses connections.

    2. Re:Great article by pilot1 · · Score: 4, Interesting

      Back when eDonkey was still fairly popular, I remember the lMule devs (GNU/Linux port of eMule) were aware of this technique and planned on incorporating it in lMule. BitTorrent became popular, lMule forked many times, and we never got around to it. I'm not aware of any current P2P apps that do it. The problem is that the technique, as they describe it, requires a central trusted server that both sides can connect to. With Skype that's fine, but it's a problem when you're dealing with something that's supposed to be entirely P2P. I don't remember this limitation, so either I have a bad memory or there's some way around it.

    3. Re:Great article by autocracy · · Score: 5, Informative

      It is true that UDP is connectionless, but stateful firewalls do track UDP conversations as "connections." This is why, for example, DNS requests going out can be answered without unrequested inbound UDP traffic sent anywhere.

      --
      SIG: HUP
    4. Re:Great article by izomiac · · Score: 1

      BitComet (a Bittorrent client) uses "UDP NAT Bypassing" which I assume is this technique. Unfortunately, this feature has been broken/disabled for the last few versions though.

    5. Re:Great article by Anonymous Coward · · Score: 0

      Hamachi does this to establish VPN "connections".

    6. Re:Great article by w128jad · · Score: 3, Interesting
      I'm impressed, this is really good stuff. The article describes a general technique that can be used to trick most firewalls into believing that a UDP connection has already been established. Is this technique being used or considered by any P2P apps? I've run into the situation several times where I'm firewalled, and the only seeder of a torrent is too.


      I was impressed with this technique too. Perhaps the third party for a protocol such at bittorrent could use the seeders as UDP port mediators. It would be pretty easy to determine if the traditional listening port range was being filtered, and then the other seeding peers could do the UDP port exchanges for peers behind NAT firewalls. I don't think having a centralized trust is an issue here, because the whole concept relies on checksums anyway.

      Of course I don't intimately understand how the protocol works in terms of discovery of other peers, so I could be talking out of my ass. Feel free to ridicule me if any of you know different.

      The only place I could see this falling apart is the added overhead of establishing the scheme for *every* peer that wants to connect to your machine. The handshake to get each other's UDP ports would have to take place on some seeder *each* time a new peer came online, and each new host would somehow need to know which seeder was going to help exchange UDP ports. You would need an election, kind of like the master computer browser election on a NetBIOS PTP network. Perhaps you could handle this in tiers, allowing each "master browser" to handle a certain number of host UDP port exchanges.

      Just think if this worked though. It would mean no more leechers!
      --
      w2^7me out.
    7. Re:Great article by _xeno_ · · Score: 4, Insightful

      The core BitTorrent protocol uses TCP, so the UDP technique the article describes won't work. (As far as I know, there's no corresponding technique for doing something similar with TCP.)

      There's been a bit of work on various UDP protocol replacements for BitTorrent, but nothing that's really gained any cohesion that I'm aware of. So, when it comes to BitTorrent, no, there really isn't much work on making such a technique work.

      There might be other P2P platforms that do attempt to do something like the technique described in the article, but the official BitTorrent protocol uses TCP and therefore can't use the technique.

      --
      You are in a maze of twisty little relative jumps, all alike.
    8. Re:Great article by Amouth · · Score: 1

      once you have established a UDP connection (i know it is connection list but both of them talking) between the them you can fake your own TCP connection or switch it to one. once you know the forwarding port your good to go..

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    9. Re:Great article by w128jad · · Score: 1

      The core BitTorrent protocol uses TCP, so the UDP technique the article describes won't work. (As far as I know, there's no corresponding technique for doing something similar with TCP.)

      There's been a bit of work on various UDP protocol replacements for BitTorrent, but nothing that's really gained any cohesion that I'm aware of. So, when it comes to BitTorrent, no, there really isn't much work on making such a technique work.

      There might be other P2P platforms that do attempt to do something like the technique described in the article, but the official BitTorrent protocol uses TCP and therefore can't use the technique.


      I don't think that would necessarily be a problem. You could leave the current protocol as it stands and "bolt-on" the UDP scheme. I don't know anything about the particulars of the protocol, but I would think you could add a preference to a bittorrent client to allow it to both participate in traditional bittorrent exchanges with normal seeders, as well as attempt UDP port exchanges by using the TCP connections with existing seeders.

      You could have the client "test the waters" so to speak with a seeder, to see if it has the bolt-on code to help exchange UDP ports with other NAT-bound leechers. If the code responds, then you start establishing UDP connections through port exchanges with that seeder, else you just treat it like a traditional torrent seeder. That way, in the interum, you aren't breaking the current torrent protocol, but could actually get an added bonus of other "virtual-seeders" on UDP.

      I am surprised to hear that torrent is TCP based in the first place. It seems like needless overhead, when the checksumming ensured data reliability anyway. But short of a complete reimplementation of torrent with UDP (with community support), I would think it would make more sense to extend the current protocol (not in the microsoft way :)

      Just some thoughts.
      --
      w2^7me out.
    10. Re:Great article by d3ac0n · · Score: 4, Interesting

      I would imagine that using the tracker server for this purpose would work. Obviously for "trackerless" torrents it would break again, but for standard tracker torrents it would probably work quite well. Couple it with torrent encryption and you have a very nice way to get around your college/work firewall.

      --
      Official Heretic from the "Church of Global Warming". Proven right thanks to whistle blowers. AGW = Flat Earth Theory
    11. Re:Great article by _xeno_ · · Score: 1

      I'd really hope that doesn't work with any sane NAT implementation. Most NAT implementations view TCP and UDP as separate protocols, because - well, because they are separate protocols. So using this technique to punch a UDP hole would offer absolutely nothing when it comes to establishing a TCP connection. While the port numbers are similar, they apply only to their individual protocol. TCP port 80 has no relation to UDP port 80. The only thing similar about the two is that they both run over IP.

      --
      You are in a maze of twisty little relative jumps, all alike.
    12. Re:Great article by jmauro · · Score: 1

      This is the thing the body/header of a TCP packet happens to be a valid body/header of a UDP packet as well. The only thing that makes a packet "TCP" is that it's IP Protocol number is TCP instead of UDP. If you tag a packet as UDP and have the body of a TCP packet you can still run the same TCP algoritms on it and it'll work just fine. Granted you cannot use the OS implemeted ones, but it's possible.

    13. Re:Great article by infinityxi · · Score: 1

      Yeah, I kind of wondered how it was done. I mean i am not expert on TCP/IP in the least and my open source project depends on peer to peer proxy of certain game traffic. Maybe I can implement this method and keep the host from having to open their port.

      --
      Turn based strategy game that runs over XMPP. Phalanx
    14. Re:Great article by Opie812 · · Score: 3, Funny

      +4 Insightful? How about "-1 RTFA, assface".

      --
      I'm not a nerd. Nerds are smart.
    15. Re:Great article by woztheproblem · · Score: 2, Informative

      From page 2 of the article:

      Astonishingly, hole punching also works with TCP. After an outgoing SYN packet the firewall / NAT router will forward incoming packets with suitable IP addresses and ports to the LAN even if they fail to confirm, or confirm the wrong sequence number (ACK). Linux firewalls at least, clearly fail to evaluate this information consistently. Establishing a TCP connection in this way is, however, not quite so simple, because Alice does not have the sequence number sent in Bob's first packet. The packet containing this information was discarded by her firewall.

    16. Re:Great article by Anonymous Coward · · Score: 0

      Big fucking deal, isn't this the first idea that would come to mind for anyone who knows the basics of TCP/UDP operation?

    17. Re:Great article by DamnStupidElf · · Score: 1

      The best thing is that you can do the same thing with TCP/IP if you have to. Have the "server" tell both clients what ports to use and each can send a SYN packet to each other with the same ports and ip addresses, e.g. client A sends a SYN from Aip:Aport to Bip:Bport, and B sends from Bip:Bport to Aip:Aport. Whichever packet goes out first opens the firewall to return packets from the other side, so only one retry is necessary for both sides to get the SYN and send back a SYN_ACK. Some firewalls may not accept an incoming SYN on a connection in the SYN_SENT state, so in this case the client behind the broken firewall would have to tell the server what the ip, port, and sequence numbers for the SYN packet were and the server would forward the information to the other end so that the SYN_ACK could be sent back. This could be accomplished transparently if the server is able to spoof the SYN_ACK response to the client.

    18. Re:Great article by dotgain · · Score: 2, Informative
      I think he means "tunnel" the TCP packets over the UDP "connection", which is exactly how OpenVPN and others work.

      The UDP packets that travel between two hosts (the "connection") is now analogous to some sort of LAN cabling between them: We encapsulate whatever we want inside the UDP packet, and it's probably make it to the destination. We can therefore tunnel TCP/IP inside of UDP/IP packets and get reliability and flow control, as well encrypt the contents if we want security.

    19. Re:Great article by sal_paradise42 · · Score: 1

      so how would more than one phone behind NAT work?

    20. Re:Great article by Score+Whore · · Score: 2, Informative

      TCP headers and UDP headers are quite different and a valid TCP header is not a valid UDP header. Bytes 5-8 of a TCP header are the sequence number. Bytes 5-6 of the UDP header are length, and 7-8 are the checksum. It seems unlikely that a UDP stack would be able to handle parsing part of a TCP sequence number as a length value.

      Could you encapsulate a stream that acts like TCP inside of a stream of UDP packets? Sure. But it's not you can switch to a TCP stream as the predecessor post claimed.

    21. Re:Great article by funfail · · Score: 1

      eDonkey protocol already requires a central server for search. Although it is not necessary for the two peers to be connected to the same server, it could be used for those that are.

    22. Re:Great article by Sancho · · Score: 1

      Even "trackerless" torrents could do this if any one member was not behind a firewall and could be used as the initial relay. Once all the members of the torrent have made the udp "connections", they wouldn't all have to talk to the relay much.

      The biggest problem is data reliability. With live streaming audio/video, missed packets aren't that big a deal--that is, it may suck to miss a piece of data, but you can't generally rewind the conversation, so you just ask the person to repeat himself if you missed enough to lose that part of the conversation. With p2p, you need the whole file, so you have to be capable of determining that you didn't miss anything.

    23. Re:Great article by Anonymous Coward · · Score: 0

      The BitComet torrent client has a technique for connecting peers behind firewalls -- it's probably a different thing, he called it NAT traversal.

    24. Re:Great article by tylernt · · Score: 1
      so how would more than one phone behind NAT work?
      Different port numbers.
      --
      DRM 'manages access' in the same way that a prison 'manages freedom'
    25. Re:Great article by dave420 · · Score: 1

      Isn't that the whole purpose of the bittorrent tracker? Couldn't it keep track of the UDP ports for corresponding IP addresses?

    26. Re:Great article by pilot1 · · Score: 1

      I'm not intimately familiar with the BitTorrent protocol, but I believe each chunk is checked (with SHA-1 I think) to ensure that everything was transmitted successfully. Having to resend chunks due to data loss would slow down a download, but losing a few packets shouldn't cause any major problems.

    27. Re:Great article by dotgain · · Score: 1

      ...and my apologies for the horrible typing there.

    28. Re:Great article by Sancho · · Score: 1

      Many clients will stop accepting data from clients if they receive "bad data", which is essentially what this would provide. I guess these features could be removed, but it seems a shame, as this prevents malicious users from corrupting everyone's downloads and wasting time/bandwidth.

    29. Re:Great article by larytet · · Score: 1

      ...for UDP protocols only. I did similar work in Rodi. The same info can be found on wikipedia - look for NAT Traversal

    30. Re:Great article by larytet · · Score: 1
      ...for UDP protocols only. I did similar work in Rodi. The same info can be found on wikipedia - look for NAT Traversal

      It does require a not NATed peer for initial hnadshake, but bandwidth overhead is minimal. Bottom line - there is no magic here. One point - such system will not be 100% reliable. In some cases you do need not NATed proxy for the whole session, not only initial handshake and here come costs

    31. Re:Great article by Znork · · Score: 1

      You misunderstand how it's done. TCP isnt involved in the traversal, it's just used as a communications channel over which to exchange the information needed to establish something that will be close enough to an UDP 'session' to 'trick' the firewall into considering the UDP exchanges to be responses to the internal machines requests.

      To do that you need to get both clients sending packets to eachothers NAT'ed firewall in responses to outgoing packets packets from the respective clients. As the initial packets cannot reach the destination client (they'd get blocked), you need the inbetween server to which both are connected to tell the respective clients on which port the other client was sending packets on so they can send response packets to that port.

      It's nothing new tho, it's been around pretty much since the inception of NAT, as it's more or less fundamental to ever using UDP in any extensive internet service (ie, mmorpgs, udp streaming, etc).

    32. Re:Great article by mxs · · Score: 1

      Asiding the problem that BitTorrent interclient communication is generally not UDP, this would also increase the tracker load manifold. Currently, each BitTorrent client contacts the tracker every 5-60 minutes or so. Using this technique could quite possibly increase this to a few packets per second per client on busy swarms (assuming, for the sake of simplicity, 1 pps per client, that would result in a 300fold to 3600fold increase in pps on the tracker. A tracker of ~50000 peers currently serves 300-350 requests per second. Increasing that by a few orders of magnitude is not exactly high on a tracker operators' agenda (though it might be worth it for corporate content distribution systems).

      As a sidenote, SIP implementations (internet telephony) use the STUN protocol to much the same effect.

    33. Re:Great article by Amouth · · Score: 1

      that is exactly what i ment

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    34. Re:Great article by wpanderson · · Score: 1
      he called it NAT traversal

      That's what everybody else calls it.

      --
      neuro at well dot com (when I post, it's my opinions, no-one elses)
    35. Re:Great article by Anonymous Coward · · Score: 0

      If you want to check out a TCP Nat Traversal scheme, take a look at Stunt:
      http://nutss.gforge.cis.cornell.edu/stunt.php

    36. Re:Great article by HeroreV · · Score: 0

      UDP hole punching is a type of NAT traversal. They terms are not synonyms.

  2. Nothing new here by Fenis-Wolf · · Score: 5, Insightful

    There's really nothing new, or special about this technique. Definately nothing to 'keep firewall admins up at night'. Its the same thing that Kazaa did, and Napster as well. Establish connection to a central server, central server informs each client of the others client ip address, each client connects out, NAT router sees outgoing connections to that host, and allows data in. Nothing new, or exciting.

    --

    1. Re:Nothing new here by Rycross · · Score: 4, Informative

      The OpenTNL library (a game networking library pulled from the Torque engine) does this too. I remember thinking it was pretty clever at the time.

    2. Re:Nothing new here by Tenareth · · Score: 1

      You know it doesn't have to be new to be a security issue, right? There are mitigating controls, but at least 73% of companies don't actively control these protocols. (Granted, when you talk "companies" that includes small businesses, so the % may seem high to you)

      But, as scary as it sounds... there are Fortune 1000 companies that don't actively control this attack vector.

      --
      This sig is the express property of someone.
    3. Re:Nothing new here by Chris+Pimlott · · Score: 1

      This is similar to the way FXP worked to let you transfer files directly between two FTP servers. You set passive mode and tell A to expect a file, and it says "okay, send it to a.a.a.a:aaa", then you turn around to server B and say "send me a file, I'm waiting at a.a.a.a:aaa".

    4. Re:Nothing new here by Anonymous Coward · · Score: 0

      Exactly. That's exactly how my VoIP provider works thru my NAT/firewall (w/o opening a port), or VPNs like Hamachi work, and countless others. Nothing new here. Might be an interesting read for those who didn't know, but hardly newsworthy.

    5. Re:Nothing new here by rbarreira · · Score: 1

      What attack vector? The point of the story is, if you let the network make UDP connections, the network can make UDP connections to anyone. So what?

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    6. Re:Nothing new here by jfengel · · Score: 3, Informative

      You're right that it's not new, but you're missing a crucial step. They need to exchange port numbers, not just IP addresses, via the central server (or at least one port number). Then they need to prime the firewall to pass connections through to that port by sending out a packet to the peer from that port, even though the final destination of that packet will be filtered out.

      So it's not new, but it's still pretty clever.

    7. Re:Nothing new here by Anonymous Coward · · Score: 2, Insightful

      Attack vector? If a program on the inside of your network is sending out out connections to other places on the internet at the request of another place that it is already has a connection with, you're 'attack' has already taken place if you didn't want that program running.

      This is no more of an attack vector than any other program you allow to run on your internal network that you allow to connect to external sources.

    8. Re:Nothing new here by mindstrm · · Score: 1

      How is it a security issue?

      If my users are allowed to make outgoing UDP connections (which was my choice) then why do I care if they are making that connection to another firewalled person somewhere lese in the world -vs- a computer out in the open?

    9. Re:Nothing new here by throx · · Score: 1

      Most (if not all) game engines do it, and have been doing it since the late '90s. If I recall correctly, the first I saw it was the original Battle.Net code but that doesn't mean B.Net didn't get it from someone before that.

      --

      Fear: When you see B8 00 4C CD 21 and know what it means

    10. Re:Nothing new here by Rycross · · Score: 1

      Thats interesting, but not surprising. I'm guessing that, like the OP said, the technique is very old and used pretty much everywhere UDP is.

      Where did you see the Battle.Net code? Did you work for Blizzard or are you talking about bnetd?

    11. Re:Nothing new here by Amouth · · Score: 1

      i was jsut thinking about it... and if they set the first out going packet's ttl to 1 or 2 they could make it even more effective aginst active fire walls as the udp packet would die before it makde it the other person so that they nat box wouldn't see an incoming attempt before a request from it's clients..

      that and they would save 1 packet of info per call on the net.. think abouthow much bandwidth that is :)

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    12. Re:Nothing new here by Blakey+Rat · · Score: 1

      AOL Instant Messenger used this technique for file transfers and "Direct IM" since like 1998. It really isn't even close to new.

    13. Re:Nothing new here by E++99 · · Score: 1
      There's really nothing new, or special about this technique. Definately nothing to 'keep firewall admins up at night'. Its the same thing that Kazaa did, and Napster as well. Establish connection to a central server, central server informs each client of the others client ip address, each client connects out, NAT router sees outgoing connections to that host, and allows data in. Nothing new, or exciting.

      RTFA. They're talking about punching a hole based upon the source port used by the other computer to send packets. Napster and Kazaa required setting up port forwarding on your NAT.
    14. Re:Nothing new here by MacDork · · Score: 1

      There's really nothing new, or special about this technique. Definately nothing to 'keep firewall admins up at night'.

      Ever get the feeling that this was submitted by someone who works at a telco in order to get panicky sys-admins who read slashdot to execute this.

    15. Re:Nothing new here by gknoy · · Score: 1

      I don't know if I would have thought of the solution, so it IS a clever thing. However, when reading it, I was immediately reminded of the techniques that are used in cryptography for key exchange with a trusted party (Alice and Bob both get their keys from Trent, or something like that).

      Very clear, and certainly seems to be Working As Intended.

    16. Re:Nothing new here by throx · · Score: 1
      Where did you see the Battle.Net code? Did you work for Blizzard or are you talking about bnetd?


      Should have been more specific - the first I observed this behavior was in looking at the way games connected to Battle.Net and subsequently to each other. I haven't actually looked at the code itself in either Battle.Net or bnetd.
      --

      Fear: When you see B8 00 4C CD 21 and know what it means

  3. DS by an7ron · · Score: 3, Funny

    I wish my nintendo DS did this, so I could play metroid at work.

    1. Re:DS by MyLongNickName · · Score: 5, Funny

      I wish my nintendo DS did this, so I could play metroid at work.

      And if you could disguise it to look like a cash register, your customers would have no idea you weren't ringing up their Happy Meal.

      --
      See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
    2. Re:DS by GweeDo · · Score: 5, Informative

      Um, if they worked at McDonalds they would already have free WiFi for DS gameplay.
      See here

    3. Re:DS by Meeuw · · Score: 1

      Actually, the Nintendo DS *does* this trick! As far as I sniffed Tetris DS and Mario Kart DS the connections are punched through the firewall. I've tried to firewall my wireless network so any DS could connect and play at nintendowifi but the connections are made peer-to-peer at random source and destination ports. I've started to work on a netfilter queue to do some smart firewalling (to allow holepunching through nintendowifi) but I haven't finished this yet :-(.

    4. Re:DS by an7ron · · Score: 1

      Are they blocking the ports I need? I plug a router into the wall, and it gets an IP from the network. I connect fine to the router, but in a game it always fails to connect to game server. A laptop connected to said router works fine for surfing.

    5. Re:DS by Anonymous Coward · · Score: 0

      Right up until your enthusiastic arm swinging broke the strap and landed your wiimote in their hot coffee.

    6. Re:DS by raehl · · Score: 1

      What if he works at White Castle?

    7. Re:DS by Meeuw · · Score: 1

      Probably, they might be using a transparent proxy or require you to use the proxy for port 80.

      You could try to connect to the following host: http://conntest.nintendowifi.net/ to see if they specifically blocked nintendowifi ;-)

  4. Oh come on. by SatanicPuppy · · Score: 2, Informative

    This isn't an exploit. If the admin's didn't want the firewall to forward ESTABLISHED/RESPONSE packets, they can take that capability out...One of the things I've always had issues with, with regards to commercial firewall software (e.g Zone Alarm/Windows Firewall) is that that capability usually ISN'T enabled, so I'm forever getting "APPLICATION IS TRYING TO CONNECT TO THE INTERNET" pop-ups.

    If you're using a NAT with IPTables, it's trivial to tell it to drop packets on any port regardless of whether they're established or UDP or whatever. The article represents this like it's some kind of l33t hacker tool to break down a firewall from the outside, rather than the same problem you'd have if you downloaded a trojan, or some internet-connecting spyware.

    Very misleading.

    --
    ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    1. Re:Oh come on. by jimicus · · Score: 1

      Of course it's not. But a lot of it depends on how you run your firewall.

      If it's "every packet trying to cross the firewall in either direction is blocked unless it comes from the web proxy or the mail server" then Skype will also be blocked anyhow.

      If it's "any packet trying to come in is blocked, but if the connection was originally set up from inside the network, anything goes" (which seems to be the most common configuration), then Skype will work quite happily.

    2. Re:Oh come on. by SatanicPuppy · · Score: 1

      Absolutely. It be fair, it's easiest to set up a firewall that blocks all incoming non-ESTABLISHED traffic, and allows all outbound traffic. That's two lines of code.

      Every other port or packet type you have a special case for is two more lines, so you see your work doubling in front of you with every little bit of added complexity.

      Still, if you do it right, stuff like this won't sneak up on you.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    3. Re:Oh come on. by jimicus · · Score: 1

      There is also the small issue of spyware and the like, and whether or not it should be blocked in that fashion. Though if you believe nobody has thought of tunnelling spyware traffic over HTTP you're fantastically naive - I've not actually looked into it, but I'd be astonished if they haven't, and if you don't have a half-decent AV solution which also looks out for spyware, you deserve all you get.

    4. Re:Oh come on. by SatanicPuppy · · Score: 1

      It depends. At work, I deny everything, and then open specific ports for specific traffic from specific subnets, and then every address gets monitored for usage. Catches most things, and in a work environment, blocking 99% of all ports is acceptable.

      At home, I allow all outgoing, and a tiny amount of incoming. I monitor usage with snort, to check for spyware traffic. I've been doing it for 5 or 6 years and I've never had any problems. Probably helps that I don't do any web surfing/email from Windows machines, so if something did go across port 80 from one of them, it'd stick out.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
  5. Confusing title by neonux · · Score: 5, Insightful

    From my understanding they're not talking about "hole-punching" firewalls but only about plain boring NAT traversal, which is anything but a new topic...

    --
    @neonux
    1. Re:Confusing title by Aadain2001 · · Score: 2, Interesting

      No, it is "punching" a hole in the firewall. While NAT transversal is similar to this technique, is works even if you are not using NAT (say, at an office). While it's nothing "ground braking" or really that new, it is (at least to me) interesting and probably is to anyone who isn't a network guru.

      --
      Space for rent, inquire within
    2. Re:Confusing title by SatanicPuppy · · Score: 1

      It's not even "punching a hole", so don't think about it that way.

      Many firewalls are set up to trust the computers on the inside, so if they make a connection out, the firewall allows that connection to persist by allowing packets that are a part of the internally originating conversation to come back through.

      So basically, far from having "a hole punched through your firewall", you've basically invited an untrustworthy element through your security, and it's opening a window so it can pass information back out to it's friends.

      This is a very old, classic problem with firewalls, because you want the firewall to be as inobtrusive as possible, while still offering good protection. I don't, for example, block my windows PC from sending out on any port through the firewall, because I mainly use it to play games and I never know what ports it'll need to use. However, I do monitor it's internet usage using Snort, to keep an eye out for spyware and zombie processes. If I cared, I could lock it down to web-only with trivial changes in the firewall.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    3. Re:Confusing title by Aadain2001 · · Score: 1
      So basically, far from having "a hole punched through your firewall", you've basically invited an untrustworthy element through your security, and it's opening a window so it can pass information back out to it's friends.

      Window... hole... basically a port is opened (from the inside) that allows data to into the 'secured' side of the network. You may not like the term 'hole', which conjures images of hackers and exploits, but you are, in effect, opening a 'hole' in your firewall that someone on the outside can now sent data through to your computer. That's a hole. It's also a window. It's also a door, a porthole, and channel, a port, etc.

      --
      Space for rent, inquire within
    4. Re:Confusing title by julesh · · Score: 1

      No, it is "punching" a hole in the firewall.

      There is no firewall here. If there was, there'd likely be a firewall rule that says "drop UDP packets originating or terminating on this list of addresses/ports that has been cleared for use" and nothing would happen. Most firewalls deny packets access unless there is some rule to allow them.

    5. Re:Confusing title by AK+Marc · · Score: 1

      Well, I'm behind a firewall. When I request a page from Slashdot, and it comes up, it's obvious that it works because I punched a hole through the firewall through which the data returned. It might have been an exploit. It might have been what I requested. Either way, it was a hole I punched through my firewall. Or, it was data I requested being deliverd to me after I requested it. Either way, the effect if the Skype hole puncher is no different than what firewalls let happen with all sorts of other traffic.

    6. Re:Confusing title by Aadain2001 · · Score: 1

      Exactly. A fire"wall" is a "wall" for data going in and out. Most firewalls have rules that let you punch an outgoing hole to send data and get a response. Most are also configured to not open a hole when someone on the other side of the wall (the untrusted side) requests to get in (unless they are part of the previously mentioned communication). So yes, you are making a hole in the firewall. If it wasn't a hole, the it really isn't a fire"wall" and would be more of a fire"chain-link-fence".

      --
      Space for rent, inquire within
  6. Implementing John Gilmore by Anonymous Coward · · Score: 0

    Actually, a paraphrase. "Skype interprets firewalls as damage and routes around them."

  7. Why is this so bad? by Salvance · · Score: 1

    I don't exactly think this is Skype being tricky, it's just having users establish connections and keeping them open for incoming calls. This is the same way that Instant Messaging services such as AIM work too. If the admins don't want those services enabled, they should inform their users and then block Skype IP ranges.

    --
    Crack - Free with every butt and set of boobs
    1. Re:Why is this so bad? by hey! · · Score: 1

      Well, it's not being tricky so much as efficient in the case of Skype. What's interesting is the technique being used.

      What the technique here describes is method of creating a two way connection between any two points A and B, provided that point B has a connection to point C, and that A and B can send UDP requests and receive responses. It so happens that A in Skype has a connection to C, but that's not stricly necessary.

      Now there's nothing evil about Skype doing this. They're avoiding unnecessary traffic to their network while not adding any additional traffic the users' network. But it doesn't take a genius to think of uses for the technique that are evil.

      The thing to remember here is that the administrators of A and B's firewalls do not want anybody making incoming connections to machines on their network for any purpose; otherwise they wouldn't have a firewall. Most are surely aware of Skype and by not blocking Skype's IP they are perhaps implicitly consenting to this. But what about some random web site?

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    2. Re:Why is this so bad? by Anonymous Coward · · Score: 0

      I think you're missing the point a bit. With a basic IM application, the client always remains connected to the server with a TCP connection that the client establishes when it first starts up. When a conversation is to be established, the server tells both clients to connect to a server (again via TCP) and the messages are relayed by the server. Never are the two clients directly connected to each other (For basic IM functionality).

      Skype doesn't want to relay the audio so they want both clients to connect directly to each other - that's the difference. Skype causes one client to send an outbound UDP message that it knows will never arrive at the destination client...simply to prepare the NAT router to allow the remote clients UDP messages back in and route them to the appropriate internal IP address.

    3. Re:Why is this so bad? by pla · · Score: 1

      This is the same way that Instant Messaging services such as AIM work too. If the admins don't want those services enabled, they should inform their users and then block Skype IP ranges.

      I see you've never actually tried to block AIM at the firewall...

      Twelve ports, two protocols, and ten or so class-C address ranges later, I still have some of my users occasionally succeed in getting the damned thing to connect.

    4. Re:Why is this so bad? by Tony+Hoyle · · Score: 1

      Use a proper layer 7 firewall.

      Heck, cisco routers even have them built in nowadays.

  8. Slashdot, always bringing you the hottest news by rbarreira · · Score: 1

    While this is a cool technique, I had heard about NAT2NAT years ago... This is not a new technique, by any means.

    --

    The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    1. Re:Slashdot, always bringing you the hottest news by TheNetAvenger · · Score: 1

      While this is a cool technique, I had heard about NAT2NAT years ago...

      Yes this is old news, but it is NOT NAT2NAT...

      It could be used in a NAT2NAT situation, but also could be used in a company with real IPs behind a genuine solid Firewall...

      This is just client side port opening, and the methods Skype uses to trick the firewalls to let the users have access so a direct P2P connection can be established. More or less it is a clever way of getting through a firewall, and provides the basic functionality of UPnP on a firewall that doesn't allow such things.

      Understand the difference?

  9. Ever wondered by spun · · Score: 5, Funny

    Ever wondered, how to use, commas properly?

    --
    - None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
    1. Re:Ever wondered by Anonymous Coward · · Score: 1, Funny
    2. Re:Ever wondered by CODiNE · · Score: 5, Funny

      Don't tease, those, who have graduated, from the Shatner, School of Grammar.

      --
      Cwm, fjord-bank glyphs vext quiz
    3. Re:Ever wondered by Peyna · · Score: 2, Informative

      Not to mention how to properly use an em dash.

      --
      What?
    4. Re:Ever wondered by crosseyedatnite · · Score: 1

      If, I, put, commas, after, every, word, then, the, ones, that, should, be, there, are, there, and, the, ones, that, should, not, should, be, blocked, by, the, punctuation, firewall,.

      --
      e to the i pi equals negative one
    5. Re:Ever wondered by towaz · · Score: 1

      Oh great, I'm trying to read the rest of the comments but all I can hear is Shatner in my head.

      I need, to take, a break.

      --
      "I disapprove of what you say, but I will defend to the death your right to say it." - Voltaire
  10. udp huh? by minus_273 · · Score: 1

    didnt know skype was UDP based. Most do wonders to the quality of the network. Esp if there are bugs in the protocol being used. I remember the standard project where you need to implement sliding window and AIMD on UDP to mimic behavior of the dominant TCP variety. I also remember what happened when some kids messed up and started flooding the network with packets.

    --
    The war with islam is a war on the beast
    The war on terror is a war for peace
    1. Re:udp huh? by dotgain · · Score: 1

      You generally use UDP for voice because if a packet gets delayed or lost, there's no point in retransmitting it. In fact, retransmission would cause delays, whereas a missing packet is usually handled quite well by whatever endpoints are in use (i.e. they just repeat the audio in the last packet received, and hope the user doesn't notice).

    2. Re:udp huh? by minus_273 · · Score: 1

      I know why you wouldnt really need reliable transport on voice data due to the hard real time constraints. Im more concerned with the flow control. UDP has nothing it is just data blasted on the network. a buggy protocol on top of UDP and enough people using it will bring us back to the internet crash of the late 80s. Seems like not every one remember the internet becoming unusable. There is a reason why TCP was revised to behave the way it does today. The older TCP didnt really scale up well.

      --
      The war with islam is a war on the beast
      The war on terror is a war for peace
    3. Re:udp huh? by dotgain · · Score: 2, Informative
      It's voice, not file transfer.

      We can only send packets as fast as they come out of the codec. After you've just transmitted a packet, there's maybe a 100mS wait until the next packet even exists. As long as Skype (or any VOIP stack) is working properly, the senders do all the 'flow control' necessary, simply by having a constant, regular stream to transmit. You don't want TCP flow control at all, you've either got enough bandwidth or you haven't.

  11. Punching holes? by zcubed · · Score: 1

    This isn't some earth shattering revelation. A good explanation for a layman, but nothing new.

  12. punching holes... by joeldg · · Score: 1

    Skype is starting to charge now, so that means everyone will be migrating to the next thing that is free.
    I sort of miss the dialpad.com days.

    1. Re:punching holes... by AndrewNeo · · Score: 2, Informative

      They're not 'starting to charge', their free period is ending at the end of the year just like they said when they started it.

    2. Re:punching holes... by Sciros · · Score: 1

      It's not going to be charging Skype-to-Skype, which is what this article is talking about as far as I can tell. It will be charging $30/year for Skype-to-phone... which is what it was doing from the get-go unless you're talking about its special promotion to release that functionality for free for a time. And actually to begin with it was charging 30 euros, not $30 (closer to $40 at the time). I for one doubt too many folks will go to "the next thing that is free." Me, I've been paying for Skype-to-phone and phone-to-Skype (SkypeOut and SkypeIn, respectively) since they were available because I spent most of last year out of the country, and been quite satisfied.

      --
      I like basketball!!1!
  13. Skype is a Big Tymer by Larsiny · · Score: 1

    So I guess you can say Skype is the #1 STUNna?

  14. Yawn... by Jinjuku · · Score: 0

    And this is new news how? Nothing to see here folks, move along.

  15. A Good Paper by Al+Mutasim · · Score: 5, Informative
  16. Yeah, but the technique does not work .... by hummassa · · Score: 1

    in tight network conditions (no routes for outside, only application-level proxies have connectivity)

    --
    It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
  17. you have no clue by RelliK · · Score: 3, Insightful

    If you're using a NAT with IPTables, it's trivial to tell it to drop packets on any port regardless of whether they're established or UDP.

    And how are you going to receive replies if you tell it to drop the response packets?

    The trick that this article points out is that UDP is connectionless, so even a stateful firewall will not know whether a packet is a valid reply or not. The only way to prevent this is to block UDP entirely.

    --
    ___
    If you think big enough, you'll never have to do it.
    1. Re:you have no clue by grasshoppa · · Score: 2, Informative

      Generally, it's wise not to open your mouth unless you know what you are talking about;

      The kernel firewall knows how to MASQ udp packets; There's a timeout associated with them. So if you get a random UDP packet that it doesn't have a matching connection for, it'll drop it.

      The real problem is being an administrator for a network which doesn't block outgoing traffic.

      --
      Mod me down with all of your hatred and your journey towards the dark side will be complete!
    2. Re:you have no clue by SatanicPuppy · · Score: 2, Insightful

      UDP is not connectionless. It is "stateless" which is not the same thing. Incoming UDP packets still have to open a connection with a NEW packet, so simply dropping all NEW UDP packets will keep you secure from any non-established connection.

      The IPTables code would be:

      iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
      iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT

      This still wouldn't protect you from the "attack" described in the article, so to be truly secure, you should only allow outbound UDP on ports of your choosing.

      Or you could just remove NAT for UDP:

      iptables -A FORWARD -p udp --sport 1:10000 -j DROP

      It's annoying, but it's hardly a "nightmare", and there a number of ways to keep your system secure, and to prohibit users from abusing your bandwidth with streaming applications.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    3. Re:you have no clue by mindstrm · · Score: 2, Informative

      Now we're into semantics... stateless and connectionless are the same thing.

      The nat or filter tables use the concept of a connection to allow/deny udp packets, but that is only a convention; UDP in and of itself is completely connectionless and stateless. There is absolutley nothing saying that 2 packets with the same source & destination ports are part of the same conversation at all.

      It's not even an attack anyway... if you allow outgoing connections, why do you care if the person is connecting to someone else in the world who is firewalled -vs- someone who is out in the open, or whether htey are using UDP or TCP? (let's leave network performance & abusive UDP out of it...)

    4. Re:you have no clue by Anonymous Coward · · Score: 0

      Umm... Where are those things in the UDP header?

      A connection doesn't get opened with UDP by sending a new packet, both ends must negotiate that they will listen on that UDP port.

      For instance, syslogd listens on a UDP port. When a client wishes to send data to the server, it just sends it. If the server's not listening, so what!

      The only reason those states can exist is because an intermediate network device is trying to reconstruct what the endpoints are doing and thus must track "connections".

      So in the syslog example, the server sends nothing back. It's a one way protocol and your "connection" tracker is going to watch all these UDP "connections" for no reason.

    5. Re:you have no clue by SatanicPuppy · · Score: 3, Informative

      Well, no, I suppose if you sent every packet from a UDP session to a different port, there would be no way of telling that they're all part of the same session, because you're right, UDP doesn't contain any tracking info.

      The state table entry for a UDP packet, however, contains the source IP:port and the destination IP:port, and uses that information to "track" the exchange. So unless you just allow all UDP through the firewall, the state table keeps track of how often the destination ip responds, and if it doesn't respond within the timeout set in ip_conntrack_proto_udp.c at compile time, the system will terminate that connection, and require a "new" connection to be set up between those addresses. It also won't allow the destination port to be changed without a second "NEW" packet originating from the new destination port.

      I agree it's not an "attack" as such. My original point was that it wasn't an exploit at all, in the sense that you are not able to break any existing rule using this method. If you allow UDP out, and UDP:Established in, then how can you complain that you end up accepting a bunch of UDP packets?

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    6. Re:you have no clue by SatanicPuppy · · Score: 1

      The system maintains a "State Table" which stores information about all incoming/outgoing connections. For TCP it stores stuff out of the packet headers, including sequence, and state, and all that other junk, but it also stores origin and destination, to help spot packet spoofing.

      For UDP the state table depends entirely on the origin port/address and the destination port/address. When the connection is made out, this is recorded in the table, and when the packets start coming back in, this is compared with the original entry.

      If it matches, they are accepted, if it doesn't they aren't. Additionally there is a timeout, which, in the case of linux is actually hardcoded into the kernel in /usr/src/linux/net/ipv4/netfilter/ip_conntrack_pro to_udp.c...It defaults to 30 seconds, which means, if the local IP doesn't send a response every 30 seconds, the connection will time out.

      All these people maintaining that UDP is a "connectionless" protocol are baffling to me...How do you think NAT works? Do you think that it just forwards UDP packets everywhere, hoping that someone wants them? All connection information has to be maintained with NAT, or there is no point.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    7. Re:you have no clue by whoever57 · · Score: 1
      The kernel firewall knows how to MASQ udp packets; There's a timeout associated with them. So if you get a random UDP packet that it doesn't have a matching connection for, it'll drop it.
      Which brings up an interesting question: the article talks about destination port numbers, but does not discuss source port numbers.

      Surely, iptables/netfilter also requires source ports to match? This is important, since the MASQ/NAT firewall can rewrite source port numbers, and hence the central server cannot reliably pass this information to the clients (since neither the clients nor the central server can reliably know the source port of the UDP packets after they are re-written by the NAT/MASQ firewall).

      --
      The real "Libtards" are the Libertarians!
    8. Re:you have no clue by E++99 · · Score: 5, Informative
      All these people maintaining that UDP is a "connectionless" protocol are baffling to me...How do you think NAT works? Do you think that it just forwards UDP packets everywhere, hoping that someone wants them? All connection information has to be maintained with NAT, or there is no point.

      UDP is connectionless. NAT routers invent imaginary connections based upon the outgoing packets they see, and then close the imaginary connections after inactivity. It's not part of the protocol. It's a model that the router uses to block all packets except the ones that were presumably requested.
    9. Re:you have no clue by SatanicPuppy · · Score: 1

      The protocol is connectionless, but the connection can be tracked easily enough. Bah, you're right. I just deal with the NAT end of it so often, I see connections everywhere.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    10. Re:you have no clue by julesh · · Score: 1

      And how are you going to receive replies if you tell it to drop the response packets?

      By whitelisting the protocols you want to use UDP with, and preferably only for the hosts that you expect to receive responses from, and maybe even the machines on your own network you expect them to go to.

      A corporate network should be locked down tight, and frankly most employees have no business messing around with anything that uses UDP. DNS requests should be sent to a trusted DNS resolving server, which should be the only machine allowed to make external DNS requests (and therefore receive responses to them). There may be a central VPN server that needs to accept incoming UDP packets for VPN communications. Other than this, UDP should probably be locked down completely.

    11. Re:you have no clue by TwistedSpring · · Score: 1

      Surely that doesn't matter. Whether the source port is rewritten or not external services will still try to respond to that port and the firewall will have to deal with that for things like DNS to work. The firewall can rewrite the source port so long as it remembers it did so when a response comes to that port. Now, if the firewall randomly rewrites source ports depending on destination IP the system won't work, because a datagram has to be sent to the mediation server first to establish which port the datagrams are going to come from.

      Also I think grasshoppa misinterpreted point of the parent. RelliK's point was that a stateful firewall cannot know that a remote firewall blocked the datagram it sent. As far as it is concerned, it got a response from the IP it sent the datagram to and the response was sent to the source port of the original packet (because the mediation server knows the source port that the datagrams come from and can inform the remote machine of this over an established stateful connection).

      However, other posters are right. This is really nothing new yet the article is one of the simplest explanations of the concept I've seen.

    12. Re:you have no clue by whoever57 · · Score: 1
      Surely that doesn't matter. Whether the source port is rewritten or not external services will still try to respond to that port and the firewall will have to deal with that for things like DNS to work.
      The key word here is respond. Yes, if a DNS query is sent out with the source port re-writeen, the DNS server replies with the source and destiantion reversed (what was the source is now the destination). The MASQ firewall, when receiving this packet will match the destination port in the reply with its table of connections and know that it has to re-write the packet again and send it to its internal client. Note that some simple NAT routers have much simpler matching rules

      However, in the case described, there is no reply. The remote system attempts to fake a reply, but since it did not receive an actual outgoing packet, it can't know to what destination port to send. This is only a problem with sophisticated NAT/MASQ implementations, such as is found in the Linux kernel.

      OK, some Googling shows that there is a concept of port preservation, in which the NAT router attempts to preserve the source port. In this case the system described will work for small numbers of clients (ie. when the NAT router is able to use the same source port numbers), but if there are sufficient clients and sufficient connections, the NAT router will have to re-write the source port and then the firewall won't recognise the incoming packet as belonging to an existing connection.

      --
      The real "Libtards" are the Libertarians!
    13. Re:you have no clue by Anonymous Coward · · Score: 1, Insightful

      UDP is not connectionless.

      I'm sorry, but I'm just not comfortable with this statement.

      When I send a UDP broadcast, do I then have a "connection" with each and every one of the machines that hears my datagram? If so, please tell me how I can enumerate each of these machines that I supposedly have a "connection" with.

    14. Re:you have no clue by mrbooze · · Score: 1
      UDP is not connectionless. It is "stateless" which is not the same thing

      UDP *is* connectionless. It is, in fact, a "connectionless protocol", as per the terminology that aspiring network admins are forced to learn at some point. Look up "connectionless protocol" and see what it says about UDP!

      Connection-oriented or connectionless, reliable or unreliable, these are the ways we describe our protocols.

      Stateful/stateless are also sometimes used, but they're not the official terms and they *are* synonymous with connection-oriented/connectionless from a networking perspective.

      Any fooferaw that NAT or other things try to come up with to keep track of UDP connections doesn't change the fact that the UDP protocol itself is, by definition, connectionless.

    15. Re:you have no clue by vidarh · · Score: 1

      What you are stating are implementation details of one IP stack, and certainly not something any IP stack needs to do. It doesn't make UDP a connection oriented port at all. And it still doesn't mean you know whether two packets are part of the same conversation - only that the IP stack makes certain assumptions about it for simplicity because it's "usually" right.

    16. Re:you have no clue by Anonymous Coward · · Score: 0

      First post: All these people maintaining that UDP is a "connectionless" protocol are baffling to me. Second post: The protocol is connectionless

      Think before you post, mmkay? I'm pretty baffled that someone can work with NATs and not actually know the most fundamental thing about what UDP is.

  18. Punch holes? by monkeyboythom · · Score: 0

    NAT2NAT does not "punch" as much as it "snaps" together. But it must be a slow news day and we haven't had a daily regiment of FUD.

    Funny, and I'm the one with BAD KARMA.

  19. Steps, too many. by __aatirz3996 · · Score: 1

    I'm sorry, I'm not up on UDP, but isn't there a step more than there needs to be? Specifically, if Alice tried to contact Bob -- which she does -- then she would be waiting for a response, and her firewall would therefore be open to his response. But according to their diagram, Bob's response to this will be disgarded by Alice's firewall. Am I confused, or is this just bad diagramming?

    1. Re:Steps, too many. by brunascle · · Score: 2, Informative

      both alice and bob are doing the same thing: sending a UDP packet to the other. for both, once they send out a UDP packet, that allows a UDP packet from the other side to come in.

      so whoever sends the first packet wont make it to the other side, but the other side's packet will make it across, because both holes would then be open.

    2. Re:Steps, too many. by mindstrm · · Score: 1

      bob won't get alices request, because his firewall won't allow the incoming packet.

    3. Re:Steps, too many. by David+Gould · · Score: 1

      No, that's exactly it: as I read it, Bob's first attempt to connect to Alice is discarded by Alice's firewall, but it was never intended to be received; its only purpose was to put Bob's firewall into the "waiting for response" state, so that when Alice subsequently attempts to connect to Bob, Bob's firewall interprets the incoming data as the response that Bob was waiting for. And that's exactly what it is, in the sense that Alice and Bob are both intentionally following the Skype protocol; it's just not technically a "response" to Bob's actual packet.

      That's why my take is that this isn't really a "security issue" so much as an "acceptable-use policy" issue: it only works because Alice and Bob are both intentionally running the Skype software and signed into the Skype server. Bob obviously doesn't consider an incoming call from Alice to be an "attack", because if he didn't want to receive calls, he wouldn't be running that software. Bob's local BOFH may consider it an "attack" in the sense that one of his lusers is using his network in a way that he didn't approve and is unable to control, but that's a different sort of problem.

      What's the purpose of a firewall? To protect the network from hack attacks? Or to enable BOFHs to enforce their AUPs and control how their own lusers use the network? It's really both, I guess, but at least it's only the latter that is thwarted by this method.

      --
      David Gould
      main(i){putchar(340056100>>(i-1)*5&31|!!(i<6)<< 6)&&main(++i);}
    4. Re:Steps, too many. by Simon80 · · Score: 1

      Uh, no, Bob contacts Alice first in the diagram - that VoIP call arrow in the first picture isn't data being sent, it's just an indicator of what's going on. If you don't agree, look at it this way, the arrow is black, not red or green, and it doesn't pass through any of the firewalls, therefore, it's not data being sent.

  20. The answer... by chill · · Score: 5, Informative

    ...is deep packet inspection. Instead of just letting packets thru based on "I'm just returning so-and-so's request", look to see what their payload contains and what type of stream it is. Yes, encryption can hide the payload. But, you can still prohibit non-SSH/HTTPS/SFTP streams from originating. If it isn't an approved protocol, make it go away.

    Want to REALLY torque off the Skype guys? Let it thru, just add random packet delays to each UDP packet that goes out and comes in. A few ms each should do it. Their call quality will go to hell. Things like mail, web surfing, and other non-realtime protocols won't even notice the difference.

      Charles

    --
    Learning HOW to think is more important than learning WHAT to think.
    1. Re:The answer... by Zone-MR · · Score: 4, Informative
      A few ms each should do it.

      I'm pretty sure a few ms would be absorbed by the jitter buffer. Heck, 20ms jitter is often a normal occurance on long-distance WAN links.
    2. Re:The answer... by h4ck7h3p14n37 · · Score: 1

      I can confirm that my company is using jitter buffers much larger than 20ms.

    3. Re:The answer... by Beryllium+Sphere(tm) · · Score: 1

      >Yes, encryption can hide the payload. But, you can still prohibit non-SSH/HTTPS/SFTP streams from originating.

      Skype, at least on my machine, seems to be willing to talk over HTTPS.

    4. Re:The answer... by ArtStone · · Score: 1

      Audio streaming is usually very confortable bypassing firewall restrictions by using port 80, which kind of by definition won't be blocked by dest port number. To some packet overlord snooper, the request to stream looks merely like the client has requested to download a graphics file of unknown size for a web page, and the "http" (streaming) server responds with an extremely big graphics file that takes hours to download...

      For Skype, that would not be a great solution, since (as the article mentions), the worst case scenario puts the Skype server in the middle relaying the stream's packets - which introduces both cost to Skype and delay to the stream.

      --
      Final 2006 "Proof of Global Warming" US Hurricane Count -> 0
    5. Re:The answer... by chill · · Score: 1

      HTTP and HTTPS both use TCP, not UDP. Voice programs use UDP, for the most part. A large stream of UDP over those ports won't look like a large download to a properly configured firewall because it would be a large stream of UDP.

      If Skype switches to TCP, then it becomes more difficult. It still wouldn't look like a stream because of the back-and-forth nature of voice conversation. (Yes, I know web surfing is also back-and-forth but they have distinctly different patterns.)

      Deep Packet Inspection was all the rage a few years ago, and as a result all of the major firewall vendors offer it on their enterprise-class equipment. It isn't hard to find as an option if you are looking for a corporate firewall.

      --
      Learning HOW to think is more important than learning WHAT to think.
  21. Doh - STUN by Tetard · · Score: 2, Insightful

    "Nightmare come true". What sensationalism. This is just STUN, which SIP communication devices can also use:

    http://en.wikipedia.org/wiki/STUN

  22. Alternatives Anyone? by bogaboga · · Score: 1

    What are the available Skype alternatives and how do they compare to the real Skype itself? Now that they are gonna end the `free ride' to US and Canada destinations, it ripe to begin looking at alternatives.

    1. Re:Alternatives Anyone? by WetCat · · Score: 1

      www.wengophone.com
      Moreover, it's open source.

  23. STUN? by Darkforge · · Score: 1, Interesting

    Is this just the same thing as STUN (Simple Traversal of UDP through NATs)? The technique described in the article sounds simpler than STUN, but similar in concept. (SIP uses STUN, right?)

    I've also heard that what Skype does is somehow better than STUN, though it's hard to see how. Can anybody confirm/deny/explain that?

    --

    When I moderate, I only use "-1, Overrated". That way, I never get meta-moderated!

    1. Re:STUN? by tjansen · · Score: 3, Informative

      * It's the same as STUN, the article even mentions STUN at the end.
      * STUN also supports "symetric" firewalls/NATs, I think that's not mentioned in the article. But no one uses them at home anyway, and I doubt that they are widespread elsewhere.
      * SIP can use STUN (it's not required, but pretty common now).
      * What the article does not mention: Skype can also mis-use HTTP proxys with HTTPS support to get through the firewall. That's the configuration that most companies have, and I hoped to get a bit more information about that in the article. But basically it will work similar to the common HTTPS tunnels (google for them if you don't know them), just Skype-specific instead of allowing arbitrary TCP connections.

    2. Re:STUN? by Anonymous Coward · · Score: 0

      Hmm... apparently libgaim has some stun as well.. http://gaim.sourceforge.net/api/stun_8h.html

    3. Re:STUN? by tjansen · · Score: 1

      Sure, STUN can be used for any protocol.

  24. Not exactly new by Wannabe+Code+Monkey · · Score: 3, Interesting

    Oh man, this shit is a pain in the ass. I had to look into the over the summer. This is the same technique that Apple's iChat uses for audio and video calls. Many many p2p applications use this technique to get through firewalls and NAT routers. The problem is that it doesn't always work when both computers are behind their own NAT router.

    Let's say Bob (as in the example in the article) is behind a NAT, his local ip he got from his router via DHCP is 192.168.1.2, and the public IP of his router is 2.2.2.2. He wants to use UDP port 2828 on his computer to transmit his voice data to Alice. So he sends out the first packed to 1.1.1.1:1414, as in the example. Now because of his NAT it looks like the data is coming from 2.2.2.2 and some arbitrary port (the router can't always use the same source port as the NATed computer because some other computer on the local network might already be using that port to connect to the outside world) lets say his router uses 3939.

    Now Bobs router says, "Okay, I'll let through any UDP packets sent from 1.1.1.1:1414 to 2.2.2.2:3939 and I'll pass them on to 192.168.1.2:2828". As in the example, Alice's router will just drop this packet because there is no pre-existing connection from Alice's computer using this info. Then when Alice tries to send a packet to 2.2.2.2:2828 Bob's router drops it because his router isn't expecting traffic to this port. His router is expecting packets to go to port 3939. And Bob has no way of telling Alice which port she should actually be sending packets to since he doesn't even know which port his router decided to use on the public side to send out his packets.

    You can get around this if only one computer is behind a NAT, or if you open up a persistent connection through your router to your computer. Anyway, I believe UPnP is supposed to help with this somehow, but I got so sick of it that I switched jobs.

    --
    We always knew Comcast was corrupt, here's the proof: http://tech.slashdot.org/comments.pl?sid=1909890&cid=34545432
    1. Re:Not exactly new by larien · · Score: 1

      Read page 2 of the article - it explains how Skype can bypass this, at least in some cases.

    2. Re:Not exactly new by dgatwood · · Score: 4, Informative

      Let's say Bob (as in the example in the article) is behind a NAT, his local ip he got from his router via DHCP is 192.168.1.2, and the public IP of his router is 2.2.2.2. He wants to use UDP port 2828 on his computer to transmit his voice data to Alice. So he sends out the first packed to 1.1.1.1:1414, as in the example. Now because of his NAT it looks like the data is coming from 2.2.2.2 and some arbitrary port (the router can't always use the same source port as the NATed computer because some other computer on the local network might already be using that port to connect to the outside world) lets say his router uses 3939.

      Now Bobs router says, "Okay, I'll let through any UDP packets sent from 1.1.1.1:1414 to 2.2.2.2:3939 and I'll pass them on to 192.168.1.2:2828". As in the example, Alice's router will just drop this packet because there is no pre-existing connection from Alice's computer using this info. Then when Alice tries to send a packet to 2.2.2.2:2828 Bob's router drops it because his router isn't expecting traffic to this port. His router is expecting packets to go to port 3939. And Bob has no way of telling Alice which port she should actually be sending packets to since he doesn't even know which port his router decided to use on the public side to send out his packets.

      Alice's computer should not be sending to 2828. It should be sending to the source port seen in the packets sent to the centralized server used for the rendezvous operation. Bob doesn't tell Alice anything. Bob sends a message to the central computer, which in turn, tells Alice something. The central computer DOES know what port Bob's router used because it can look at the source port on the UDP packet.

      When a breakdown occurs (rare, but possible), it is not because of the difference between 2828 and 3939. It occurs because the router picked a -different- source port to use when sending packets to Alice than it did when sending packets to the central server. If the router does not consistently map port 2828 to 3939, but instead adds a secondary mapping from 2828 to 5050 when communicating with Alice's machine, the connection may fail. However, in order for a complete failure to occur (as opposed to simply requiring two or more packets to be sent and a little extra negotiation), one of the following must be true:

      A. Both routers must be broken in this way. If this is the case, neither side can get a packet through to the other side.
      B. One router must be broken in this way and the other router must alter the source port (reverse port masquerading) of inbound traffic.

      If neither of these is true and Alice's machine is the one with the broken router, her router will use a different source port when communicating with Bob's machine that corresponds with the different destination port to which Bob's response must be sent. As long as Bob's router does not munge this, Bob's computer now knows how to send a message back to Alice, and a bidirectional communications channel should exist at that point.

      I'm not saying that any of these services/protocols handle that extra bit of negotiation, of course, just that the problem isn't unsolvable unless both routers have a critical defect in their behavior.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    3. Re:Not exactly new by Anonymous Coward · · Score: 0

      There is no central server where iChat is concerned so the technique doesn't apply. However, iChat supports UPnP so it works with most Linksys and other home NAT routers. When you install a firewall like a Cisco PIX or SonicWALL, it stops working. Then you have to explain that the real firewall hardware doesn't just let applications open up ports on a whim, but they don't care because the $70 router worked fine and the new $300+ firewall doesn't. Bah...

    4. Re:Not exactly new by Wannabe+Code+Monkey · · Score: 1
      Alice's computer should not be sending to 2828. It should be sending to the source port seen in the packets sent to the centralized server used for the rendezvous operation. Bob doesn't tell Alice anything. Bob sends a message to the central computer, which in turn, tells Alice something. The central computer DOES know what port Bob's router used because it can look at the source port on the UDP packet.

      First of all, I didn't even see that there was a second page to the article, and they went over some of NAT problems we're discussing. But furthermore, there are different kind of NATs: Full Cone, Restricted Cone, Port Restricted Cone, and Symmetric. Some routers fall somewhere in between these definitions, but netfilter/iptables is fully symmetric and these hole punching tricks won't work.

      Let's go through it again using your procedure, Bob talks to the Skype server though his NAT. Let's say the Skype server is running at 198.173.5.35:7777 this is what it looks like:

      source: 192.168.2.1:2828, dest: 198.173.5.35:7777 -> NAT -> source: 2.2.2.2:3939, dest: 198.173.5.35:7777

      Bob's router now has a mapping that says "Packets sent from 198.173.5.35:7777 to 2.2.2.2:3939 will be sent to 192.168.1.2:2828". Bob gets Alice's IP address and port from the Skype server and tries to send packets to her. Bob's router will have to use a different port than 3939 on the public side for sending packets to Alice because it's already in use sending to the Skype server. This is what that will look like:

      source: 192.168.2.1:2828, dest: 1.1.1.1:2525 -> NAT -> source: 2.2.2.2:3940, dest: 1.1.1.1:2525

      Bob's router now has a mapping that says "Packets sent from 1.1.1.1:2525 to 2.2.2.2:3940 will be sent to 192.168.1.2:2828". Meanwhile, Alice is hearing from the Skype server that she should be sending to 2.2.2.2:3939, Bob's router will certainly drop these packets, it's expecting to hear from Alice on 2.2.2.2:3940. Now the second page of the article talks about trying ports sequentially if it fails at first. It wouldn't take long to find that sending to 3940 will work, but you can't count on the NAT opening up ports sequentially like this, it can be completely arbitrary.

      Like I said, it's a pain in the ass.

      --
      We always knew Comcast was corrupt, here's the proof: http://tech.slashdot.org/comments.pl?sid=1909890&cid=34545432
    5. Re:Not exactly new by Wannabe+Code+Monkey · · Score: 1
      There is no central server where iChat is concerned

      Yes there is, it uses apple's servers to exchange the preliminary info. It's been a while since I've dealt with this, and I don't have a powerbook anymore... but open up iChat and then open up the debugging output for voice/video connections. I forget exactly where this is located, but I believe it's in the menus somewhere. Then try to start a voice or video chat with someone. You'll see it talking to apple's servers setting up the connection.

      --
      We always knew Comcast was corrupt, here's the proof: http://tech.slashdot.org/comments.pl?sid=1909890&cid=34545432
  25. Slow news day? by t00le · · Score: 1

    Today must be a REAL slow news day....

    --
    When the only tool you have is a hammer, every problem looks like a nail
  26. Easy to defend against on an Enterprise network by Smukatele · · Score: 1

    Although the author of that article tries to make it seem like this is near unstoppable, there are actually several feasable methods by which this can be stopped. 2 off the top of my head. Install an IPS. An IPS can do a deep inspection of the packet no matter the port and identify/block unwanted traffic. When Skype servers are used as a form of proxy there are several options. A)Have the firewalls block Skype IP addresses. B) Decrease the timeout value for UDP packets on the firewall.

    1. Re:Easy to defend against on an Enterprise network by julesh · · Score: 1

      Other option: don't allow incoming UDP packets, even if there has been an outgoing one, except from trusted IP addresses. I mean, you're only using UDP for DNS, right, and you know the IP address of your resolving DNS server...?

  27. Otherwise known as STUN by chhamilton · · Score: 1, Informative

    As other have already pointed out, this a very common technique. It is slowly being adopted as a standard in the VoIP and P2P world (Google Voice uses it, for one). RFC 3489 discusses this very technique, and defines a protocol to be spoken to the central server that is brokering the connection. For a good overview, you could check out the Wikipedia article. There is also a simple, cross-platform and open-source library available that implements the server and client side techniques, making it very easy to integrate this technique into other projects. Nonetheless, the article makes for a nice and simple description of the technique.

  28. At least netfilter can be fixed by Anonymous Coward · · Score: 0

    should be trivial to make netfilter randomize source port for every nated connection.

    1. Re:At least netfilter can be fixed by Anonymous Coward · · Score: 0

      So what problem are you solving? Congratulations, you've just made it impossible for your computer to connect to another computer that has a firewall. Your computer can still connect to non-firewall'ed computers on the internet (And it wouldn't even have to bother with UDP tricks, TCP would work fine...), so you're solving the wrong problem.

  29. How Skype & Co. get round firewalls by jctull · · Score: 2, Funny

    I always thought of firewalls as being some variation of a rectangle myself, so getting round firewalls would seem to make them easier to circumvent. But if the holes they are punching are round, wouldn't the round firewalls just plug the holes?

    1. Re:How Skype & Co. get round firewalls by j-stroy · · Score: 1

      Round firewalls are actually fire rings. Fire rings are not able to plug holes, because of their topology.

      Home made fire rings can actually explode, which is probably why a commercial firewall is a good idea. Unfortunately, commercial firewalls cannot be used for cooking, but they can get warm enough to thaw a burrito.

      Wikipedia Definition:
      A fire ring is a device used to contain campfires and prevent them from spreading and turning into wildfires. A fire ring may be nothing more than a short, wide section of metal tube, partially buried in the ground. Slightly more advanced fire rings may be partially covered with metal bars so that the fire may be used for cooking. These types are seen at many campsites. Fire rings in urban areas, such as on beaches, may be made of poured concrete. Makeshift fire rings can be constructed out of a ring of stones where pre-constructed rings are not available (care should be taken as some stones can explode when heated due to trapped gas pockets or thermal expansion).

  30. How long does NAt allow a reply to UDP packet? by Viol8 · · Score: 1

    UDP is connectionless so you can send a packet and get a valid reply in a microsecond or a year depending purely on how long the app is willing to wait. So how long with the NAT router wait before is prevents a UDP reply packet crossing the barrier back to the sending app?

    1. Re:How long does NAt allow a reply to UDP packet? by dotgain · · Score: 1

      In Linux Netfilter it's hardcoded at 30S apparently. It's purely implementation dependant, and a function of the NAT device, not the IP spec.

  31. Not hole punching. by mindstrm · · Score: 2, Informative

    This is not hole punching, and not a security risk.

    It is a way to get two computers that are already allowed to talk to whoever they want on the internet to talk to each other despite both having firewalls that don't allow incoming connections. It does not cause violation of firewall policy or break firewall rules in any way, it just gets over an unfortunate incompatability in this world of NAT.

    The issue only arises because both parties are firewalled.

    The short version: Using a 3rd server that both parties can connect to cleanly, the behavior of UDP is analyzed to see if source ports are static or predictable. If they are, it's trivial to have both hosts send packets to each other causing both firewalls to permit reply traffic, at which point direct communication between hosts over udp is possible.

    This is easily overcome by randomizing source UDP ports at the nat layer.

    1. Re:Not hole punching. by julesh · · Score: 1

      It is a way to get two computers that are already allowed to talk to whoever they want on the internet to talk to each other despite both having firewalls that don't allow incoming connections. It does not cause violation of firewall policy or break firewall rules in any way, it just gets over an unfortunate incompatability in this world of NAT.

      The issue only arises because both parties are firewalled.


      Exactly. As far as anyone else is concerned, they might as well be communicating via a third party relay. Except there's no need for there to be one.

      They're allowed to make outgoing "connections" by the firewall rules. This is just a way of making two outgoing connections connect to each other. If you have a problem with it, you probably shouldn't be allowing your machines to be making outgoing UDP connections.

      Nothing to see here. Move on.

    2. Re:Not hole punching. by Bob+of+Dole · · Score: 1

      I, for one, don't allow my machines to make outgoing UDP connections. Never have, never will.

      UDP IS CONNECTIONLESS! :)

    3. Re:Not hole punching. by julesh · · Score: 1


      I, for one, don't allow my machines to make outgoing UDP connections. Never have, never will.

      UDP IS CONNECTIONLESS! :)


      That's why I put "connection" in quotes. Yes, UDP is connectionless. Some firewalls, however, maintain a list of virtual UDP connections in order to allow packets into the inside of the firewall when a machine on the inside has previously sent packets to their source.

  32. Hurray for Skype, boo for asshat network nazis by Anonymous Coward · · Score: 0

    Wouldn't it be great to live in a world where the network admins were here to HELP us instead of fuck with us?

    Next asshat who tells me Sarbanes-Oxley forbids (fill in your favorite app) is going to get flogged with a cluebat.

  33. the security issue. by Erris · · Score: 1

    You know it doesn't have to be new to be a security issue, right? There are mitigating controls, but at least 73% of companies don't actively control these protocols.

    The problem is not the "firewall." The problem is needing one in the first place. The world will be a much better place when 73% of companies take the mitigating control of dumping Windoze.

    --
    DMCA, Hollings, Palladium. What might have sounded like paranoia is now common sense.
    1. Re:the security issue. by shmlco · · Score: 1

      "The world will be a much better place when 73% of companies take the mitigating control of dumping Windoze."

      At which point they'll REALLY focus on Linux where (better yet) they have the source...

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
  34. You can do this with TCP too... by sparr0w · · Score: 5, Interesting

    ... but its a little more tricky. We figured this out during our senior design project (a video communications system) - all we had to do was have the server start a TCP connection to the client over static source and destination ports, trash the connection before reset/fin packets could be sent and then turn a server on the source port. The NAT we were using would then let an incoming connection come on through to the server. With UDP its a whole lot easier, but it still can be done with TCP as well.

    1. Re:You can do this with TCP too... by strags · · Score: 1

      Surely this assumes that you know ahead of time what the external (masqueraded) TCP port number on the client will be?
      If the client's firewall uses the same TCP port as the internal client, then you're ok, but there's absolutely no guarantee of that.

  35. Re: Punching Holes in BT by thex-defect · · Score: 0

    I know you can punch holes for bit torrent, at least if you are using Azureus, as long as you setup your router to port forward/trigger to a particular UDP/TCP port.

  36. The better fix that we use at work by Anonymous Coward · · Score: 0

    Logs into linux box jacked into the core once a day and fires up iptraf...oh look udp traffic from
    worstation whatever. Sysadmin totally blocks user at firewall, only way to get internet back is to
    call Sysadmin. Sysadmin makes user remove skype from workstation before he reconnects them. Simple
    solution to the problem, network is happy again without a crap load of useless traffic blasting
    across it.

  37. Perl code by sheriff_p · · Score: 2, Interesting

    Samy, the guy involved with the MySpace worm, wrote some Perl to do this a while ago:

    http://samy.pl/chownat/

    --
    Score:-1, Funny
  38. Re: Punching Holes in BT by Crazy+Man+on+Fire · · Score: 5, Informative
    I know you can punch holes for bit torrent, at least if you are using Azureus, as long as you setup your router to port forward/trigger to a particular UDP/TCP port.


    If you're setting up port forwarding in your router, the application isn't "punching holes" you're just opening up your firewall at the router...
  39. Misleading explanation of a easily solved non-prob by Ancient_Hacker · · Score: 1
    Hmmm.
    • This isnt "hole punching".
    • Whatever that is.
    • Each client is initiating a connection to a broker.
    • The broker tells anybody that wants to know where Bob is.
    • The "firewalls" are stupidly allowing packets to come back in from any source.

    Should take about five lines of code to fix, in any firewall that really want to.

  40. am I missing something here? by advocate_one · · Score: 1

    surely the answer is to block the clients from making the initial connection to the skype server? surely someone must have a blocklist available of the skype servers.

    --
    Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
    1. Re:am I missing something here? by s_p_oneil · · Score: 1

      There can never be a complete "list" of Skype servers because when you install Skype for the first time, your PC may become a new Skype server. If you're on a DSL connection, the IP address of your server may change every few days or weeks, and there's no way to keep track of a list of potentially millions of servers that can change every day. The Skype traffic is encrypted and obfuscated, making it very difficult to detect.

      To block Skype, you either need to block all outbound traffic that's not going through a very tightly controlled proxy server, or you need to buy a blocking appliance like NetSpective (http://verso.com/enterprise/netspective/index.asp ). The last I checked, NetSpective was the only device that could block Skype without forcing your traffic through a proxy. It's able to sniff out Skype traffic and shut down all Skype connections as soon as they're created.

  41. NAT Traversal, not firewalls by phliar · · Score: 1

    As others point out, the technique has been used for many years.

    It's not even a real solution. The article says:

    From the incoming query it sees that Alice is currently registered at the IP address 1.1.1.1 and a quick test reveals that her audio data *always comes from* UDP port 1414 [emphasis mine].

    Really, always? Why do you know this? Because you tested it with your one client and the particular version of the one OS you use?

    That's the problem with this technique: it might work for some or even most NAT implementations but it cannot always work. Because NAT means that the source address and port of all outgoing packets is re-written. The NAT box is not required to follow any pattern in how it assigns the source port numbers for NAT'ed packets; in fact a good NAT box should not allow the ports it uses to be guessed. Of course the OpenBSD packet filter chooses outbound port numbers in a random (cryptographically strong if you have the appropriate hardware) manner, and this technique will not work if one of the packet filters is OpenBSD. (I don't know much about the other packet filters.)

    Sure, for a freebie like Skype, who cares if if the thing only works "most" of the time? But this is not a solution, it's just relying on undocumented behaviour of some NAT implementations.

    --
    Unlimited growth == Cancer.
    1. Re:NAT Traversal, not firewalls by vidarh · · Score: 1

      If you read the full article (both pages), you'll see that they've covered these scenarios, and that Skype provides fallbacks, the last of which is relaying through Skype's own servers (by both client making outbound connections).

  42. Not at all new by strags · · Score: 1

    This is really ancient stuff. I worked extensively on NAT traversal in 2000, and even that it wasn't a terribly original notion. The article also glosses over many of the numerous subtle differences between off-the-shelf routers/NAT devices - there are far more accurate and informative articles available.

  43. Old news and incomplete as well by Xenna · · Score: 4, Insightful

    I was impressed too when I read about it several years ago. Really, this is very old news. The P2P VPN tool Hamachi uses the same system.

    AFAIK Skype uses a fallback system when the technique described doesn't work (where UDP traffic is blocked). In those cases it uses a well connected peer (yes, that could be your Skype client) to relay the voice data to the other party. Your PC becomes a Supernode without your knowledge and consent. Well, not really, coz this is in the Skype EULA:

    4.1 Permission to utilise your computer. In order to receive the benefits provided by the Skype Software, you hereby grant permission for the Skype Software to utilise the processor and bandwidth of your computer for the limited purpose of facilitating the communication between Skype Software users.

    http://computerworld.co.nz/news.nsf/news/7AB67323D 6305E49CC2570A1001698C0

    What was it again? All your base belong to us?

    X.

    1. Re:Old news and incomplete as well by houstonbofh · · Score: 1

      AFAIK Skype uses a fallback system when the technique described doesn't work (where UDP traffic is blocked). In those cases it uses a well connected peer (yes, that could be your Skype client) to relay the voice data to the other party. Your PC becomes a Supernode without your knowledge and consent. Well, not really, coz this is in the Skype EULA: 4.1 Permission to utilise your computer. In order to receive the benefits provided by the Skype Software, you hereby grant permission for the Skype Software to utilise the processor and bandwidth of your computer for the limited purpose of facilitating the communication between Skype Software users.

      So can I packet sniff my own computer without breaking wiretap laws?
    2. Re:Old news and incomplete as well by Carewolf · · Score: 1

      Probably, but that's why Skype data is encrypted.

    3. Re:Old news and incomplete as well by Bingung+Balik · · Score: 1

      There's a 2004 analysis by Columbia University of how Skype does its sneaky business here: http://arxiv.org/ftp/cs/papers/0412/0412017.pdf. The JANET network in the UK didn't like what happened when it allowed a PC to become a supernode, as you can read here: http://www.ja.net/development/voip/skype&janet.pdf . They found in 24 hours it had talked to over 38,000 different IP addresses, maintaining 'over 660-690 open connections to different hosts'.

  44. I already published this technique in 6/3/2002 by John+Sokol · · Score: 1

    http://www.ecip.com/fwdoc.htm

    We had it in our one of our livecam video streaming product in 1997

    --
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso
  45. Re:Misleading explanation of a easily solved non-p by julesh · · Score: 1

    The "firewalls" are stupidly allowing packets to come back in from any source.

    No, they're letting packets back in from any source to which a packet has been previously sent. One of the first two packets sent by the clients will be dropped, but the others will all go through fine.

    Not that this makes it anything other than a stupid way of setting up a firewall if you're trying to regulate what protocols can be used. And if you aren't, what's the big deal?

  46. TCP over UDP by John+Sokol · · Score: 3, Informative

    Once you have a bi-directional UDP packet exchange going, (it's not a connection like TCP) but it is in some sense an unreliable connection.

    You can then route TCP over it (grab packets from /dev/tap or /dev/tun) , or use a user space TCP stack connection or use something like my ECIP (http://www.ecip.com/) over it.

    --
    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso
  47. Not scary by Anonymous Coward · · Score: 0

    The article is not scary but is a good reminder of the different ways a network's security can be circumvented. This HTTP-Tunnel should keep everyone awake at night!

    Regards,

    a non y mouse

  48. Re: Punching Holes in BT by Anonymous Coward · · Score: 1, Informative

    yes, and you can steal the crown jewels, as long as the queen willfully gives them to you!

  49. Why let UDP out anyway? by o517375 · · Score: 1

    Who needs to let UDP out anyway? We have DNS server. We have a proxy server. As a matter of fact we let nothing out.

  50. Waiting for God by HTH+NE1 · · Score: 1
    "After intensive investigation, comma, of the markings on the alien pod, comma, it has become clear, comma, to me, comma, that we are dealing, comma, with a species of awesome intellect, colon."

    "Good. Perhaps they might be able to give you a hand with your punctuation."

    "Shut up."
    --
    Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
  51. Is there a risk? by houghi · · Score: 1

    If a program can do this, can a virus or trojan could do this as well? Now people think: I am behind a firewall, so I am pretty safe, yet this prooves that it is possible.

    Isn't Skype a proof of concept?

    --
    Don't fight for your country, if your country does not fight for you.
    1. Re:Is there a risk? by Anonymous Coward · · Score: 0

      If a program can do this, can a virus or trojan could do this as well?

      Well, yes.. but this wouldn't necessarily achieve anything. There must be something running inside the firewall already. However, if security holes exist in Skype, then a firewall will not protect Skype users from remote attacks. There is a fascinating article on this subject:

      http://www.blackhat.com/presentations/bh-europe-06 /bh-eu-06-biondi/bh-eu-06-biondi-up.pdf

      In short, security holes in Skype would allow the creation of a massive Skype-based botnet that would communicate through traffic that couldn't be distinguished from normal Skype chatter. The article also contains many fascinating descriptions of reverse engineering obfuscated code.

    2. Re:Is there a risk? by vidarh · · Score: 1
      The benefit from this is that it allows two programs that are both behind NAT or a firewall to connect, but there needs to be a third server which is not NAT'ed that coordinate the connection. If you're an attacker, all you need to do is use a non-NAT'ed server and you wouldn't need this mechanism - you could just have your application connect directly to you.

      It could be used to arrange data transfer between nodes in botnets without needing any non-NAT'ed command nodes, though.

  52. Re: Punching Holes in BT by gad_zuki! · · Score: 1

    Right, and if an admin gives full-control to the local firewall to the local user then his nightmares should be about his shoddy work, not apps requesting an open port. Something tells me heise security doesnt sell too many impressions or get on the front page of slashdot without all the alarmist language.

  53. UDP *is* Connectionless; Apps might not be by billstewart · · Score: 5, Informative
    UDP is a Layer 4 protocol for transmitting packets between (Layer 5,6,or 7) applications - it doesn't have any concept of connection, state, or acknowledgements, either in the packet headers or in the protocol for what to do with those packets. By contrast, TCP creates a connection between the two endpoints, using the 3-way-handshake mechanism, window size management, acknowledgements, retransmit mechanisms, etc., and the connection has state (SYN sent, SYN-ACK received, N bytes still waiting to go into a window, FIN received, etc.)


    The Applications may or may not create Layer 7 connections or maintain state. Most UDP applications do one of three things

    • Do a simple one-packet response to a one-packet query - DNS usually works this way, and all the protocols like Echo and Daytime that got turned off due to packet-amplification attacks like smurfing work that way. The application doesn't maintain any state - it just answers your question and waits for the next one.
    • Send a stream of packets, unacknowledged, which you hope will mostly be delivered. Voice and videoconferencing applications work that way - it's better to have an occasional static or screen glitch than to slow the whole thing down waiting a few hundred milliseconds for lost packets to retransmit, watching everybody's mouth move out of sync like a bad Godzilla movie.
    • Provide a full-scale connection, emulating TCP badly at Layer 7. Applications that do this are usually designed for LANs, where they usually work, and they can get higher throughput with less CPU demand on the computer because the connections usually work and are have much lower latency and loss and higher bandwidth than the environments TCP was designed for.

      Some applications that look like this are really hybrids - they've gone to a lot of work to make sure they work fine in a stateless UDP environment, where packets might get lost or duplicated, and remote partners might go on and off line, such as remote file-system apps where the Layer 7 acknowledgement that Block 12345 has been written to disk is what the application needed to know anyway. Being stateless lets the app not have to keep track of which remote sites are currently reachable, and lets a server scale to handle lots of sporadic accesses. And sometimes the client app maintains state even if the server doesn't - the client knows it has 242344 more bytes to send to the server, but the server responds to each packet idempotently when it comes in and doesn't worry about the past or future.

    • Genuine one-shot unacked messages - telemetry apps are often like this, and sometimes logging apps are as well. If you lose the message "It's 43.123 degrees at 12:24:14", there'll be another one soon saying "It's 43.122 degrees at 12:24:15" that's probably just as useful as doing an ack and retransmit.


    Firewalls used to be manually configured for some protocols - you'd allow a UDP connection from 1.1.1.1:1414 to 2.2.2.2:2828 - and also support protocols statelessly - you'd allow ping responses, or TCP SYN/ACKs, but didn't explicitly track which responses were really from which connections. This was usually good enough for TCP, but fairly crude for UDP, since the Layer 4 protocol doesn't tell you state. Stateful inspection techniques let the firewall keep track of each exchange between two sites - you'll accept ping responses from 2.2.2.2 to 1.1.1.1 because you know 1.1.1.1 just sent a ping to 2.2.2.2, and you'll accept TCP packets from 2.2.2.2:443 to 1.1.1.1:12345 because you know 1.1.1.1:12345 did a TCP SYN to that 2.2.2.2:443 and haven't seen a TCP FIN or timed out the connection. They're simulating state, even for protocols that don't have connections or state at Layer 4, because applications usually have one or a series of packet exchanges even if they don't have state at Layer 7 (or only have state at one end.)

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  54. How come so few sip/voip apps get this right? by Sark666 · · Score: 1

    I'm behind a firewall that I don't administer and haven't bothered requesting anything regarding opening ports for voip. My provider is vbuzzer. Their program works in windows without issue, I can make and receive calls. But I use linux, on the linux side, the only one that works is linphone. The others I have tried are kphone, twinkle, ekiga and even asterisk as I liked some features in some of the other clients (but linphone has got much better). Anyway all the others only allow me to make outgoing calls.

    I've submitted bug reports to ekiga (nothing done there so far) and tried to get devs interested with asterisk but no go. So what's linphone doing right that every other voip client on linux doing wrong? I'd really like to know to point it out to the other devs.

    1. Re:How come so few sip/voip apps get this right? by Anonymous Coward · · Score: 0

      Have you tried wengophone? That seems to be able to do NAT traversal as well as Skype. And there's a GPL'ed client for it (qtwengophone in Debian main).

  55. Chicken or Egg? by rickb928 · · Score: 1

    I assume that more than a few botnets will use this for command channels, if not to deliver payloads. So did the botnets learn this from Skype et al, or did Skype, etc. learn this from botnets?

    If the latter, the only useful thing to come from botnets is this slick trick. Of course, as useful as teaching the telemarketers to use wardialers.

    -Rick

    --
    deleting the extra space after periods so i can stay relevant, yeah.
  56. This only applies to well behaved firewalls by burnt1ce85 · · Score: 1

    if you listen to Security Now podcast, this is only true for well behaved firewalls because they re-use the same port after the first transmission to recieve packets where as misbehaving routers dont. Correct me if i'm wrong or a total idiot.

  57. Seems perfectly reasonable by AaronLawrence · · Score: 1

    The client at one end is effectively telling it's NAT to expect incoming packets from another host on a certain port, just without an actual connection being made. It's a way for the two hosts (who are already communicating by another method) to bootstrap their way through their respective NATs, without one end having to be permanently configured with a hole.

    --
    For every expert, there is an equal and opposite expert. - Arthur C. Clarke
  58. No big deal with a known third party involved by Anonymous Coward · · Score: 0

    This is so 1998 (or was it 1997?)

    Anyway, I helped devise a similar system for enterprise use quite some time ago. As long as there's a known third party to introduce the systems, this is quite trivial.

    And it's not even the only way this can be done, but "punching holes in firewalls" makes people think they're clever.

  59. NAT behavior is not consistent by __aadkms7016 · · Score: 2, Informative

    See: http://www.ietf.org/internet-drafts/draft-ietf-beh ave-nat-udp-08.txt for a taxonomy of the ways NATs behave. The method described in the article won't work for all kinds of NATs.

  60. Is this correct? by kiran_n · · Score: 1

    Is this correct - AFAIK - Skype traffic from an Enterprise goes over https (at least the initial connection) - that, combined with seemingly random IP addresses makes it difficult to block Skype traffic. Am I missing something here?

  61. Microsoft's Teredo. by Backus.Naur · · Score: 1

    Teredo uses similiar ( if not the same techniques ) for running IPv6 over IPv4 networks. http://www.microsoft.com/technet/prodtechnol/winxp pro/maintain/teredo.mspx

  62. News? by Jahz · · Score: 3, Informative
    Use of the procedure described above is not limited to Skype and is known as "UDP hole punching".

    This sentence, which occurs in the last paragraph of TFA, should be further noted. The technique described here has been around for as long as NAT routers have been around (a very long time). Its fairly common knowledge/practice in network security circles. In fact, this was taught in my network security course last year. I think it was on the final as well... except we had to defeat a NAT router using TCP packets which is a slightly more tricky task.

    On a tangent:
    NAT routers are not really proper firewalls, though they have the side effect of keeping most attackers out. This is beacuse NAT was designed and implemented primarily for allowing multiple computers to utilize a single global address. They technically break the OSI stack by reaching past the link layer... and provide a bit less security than using vanilla iptables without modules. A more interesting exercise would be to describe the steps to defeat a firewall with stateful packet inspection.
    --
    There are 10 types of people in the world. Those who understand binary and those who do not.
  63. Source code? by Futurepower(R) · · Score: 1

    I don't see any way to download the source code for Wengo.

    1. Re:Source code? by Anonymous Coward · · Score: 0

      See http://packages.debian.org/testing/net/wengophone for a link to the source package.

  64. Similar technologies by bigberk · · Score: 1

    Heh we did this in 2003 and our VoIP implementation with NAT compatibility outperformed Skype at the time, had much better audio quality. (Old news).

  65. The problem is by Sycraft-fu · · Score: 1

    Cost. The more you want to inspect, the more it costs to do. The cost also doesn't necessarily scale well at the high end. In a lower bandwidth system if you are doing all packet inspection in software (meaning you have a general purpose CPU doing everything) you just need to increase CPU power to get the same bandwidth. Ok, fair enough. However at the high end you generally need to start doing things in hardware (meaning specialised ASICs that do most of the work) and that means you need new hardware, if it is even possible to do that in hardware. Especially since you have to consider how you deal with new protocols. Any time a new protocol comes out, you have to update your system or it'll get caught by the default rule. If your system is largely hardware processing, an update isn't so easy.

    Not saying it's not valid, just saying that there are reasons why all firewalls don't do deep inspection and it's not laziness.

    Also adding a few ms wouldn't matter. You find me a link that doesn't have a few ms of delay. At work I have an extremely high speed network, below 1ms internally and that goes directly to OC-3. However on that first Ethernet to POS conversion there's 3ms added. It goes up form there and it's rarely less than 20ms by the time it gets to the end. That represents pretty much a best case scenario, most people don't have connections that low latency. At home my DSL has about 50ms of latency to the first hop, and is usually about 100ms or so to the destination. In either case, voice chat works fine. Yes there's a little delay, so what? Ventrilo (that's what I use) deals with it. It'll even work with modems.

  66. This is not groundbreaking stuff by dxlts · · Score: 1

    I thought of several very similar variations of this technique years ago, and I'm sure that lots of other people have considered it as well. In my case, my goal was to effectively unblock all the stuff my company's firewall blocked us from doing (like POP3 mail, FTP sites, not to mention seemingly half of all the world's websites). I came up with numerous ways to get around the company firewall, most of which involved routing things through my home computer (which is also firewalled) with a little help from my personal website, which is hosted by a third party. I'm not patting myself on the back either. This is a fairly obvious idea if you've ever spent more than 5 minutes trying to solve this problem.

  67. Security Now by TheoMurpse · · Score: 1

    On Steve Gibson's and Leo Laporte's Security Now ep. 42, this technique was discussed. If you want to hear more about it, this is a good podcast episode to check out.

  68. Wonderful by vga_init · · Score: 1

    Great! Now make Gaim do this so I can send files.

  69. security or straight jacket? by jilles · · Score: 1

    The problem is that most system administrators consider a firewall as a means to limit user freedom. This is a way for users to bypass such restrictions (given a poorly configured firewall). From that point of view this might be bad if it weren't for the fact that they have plenty of tools left to prevent this kind of thing. In a corporate network this should be a non issue.

    From a security point of view it is not so bad, however. The approach requires software inside the firewall to initiate a connection. Firewalls can be configured to prevent this if needed but in many cases the firewall is just there to prevent uninvited guests rather than to limit end user freedom (and initiating a request from the inside implies invited guest). The only difference is that now you can initiate connections to a computer that is also firewalled.

    --

    Jilles
  70. actually you are wrong by Anonymous Coward · · Score: 0

    The amount of half-knowledge is the comments to this entry would be frightening, if the people commenting would be working in that area. Luckily we can safely assume most are just geeks that wondered out out their area of expertise.

    > A more interesting exercise would be to describe the steps to defeat a firewall with
    > stateful packet inspection.

    That's what the procedure does: It tricks the stateful packet inspection (for example the one that netfilter in linux uses), because it fools the router/firewall into thinking that the packets are "response" packets.

    Or maybe you meant to say *deep* packet inspection, which does not merely check the connection state, but looks at the (data-)payload to make decision. In that scenario the firewall/router would now what the payloads of certain protocols look like (and what requests and what responss look like), and use a whitelist filter to prevent undesired or unknown stuff from happening.

  71. Source code: by Futurepower(R) · · Score: 1
  72. what security? by marcjps · · Score: 1

    I'm not a sysadmin, but I don't think this is particularly significant.

    1. For this type of "incoming" connection to be created, the target machine has to first bounce a packet off its own NAT. So this isn't much different from creating a new outgoing connection since it can't be entirely remote initiated.

    2. Since you are already allowing outgoing connections to untrusted hosts you are at already risk, as any connection can be exploited once it is open.

    So in the scenario described there wasn't much security in the first place. To consider yourself realsonably firewalled you need to block both incoming and outgoing connections and keep a close eye on any "allowed" services. (ie, use a web proxy)

  73. Port Scanning by Anonymous Coward · · Score: 1, Interesting

    So according to this article, Skype reverts to port scanning my computer in some cases depending on how my firewall behaves.

    At least under some legislations, port scanning alone is enough to be considered an illegal attack on my information systems. Why does this not apply to Skype?

  74. Woop Dee Dee by icbkr · · Score: 1

    We've known about this bug for years. It's how you fingerprint someone's network. N00bs.

  75. Raketu.com by ice4u · · Score: 1

    Try www.Raketu.com - communications, information and entertainment all in one small p2p app - and free calling.

  76. ports 80 & 443 by dcam · · Score: 1

    In addition skype (possibly not the latest version) can open listening ports on 80 and 443.

    I was seriously pissed off when I discovered this, not just because I'd spent an hour or so tracking down why the IIS demo laptop had stopped working (so shoot me for working with windows).

    --
    meh