[ale] nasty UPNP bug allows EXTERNAL hackers INTERNAL access

Scott Plante splante at insightsys.com
Fri Feb 8 13:59:17 EST 2013


Thanks for the very thoughtful reply, Ron. I was actually referring to 
work. I didn't get a chance to test home until last night and it turns 
out that one was ok. It's a much newer router. We don't actually have 
guests very often at work, so that one doesn't get used much. One of the 
things we do occasionally use it for is to test being outside the 
firewall, e.g., to troubleshoot VPN connections. Still, we don't want 
our occasional guests or ourselves when we do connect to that router to 
be wide open on the Internet, so I'm very glad to have caught that 
problem. I did go through all the grc.com tests and passed.

After starting this email, I discovered the firmware update broke some 
configuration. Finally got it all straightened out again. It did pass a 
complete all 65k nmap tcp and upd port scan this time. I did understand 
about external UPnP being a bug--I was just bugged D-Link didn't have a 
firmware fix for it. It is an old device, though. I watched the whole 
Security Now video you posted. Lots of other interesting tid-bits in 
there too, like the Journal of Physical Security 
<http://jps.anl.gov/v6iss1.shtml> and the explanation of how networking 
works at a physical voltage-high/voltage-low level.

Scott

On 2/7/2013 8:01 PM, Ron Frazier (ALE) wrote:
> Hi Scott,
>
> You're welcome.  That makes it worth the time I spent to know that it helped someone.  I thought, statistically, with 1 of 50 people having the problem, that someone reading the message might have the problem.  I'm glad you discovered the issue on your dlink and were able to troubleshoot it.  You may wish to do a thorough port scan on the external ports on your router to make sure that it's not exposing any open ports.  Hopefully, you caught it soon enough that one of the cracker scans never compromised your unit.  It is possible that some configuration data could have survived the new firmware installation.  Note that the GRC shields up all ports port scanner, the part not related to UPNP, only scans the 1st 1056 TCP ports.  The GRC common ports scanner only scans about 20 ports but does also scan two which are above 1056.  Depending on how paranoid you are, you could do a more thorough port scan on your router with some other tool.  As far as I know, the potential TCP port!
>   s are 1 - 65535 and the UDP ports are the same.  You might be able to use something like nmap or zenmap (I think) to do the scan.  The two problems are that you'd have to do it external to your house and it may take up to about 1 sec / port to scan based on some experiments I've done on my Android tablet.  So, scanning all the ports might take a while.  Note also, that some upper ports will be open if you have active network connections as ephemeral ports are opened to receive replies from packets you send out, if I recall correctly.
>
> I wanted to clarify something based on what you said.  External UPNP is a bug in the firmware and is something that was never supposed to exist in the first place.  If the systems were working properly, and were designed and tested properly, there would be no such thing as external UPNP.  So, you will never see a control to disable external UPNP since it's not even supposed to exist.
>
> You said your guest router was hanging outside your firewall.  For what it's worth, I'll share a possible alternative to that which will allow you to keep your guest router inside the firewall.  This is a variation of something I use to segregate my wifi access at home from the access for my wife who uses a VPN for her company.
>
> You can gang routers together.  I have 4 routers in my house.  One for me, which throttles my download bandwidth, which I use when my wife is working.  Another one for me, which is unthrottled, for use when she's not there.  One router for her.  And one to tie them all together and send packets to the internet.
>
> In your case, your guest router could replace the one that I use for my wife.  And, the guest router would be behind your firewall.
>
> Here's how you set it up.
>
> Imagine the capital letter 'Y'.
>
> On the upper left leg of the 'Y' is your router.  On the upper right leg of the 'Y' is the guest router.  On the bottom leg of the 'Y' is the master router, which could be your firewall, which ties the other two together on one side and connects to your cable / dsl modem on the other side.
>
> Connect a lan cable from your router's WAN port to a LAN port on the switch on the master router.  Set up your router to get its WAN address via DHCP from the master router.
>
> Connect a lan cable from the guest router's WAN port to a LAN port on the switch of the master router.  Set up the guest router to get its WAN address via DHCP from the master router.
>
> Connect any devices that need to be shared, like a printer, to a LAN port on the switch of the master router.
>
> Connect the WAN port on the master router to the cable / dsl modem.
>
> This way, your router and your guest router are both behind your firewall.  The guest router is a separate network and will be completely isolated from your network.
>
> If the master is 192.168.1.1, and yours is 192.168.2.1, and the guest is 192.168.3.1, then:
>
> Users / programs on your router can communicate with other users / programs on that router.
> Users / programs on the guest router can communicate with other users / programs on that router.
> Users / programs on either your router or the guest router can communicate with users / programs / devices on the master router, or with the internet.
>
> In this case, you have three separate networks, which are the lan switches and the wifi interfaces of each respective router.  It will be impossible for your router to communicate with the guest router, but that's the kind of isolation you want for the guest.
>
> Another option is that many modern routers have a guest login feature available.  This allows you to set up a separate SSID and separate password for the guest.  Most routers which have guest logins have a feature which Netgear calls "wireless isolation".  If you turn that on, guests cannot access other wireless clients on the same router.  They also have a feature which allows the guest to only access the internet.  If you turn that on, the guest cannot access anything attached to the lan switch of the router.  With both these on, the guest can only access the internet or anything on the downstream router, like the printer, etc.  However, if you really wanted to nail it down, you could program your master router / firewall to only allow data coming from the guest router to access the internet.
>
> Hopefully that makes at least some sense.  Glad you solved your problem.
>
> Sincerely,
>
> Ron
>
>
>
> Scott Plante <splante at insightsys.com> wrote:
>
>> Thanks, Ron! Our main network was fine, but the little D-Link wireless
>> router we have hanging outside the firewall for guest Internet access
>> did have the flaw. I had to both update the firmware, and then I had to
>>
>> completely disable UPnP.  I still couldn't just disable the external
>> UPnP. Of course, in our case we don't really want guests modifying the
>> config on the router anyway, but it's disgusting that there's still no
>> fix to just block external UPnP to this day.
>>
>> Scott
>>
>> On 2/7/2013 3:06 PM, Ron Frazier (ALE) wrote:
>>> Hi all,
>>>
>>> I wanted to let you know about a nasty bug in the UPNP implementation
>>> of millions of routers.  This could allow an external hacker free and
>>> open access to your internal network.  I think this mainly applies to
>>> home and small office routers, but this could apply to commercial
>> ones
>>> as well.
>>>
>>> UPNP stands for Universal Plug and Play.  It is a feature of almost
>>> all routers that is usually on by default.  It allows things INTERNAL
>>> to your network, like XBox game systems, Skype, DVR's and other
>> things
>>> to OPEN HOLES for incoming communications through your firewall,
>>> usually without your knowledge or permission, and sometimes without
>>> your ability to monitor or control it.  This is designed to allow
>>> gamers, for example, to instantly participate in network gaming
>>> without configuring the router.  It generally doesn't require
>>> authentication, and assumes anyone making a UPNP request from within
>>> your network is trustworthy.  This, in itself, is somewhat of a
>>> security risk, and I've had UPNP turned off for years on my routers.
>>> It's one of the first things I disable when I set up a router, since
>> I
>>> have no need for it.
>>>
>>> They discussed the new issue, which is much much worse, on the last
>>> two Security Now podcasts.
>>>
>>> http://twit.tv/sn
>>> http://twit.tv/show/security-now/389
>>> https://www.youtube.com/watch?v=wEa43qM4JjQ#t=09m44s  (Youtube video
>>> of 389.  Relevant part starts at 09:44.)
>>> http://media.grc.com/sn/sn-389.mp3 - MP3 audio of 389.
>>> http://twit.tv/show/security-now/390
>>> http://www.grc.com/securitynow.htm  (Episode 390 hasn't been posted
>>> here yet, but should be shortly.)
>>>
>>> UPNP was always intended to be used only on your INTERNAL LAN.  It
>> was
>>> never intended to be exposed on the Internet on the WAN.  A group of
>>> security researchers at Rapid7 spent months last year using bots to
>>> probe EVERY routable IPv4 address on the Internet. They sent UDP UPNP
>>> discovery packets to every address several times.  The results of the
>>> probes were both surprising and very disconcerting.
>>>
>>> They found that 2.2% of ALL IPv4 routers exposed to the internet
>>> responded to UPNP discovery requests.  This corresponds to 81 MILLION
>>> routers.  This means that they are exposing the UPNP service to the
>>> EXTERNAL internet at large.  This is a MAJOR security flaw.  Of
>> those,
>>> 20%, or 16.2 MILLION are exposing their SOAP API to the EXTERNAL
>>> internet at large.
>>>
>>> This means that a REMOTE cracker, just by sending a few UDP packets
>> to
>>> your router's EXTERNAL address, can punch holes in your firewall and
>>> break into your INTERNAL LAN just as though he was your XBOX sitting
>>> in your house.  It requires no authentication or decryption on the
>>> cracker's part, and is trivially easy.
>>>
>>> This is very bad news for the 81 million people, most of which, don't
>>> even know they are vulnerable.
>>>
>>> For years, Steve Gibson has been operating the Shields Up service on
>>> his website.  It provides a way to scan your network from the outside
>>> to see if net bios is being exposed, or if common TCP service ports
>>> are being exposed.  In light of these events, he has added testing
>> for
>>> the UPNP vulnerability.
>>>
>>> I would recommend that each person reading this make use of Steve's
>>> port scanner to test your router's external IPv4 address to determine
>>> if you are vulnerable to the UPNP attack vector. Here's how.
>>>
>>> Go to the Shields Up main page at:
>> https://www.grc.com/x/ne.dll?bh0bkyd2
>>> You will probably have to trust grc.com in noscript, etc. for
>>> everything to work.  Read what it says there and click proceed. Keep
>>> in mind, some of the verbiage is a decade old, but the site is still
>>> very useful.  The stuff related to UPNP is new.
>>>
>>> Once you're on the second page, you will get to a screen with some
>>> menu buttons on it.
>>>
>>> Click the orange GRC's Instant UPNP Exposure Test button.
>>>
>>> His server will query the UPNP ports for your external IPv4 address.
>>> It will then report back as to whether your router didn't respond at
>>> all (PREFERABLE), actively rejected the remote request (OK), or did
>>> respond to the UPNP discovery request (BAD). The result page also
>>> contains verbiage explaining the results.
>>>
>>> Note that a simple port scan, like from nmap, will not do the trick
>>> here.  First, you have to send the scan from outside your router, on
>>> the internet side.  Second, the UPNP discovery request is a
>>> specifically formatted UDP packet, not just a simple ping. Since it's
>>> UDP, the source address can be spoofed by a cracker.
>>>
>>> If your router is in the category that did respond, you are
>>> potentially vulnerable to attack.  At the very least, a cracker could
>>> find out that your UPNP service is listening on the WAN, and it will
>>> probably tell him which UPNP stack you have in its reply. This may
>>> give him the info he needs to attack you.  If your router is among
>> the
>>> 1 in 5 (of the 81 million) that exposes its SOAP API to the WAN, you
>>> are vulnerable to immediate attack.  If your router responds to an
>>> external UPNP request, which it NEVER should, you should find a way
>> to
>>> turn off that functionality and retest it.  If you cannot turn it
>> off,
>>> you should discontinue using this router.
>>>
>>> While you're there on the Shields Up page, you can select other
>>> buttons as follows:
>>>
>>> File Sharing - tests to see if your router is exposing any net bios
>>> file sharing ports to the WAN.
>>> Common Ports - tests to see if certain commonly used TCP service
>> ports
>>> are listening on the WAN.
>>> All Service Ports - tests to see if the first 1056 TCP service ports
>>> are listening on the WAN
>>> User Specified Custom Port Probe - used to test a specific TCP port
>>> number after entering it into the blank.
>>> Lookup Specific Port Information - used to lookup data about what
>>> certain port numbers are commonly used for.
>>>
>>> Here are other resources that Steve provides relative to the UPNP
>>> problem so you can research it:
>>>
>>>
>> https://community.rapid7.com/servlet/JiveServlet/download/2150-1-16596/SecurityFlawsUPnP.pdf
>>
>>> http://toor.do/DEFCON-19-Garcia-UPnP-Mapping-WP.pdf
>>> http://www.upnp-hacks.org/upnp.html
>>> http://toor.do/upnp.html
>>>
>> http://www.h-online.com/security/news/item/Millions-of-devices-vulnerable-via-UPnP-Update-1794032.html
>>
>>>
>>> I recommend that you test your internet facing IPv4 addresses for
>> UPNP
>>> vulnerability immediately.  If your router responds to the external
>>> UPNP inquiry, I suggest turning off UPNP from its control panel and
>>> retesting.  If it still responds, consider upgrading the firmware and
>>> retesting, or removing and replacing the router.
>>>
>>> I hope you find this information useful.
>>>
>>> Sincerely,
>>>
>>> Ron
>>>
>>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>
> --
>
> Sent from my Android Acer A500 tablet with bluetooth keyboard and K-9 Mail.
> Please excuse my potential brevity.
>
> (To whom it may concern.  My email address has changed.  Replying to former
> messages prior to 03/31/12 with my personal address will go to the wrong
> address.  Please send all personal correspondence to the new address.)
>
> (PS - If you email me and don't get a quick response, you might want to
> call on the phone.  I get about 300 emails per day from alternate energy
> mailing lists and such.  I don't always see new email messages very quickly.)
>
> Ron Frazier
> 770-205-9422 (O)   Leave a message.
> linuxdude AT techstarship.com
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20130208/b32d591a/attachment-0001.html>


More information about the Ale mailing list