Skip to main content

3 Years of DirecTV User-Agent Command Injection

I found a bug in one of my DirecTV devices in 2015 after I got DirecTV. DirecTV didn't have a bug bounty program at that time so I used it as a demo in my classes. When AT&T bought DirecTV it then fell under AT&T's bug bounty, which is awarded quarterly. I forgot to submit it in the first post-merger quarger (2015Q4), so I submitted it 2016Q1. Screenshots from the bug bounty submission are at the bottom of this post.

EDIT: I in NO way want to steal the thunder from Ricky Lawshae and or diminish his hard work (although I think we can both agree this is about the lamest work either of use have ever had to do ;) ). My goal is to show how long crappy bugs like this sit.

I got bored a few years ago and decided to see what services the devices in my house expose.  A simple Nmap scan found listening web server on one of the devices. I browsed to it and I see this:

This is one of my DirecTV devices (I have DirecTV, solely so I can watch my precious Green Bay Packers on Sundays. And yes, it was a bad season this year). Scrolling down  further I see the following line (cleaned up for brevity):

local7.notice UTOPIA: config.webui sys_cmd : echo " (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36" | md5sum

If you look closely you see it has echo "USER AGENT" | md5sum which means that if I add a quote to my user agent I can run arbitrary commands on the device. For a quick test, I can fire up Firefox and edit my useragent.

After starting a netcat listener on my system and browsing to the remote system I see the shell come back. I got tired of using the tools on the device so I extracted the contents with netcat and tar for easier analysis on system.

One of the fun things I found was the passphrase for the device.

I performed the same test on another device and the passphrase was different. I spent a little time trying to figure out how the passphrase is generate, but didn't have much luck. I couldn't connect using the passphrase, so my guess is that there is some MAC filtering. We'll come back to that.

You can also take a peak at all the files in the www directory for all kinds of fun files.

If you browse to any of these files you see a login prompt. A simple "admin/admin" and you are in.

... and you can see the wifi settings.

It sure looks like the passphrase is correct. Let's look at the MAC address filtering.

So the connection isn't filtered by the MAC. Just to confirm that I have the correct passphrase, I captured the WPA handshake and cracked it with aircrack.

The WPA passphrase is correct and the interface doesn't show MAC filtering, but I took the MAC address of one of the DirecTV devices and it connected just fine.

So if you can access the device you get permanent access to the internal network. That a little cool.

Honestly, at this point I got distracted with other fun things and never really went back to it. For the past few years I've been using it as an in-class demo of real world command injection via the User-Agent. 

The bug is not really valuable. It is a bad bug on a near zero value device. I've been looking at Google's indexing for years and never found more than a half dozen or so devices indexed. The other attack scenario requires network access to a home user's network. If you are already on that network then there are other higher value targets. I thought about using it to maybe access content on my DirecTV system, but there are much easier ways to watch movies that don't involve "stealing" content from your own device that you pay for... monthly.

I submitted the bug to AT&T/DirecTV in March 2016. I received a follow-up email asking which product it was in to which I described the wireless bridge. I never heard anything back. Below is a screen shot of the email sent from AT&T/DirecTV after I filled in their online bug submission form. The crappy formatting is theirs, not mine.


Popular posts from this blog

Doll Hacking: The Good, The Bad(words) and the Ugly (features)

The age of internet connected toys is upon us. Increasingly, we are seeing children's toys connected to the internet, commonly through an app. I recently purchased a My Friend Cayla ( for uh…testing. I wanted to test the security of the device to see how safe it is for children.

In short, the toy does a good job of protecting children from inappropriate content, but any device (phone, tablet, laptop) can connect to the toy and play or record audio. That last bit scares me. The only protection against recording and arbitrary sound output is that only one device can be connected at a time. An opportunistic bad guy would only need to wait for the tablet or phone to go out of range or run out of battery.
Initial TestingI first needed to get a basic understanding of what Cayla can do and how she works. So I turned her on, connected her to my iPad via Bluetooth, and played with the app.

She began speaking and asking questions about me and my day. She is quite …

Extracting Access Point Names from Packet Captures

Years ago, while working as a Network Engineer, I did a bit of sniffing of our wireless access points. I noticed that some access point, mainly Cisco, broadcast the Access Point's name. I also noticed that the same access point will use a slightly different MAC Address (BSSID) for each SSID (ESSID). Typically the last nibble (half byte), or two, changes. I thought that was interesting, and moved on.

Now that I work as a penetration tester I want to correlate those access points, so I can tell exactly how many devices there are and the MAC addressing scheme. That way I can better identify something that is out of place, like a well place rogue.

Initially I did this by hand, and by hand means: teh suck!!!1! I knew there had to be a better way to do this, so I broke out scapy. I'll walk you through the process of creating a python script that extracts all the AP' MAC addresses, along with their corresponding Name and [E]SSID (if broadcast).

Let's start by looking a packet pr…