Dev.to Security 🔐 Cybersecurity 👁 0 📖 6 min read

I Found a Botnet Inside My Own House

In the last post I talked about building a remote control app that had to grow a fourth backend just for generic, uncertified Android TV boxes — because one of the boxes in my own house didn't speak either of the two "re

In the last post I talked about building a remote control app that had to grow a fourth backend just for generic, uncertified Android TV boxes — because one of the boxes in my own house didn't speak either of the two "real" remote protocols. While poking at that box to figure out why, I went looking for what it was actually running.

I was not expecting to find a botnet node.

The setup

The device in question is a cheap Android TV box — the kind sold under a dozen different no-name brands, same board, same firmware, just a different sticker. It had been sitting on my home network for a while, doing normal TV-box things. I plugged in over ADB to poke around, mostly out of curiosity about why my remote app couldn't talk to it the normal way.

(That remote app is the one from part 1 — code's at github.com/duvanjamid/tv-remote if you want context on what it was trying to do.)

First red flag, before I'd even looked at a single app: SELinux was set to permissive, not enforcing. On stock, certified Android devices, SELinux enforcing is non-negotiable — it's one of the core sandboxing guarantees the whole security model leans on. Permissive mode logs policy violations instead of blocking them. There's no legitimate reason for a consumer device to ship that way; it's what you leave on during development, not what you ship to a customer's living room.

That alone was enough to make me look closer.

What was actually running

A few things stood out immediately when I started going through installed packages and running processes:

  • A dropper app posing as Google. A package that was neither in the device's visible app drawer nor a package Google actually publishes, using a name clearly chosen to blend in with legitimate system components — things like com.google.android.adengine, styled to look like it belongs next to com.google.android.gms in a package list, but isn't a real Google package at all.
  • A persistent daemon running as root, started at boot, with no corresponding user-facing app or settings entry — just a process that was always there, always root, and not accountable to anything in the UI.
  • Dozens of simultaneous outbound connections, all leaving the box around the same time, to a spread of external hosts that had nothing to do with anything I was doing on the TV. Not "device phones home to check for updates" — more like the connection pattern you'd expect from a device being used as a traffic relay for someone else's requests.

None of this was doing anything to the TV's actual function — the box played video fine the entire time. That's the point. This isn't the kind of malware that announces itself with a ransom note; it's the kind built to be invisible to the owner indefinitely while the device does unrelated work for somebody else.

This has a name: BadBox

This pattern — Android TV boxes shipping from the factory with a pre-installed dropper, disguised as Google components, dropping a persistent root-level backdoor, and enrolling the device in an outbound-connection botnet (residential proxy / ad-fraud / click-fraud infrastructure, typically) — is documented at scale. Human Security and Google have both published research on it under the name BadBox and its successor BadBox 2.0: supply-chain malware baked into the firmware of cheap, uncertified Android TV boxes and streaming devices before they're ever sold, affecting what's been reported as millions of devices worldwide, largely sold through marketplaces with little vetting.

The uncomfortable part isn't that malware exists. It's where it lives: not in a sideloaded app you can uninstall, but baked into the system partition of a device you bought in good faith, running with permissions a normal app could never get, on a permissive SELinux policy that makes "normal app" containment moot anyway.

Want to check your own box? Here's how

Everything above is checkable on your own device with nothing but adb and a few minutes. Swap in your own box's IP for the placeholders below, and treat every hit as "worth a closer look," not a confirmed verdict.

Disclaimer: only run this against hardware you own. This is for auditing your own device — not someone else's without authorization. Uninstalling system packages can have side effects (broken functionality, instability); do it at your own risk.

  1. Connect over wireless ADB. Turn on Developer Options → Wireless debugging on the box first, then:
   adb connect <IP_OF_YOUR_BOX>:5555

Accept the on-screen authorization popup on the TV the first time.

  1. Check for factory root access.
   adb shell "su -c id"

Returns uid=0(root) with no fuss? That's root access that didn't come from you — not normal for a consumer Android box.

  1. Check SELinux enforcement.
   adb shell getenforce

Should say Enforcing. Permissive is the red flag from above.

  1. Cross-check the Android version against its SDK level.
   adb shell getprop ro.build.version.release
   adb shell getprop ro.build.version.sdk

If the pair doesn't match Android's real version↔API-level table, build.prop was hand-edited — usually to make the box look newer/more legitimate than it is.

  1. List user-installed packages and look for Google impersonators.
   adb shell pm list packages -3

Watch for anything prefixed com.google.android.* or com.android.* that isn't a real Google package — like com.google.android.adengine from the box in this post (full list above).

  1. Trace who installed a suspicious package.
   adb shell dumpsys package <suspicious.package.name> | grep installerPackageName

Helps reconstruct the dropper chain.

  1. Snapshot running processes.
   adb shell "top -n 1 -b"
  1. Snapshot active network connections.
   adb shell "cat /proc/net/tcp"
   adb shell "cat /proc/net/tcp6"

rem_address is hex IP:port — decoding it by hand isn't worth it; the simpler heuristic holds: dozens of simultaneous connections to different remote IPs on odd ports, with nothing you're actively doing on the TV, is itself the signal.

  1. Remove what you find.
   adb shell pm uninstall --user 0 <package.name>

Clears the dropper for your user — not the firmware it came from. Mitigation, not cure.

What I did about it

Once I'd identified the specific packages behaving as droppers/backdoors, I removed them. The device's free memory went from 35MB free to 220MB free after cleanup — which on its own tells you roughly how much was quietly running in the background the whole time, on a box that's supposed to just play video.

That's a mitigation, not a fix. The dropper's gone, but the firmware it came from is still the firmware on the device — same root daemon framework, same permissive SELinux policy, same unknown provenance for everything else in that system image. Cleaning the apps off a BadBox-infected device is treating the symptom. The actual fix is the firmware itself, and that's a bigger job.

Which is exactly what I'm doing next — and it's not done yet.

Next up: backing up every partition on this thing before touching anything, and figuring out whether the safer move is to re-patch the existing images or replace the whole thing with a clean, official Google image. Still in progress — post 3 →

A note on scope: packages, process behavior and the BadBox pattern above are public, documented security findings and are shared for exactly that reason. Network identifiers specific to my own setup (local IP, device names, Wi-Fi network name) have been left out or genericized — they're not relevant to the finding and there's no reason to publish them.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.