It’s Time to Turn Off WiFi and Bluetooth When Not In Use (Mac or PC)



A little birdie pointed me to the latest post over at the Metasploit blog.

For those of you that don’t know, Metasploit is the best thing to hit penetration testing since sliced bread. To oversimplify, it’s a framework for connecting vulnerability exploits to payloads. Before Metasploit it was a real pain to convert a new vulnerability into an actual exploit. You had to figure out how to trigger the vulnerability, figure out what you could actually do once you took advantage of the vulnerability, and inject the right code into the remote system to actually do something. It was all custom programming, so script kiddies had to sit idly by until someone who actually knew how to program made a tool for them.

The Metasploit framework solves most of that by creating a standard architecture where you can plug the exploit in one end, then choose your attack payload on the other. Assuming you can script (or find) the exploit, Metasploit takes care of all the difficult programming to connect to convert that exploit into something that can actually do anything. New exploits and payloads appear on a regular basis, and the tool is so easy even an analyst like me can use it (web interfaces are just so friendly).

Commercial equivalents used by penetration testers are Core Impact and Immunity Canvas. I tend to think the commercial versions are more powerful, but the open source nature of Metasploit means exploits usually appear faster, and it’s plenty powerful. Besides, any script kiddie (or analyst) can download it for free and be up and running in no time (full disclosure- I use Core Impact and Metasploit in live demos, and am on the Daily Dave email list run by Immunity).

So what the heck does this have to do with turning off wireless?

Metasploit is working on a module to transition kernel mode exploits into user mode. This is, say, exactly what you’d need to plug in a wireless driver hack on one side, and use that to create a reverse shell under root on the other. Sound familiar? This was one of the tricks Maynor demonstrated in the Black Hat wireless video (and why he didn’t need root).

The kernel runs in ring 0- this is below any concept of a user account. Think of it as the world before root even exists. When you exploit something in the kernel you’ve bypassed nearly every security control and can do whatever you want, but since you’re running at such a low level, without any user accounts, the kinds of commands we’re used to are a lot more limited. You can’t list a directory because “ls” or “dir” don’t exist yet. If you want a reverse shell, to execute user commands, or whatever you need to convert that kernel mode access into userland access- where concepts like user accounts and shells exist. In Maynor’s case he dropped code in the kernel to create a reverse shell to his second system over a second wireless connection. Tricky stuff (so I hear, it’s not like I can do any of this myself).

The Metasploit team specifically cites wireless driver hacks as one of their reasons for adding this to the framework. With confirmed vulnerabilities on multiple platforms and devices this could foretell a new wave in remote exploits- attacks where you just need to be in wireless (including Bluetooth) range, not even on the same network. I’ve heard underground rumors of even more vulnerabilities on the way in all sorts of wireless devices. The module isn’t complete, but everything in Metasploit tends to move fast.

Based on this advancement I no longer feel confident in leaving my wireless devices running when they aren’t in use. I’m not about to shut them off completely, but my recommendation to the world at large is it’s time to turn them off when you aren’t using them.

More device driver hacks are coming in 2007, and wireless will be the big focus.

Posted on

13 comments

  1. bkwatch Oct 23

    “In Maynor’s case he dropped code in the kernel to create a reverse shell to his second system over a second wireless connection”

    hmm.

    It sounds as if the Metaspolit “thingee” wouldn’t require you to have a second wireless connection.

    But to do so, you would need to still have to run a kernal level exploit on the wireless driver that would not crash or kill the wireless connection? Or is it easy to get the wireless driver to reboot somehow?

  2. rmogull Oct 23

    It depends. I think in some cases you could probably just restart the process, but then you have to create some sort of a wireless association which might be easier for the user to detect. Or you drop some code to call you back on whatever wireless connection is available, perhaps at a later time. If you are both on the same network I suspect exploit will be a lot easier, assuming you can restart the wireless process or avoid crashing it in the first place. Mostly people will probably drop bot payloads that automagically reconnect when there’s an active network connection.

    I strongly suspect it will vary totally based on platform and the specific kernel level exploit being used.

  3. bkwatch Oct 23

    Interesting. The real impact may be on free wireless networks. We’ve gotten to the point where the business model of free wireless is being worked out — if you want to have people cluster then free wireless works well. I’d be less concerened about turning my wireless off when I’m not using it (at work, for instance) and more concerned about logging into some unknown network while grabbing a coffee and pastry. Also, given the terrible bluetooth range of my Mac, I’m not too worried about someone sneaking in there — they would have to be on top of me to get a decent signal.

  4. rmogull Oct 25

    Bkwatch- someone sent me a better response than I could write:

    “you design your shellcode to unload then reload the wireless driver so that connection is usable again. On OSX its just a matter of kextunload/kextload. Thats how you avoid needing a second connection. Or you could just have it poll and wait for the next time a connection is established. “

  1. More Deep Codes » It’s Time to Turn Off WiFi and Bluetooth When Not In Use (Mac or PC)
  2. 2006.10.24 Daily Security Reading « Rodney Campbell’s Blog
  3. » It’s Time to Turn Off WiFi and Bluetooth When Not In Use (Mac or PC)
  4. Security Ripcord » Blog Archive » Kernel Problems On The Horizon - Wake Up Apple
  5. Don’t Panic: Bluetooth 0Day on Mac: Probably Patched | securosis.com
  6. Top Dog PC Services » Blog Archive » It’s Time to Turn Off WiFi and Bluetooth When Not In Use (Mac or PC)
  7. New Wireless Exploit- Very Nasty, Patch or Shutoff Now! | securosis.com
  8. More Wireless Kernel Bugs With Exploits: This Time It’s Netgear | securosis.com
  9. It’s Time to Turn Off WiFi and Bluetooth When Not In Use (Mac or PC) « Security News

Leave a reply

Related Posts

Don’t Panic: Bluetooth 0Day on Mac: Probably Patched
More Wireless Kernel Bugs With Exploits: This Time It’s Netgear
New Wireless Exploit- Very Nasty, Patch or Shutoff Now!