From Black Box to Root Shell: Reclaiming a Consumer IP Camera
I bought four Galayou G2 cameras for a little over $50. At that price I could afford to learn something the hard way. Naturally, I did.
Each one is a little USB-C-powered Linux computer with Wi-Fi, a camera, two motors, a microphone, and a speaker. I wanted to see how much of that hardware I could put to work with my own software.
The slides and the recording below are from my talk for the Central Indiana Linux Users Group (CINLUG).
Why bother?
If I were in Ukraine trying to get through another night of drone attacks, I'd want to know whether I could repurpose a cheap camera I already owned to give me an early warning. How much time could I buy with the hardware I already had?
I think about what that would look like here, too. If the United States went to war with China, a major supplier of electronics, parts we can order without a second thought today could be hard to find. Knowing how to repair the hardware we have and give it another job could become a survival skill.
Even when parts are easy to get, the hardware can outlive its software support. A 2024 FTC staff study looked at 184 smart products and found that nearly 89% of their product pages gave buyers no indication of how long the devices would get updates.
That same year, the Justice Department announced the disruption of a botnet of more than 200,000 compromised devices, including cameras. Many of the devices still had vendor support. I wanted to see what it would take to maintain some of the little computers we've already paid for.
What works without the Internet?
I put a stock camera on a GL.iNet Opal running OpenWrt, unplugged the router's Internet uplink, and captured traffic on the router. The camera kept asking for htpdate.ajcloud.net. The queries failed, as you'd expect on a network with nowhere to send them.
The phone app needed an account and Internet access to make the setup QR code. The camera itself could scan a saved copy with the uplink unplugged. The code held the Wi-Fi details and a field called c. When I tried deleting that field, the camera I tested wouldn't join Wi-Fi. Leaving the field in place with an empty value worked, and the camera still tried the same DNS name. I never figured out what c was for.
I used Nmap to scan the stock camera's TCP ports from my desktop on the lab network.
1 | nmap -sT -sV -p- CAMERA_LAB_IP |
1 | PORT STATE SERVICE |
ospf-lite was Nmap's guess based on the port number. I checked ONVIF separately, and it required authentication. HTTP returned JSON, and I couldn't find a browser control panel or a working way to move the camera locally. The good news was that VLC opened the RTSP stream without asking for a password.
1 | rtsp://CAMERA_LAB_IP:554/live/ch0 |
If all I wanted was a picture, I could've stopped there. But there were two motors in this thing, and I wanted to make them move.
I took it apart

The plastic base flexed enough to pop off, though a couple of tabs around the eye put up a fight. The pan motor sits in the base, with a bundle of wires running up into the eye where the main board, lens, and speaker live. If you roll the eye up, there's a little microSD slot underneath. It ended up saving me a lot of trouble.
The board had four pads for a UART serial console. My first attempt at soldering used wires that were far too thick. One pulled the RX pad off the board. While trying to fix it, I knocked off a resistor too. I put the pieces in a bag, which I recommend as a storage format for anything you've accidentally turned into a kit.
For my next attempt I used another camera and some 38-AWG enameled wire held down with Kapton tape. The wires were about as thin as hair. You can judge the soldering for yourself. It held.

I crossed TX and RX between the board and a USB serial adapter, connected a common ground, and left the adapter's power lead disconnected. The adapter needs to match the board's logic voltage. I guessed 115200 baud, 8 data bits, no parity, and one stop bit, then opened picocom with flow control disabled.
1 | picocom --baud 115200 --flow none --databits 8 \ |
Text finally scrolled across my screen. The camera had 64 MiB of RAM, an Anyka AK3918AV130_B with an ARM926EJ-S CPU, and an 8 MiB SPI NOR chip the kernel called ZB25VQ64. It ran Linux 4.4.302-cip94 and ended up at a login prompt. I had a console, which was wonderful right up until it asked for a password.
I checked whether I could save myself some work with an existing camera OS. A Thingino discussion about the LSC 3215672 documented that camera changing from an Ingenic chip to an Anyka chip while keeping the same model number. So much for shopping by model number. I couldn't find a verified Thingino image for my board. OpenIPC lists Anyka support, but I'd still have to sort out the details for this board, including the sensor and Wi-Fi.
Root for one boot
Before Linux starts, there's U-Boot. This camera ran version 2019.10 with a password prompt of its own. I found a bootloader password online that worked on my unit. From U-Boot I could load the kernel and device tree into RAM. The device tree describes the board to Linux, including things like RAM and GPIO. U-Boot also passes Linux its command line, so for one boot I used init=/bin/sh to start a shell in place of the usual init program.
Here's what I ran at my U-Boot prompt. The setenv command is one line.
1 | run read_kernel |
The two addresses in bootm point to the kernel and device tree in RAM. The middle - means there's no separate initial RAM disk.
At my first embedded Linux job, my boss handed me a new board and told me to get Linux running on it. I spent about a month looking at a black screen because I'd set the U-Boot addresses wrong. The kernel was overwriting memory it needed while decompressing itself. I used the addresses from the camera's boot output this time. I had already paid for that lesson.
This time id said I was root. Linux had mounted the stock SquashFS root filesystem read-only, and the usual startup scripts and camera services hadn't run. The next regular boot would go right back to the stock login prompt.
Eight megabytes, twice
The kernel had printed a map of the flash chip during startup. The offsets below count bytes from the start of that chip. The addresses U-Boot uses for a copy in RAM belong to a different address space.
| Region | Start | End (exclusive) | Size |
|---|---|---|---|
| U-Boot | 0x000000 |
0x040000 |
256 KiB |
| Device tree | 0x040000 |
0x050000 |
64 KiB |
| Kernel | 0x050000 |
0x210000 |
1,792 KiB |
| Root filesystem | 0x210000 |
0x300000 |
960 KiB |
| Application | 0x300000 |
0x7a0000 |
4,736 KiB |
| Configuration | 0x7a0000 |
0x800000 |
384 KiB |
I used U-Boot to copy the full 8 MiB from flash into RAM and save it to microSD. I did it twice and compared the two files byte for byte. They matched. Now I could leave the original dump alone and take a copy apart on my laptop with a little Python.
1 | from pathlib import Path |
I opened the sliced-out filesystem with unsquashfs. That's where I found /etc/shadow and the stock password hash for root.
Root after a reboot
I changed the root password hash in a working copy and rebuilt the SquashFS image. I compared the rebuilt files and their metadata against the original. Changing a password was quite enough excitement for one flash write.
The padded image had to fit in exactly 960 KiB. I wrote just the root filesystem partition, read the whole partition back into a separate RAM buffer, and compared all 983,040 bytes. They matched. The camera went through a normal boot, the vendor app started, and I logged in as root with my new password. Now I could see what all the stock software was up to while it ran.
I also tried recovering the original Linux root password. Its hash in /etc/shadow used MD5-crypt, so I gave Hashcat a list of 1.97 billion guesses to test on my RTX 3090. At about 2.84 million checks per second, testing the whole list would take around 11.5 minutes. In a separate experiment I estimated about 27 hours to try every alphanumeric password from one through eight characters. I didn't recover the original password.
Making it say hello
The stock startup scripts launched a supervisor called daemon, which kept the camera app (ipc) running and fed the hardware watchdog. Killing ipc caused the camera to reboot in my test. The same app owned the sound and motor devices, so I had my startup script launch my own programs in place of both the supervisor and the app. I kept the stock kernel and drivers.
I started with file and readelf to identify the binaries and see which names were still in the library's symbol table.
1 | file ipc libgv_ipc.so |
Then I used Ghidra to follow the calls in the vendor binaries. Its decompiler gives you C-like code, complete with such informative variable names as unaff_r4. One function did still have a call to gv_timer_stop. Little clues like that gave me somewhere to go when a function was otherwise a mess of registers and offsets.
For audio, I decoded the WAV and opened the PCM device. The driver calls below set the format, route the sound to the DAC, queue the samples, and start playback. The whole greeting fit in the buffer, so a short write was an error. A separate GPIO switched the speaker on and off, and the rest of the player handled cleanup.
1 |
|
The motor driver took a command with an axis, a direction, and a step count. A count of zero asked it to stop. This was the cleanup after a short move. My helper checked that the driver was initialized and idle before asking it to move, and it needed exclusive access because opening or closing the motor device affected both axes.
1 |
|
On the bench, my startup script played a WAV greeting through the camera's own speaker. Then, with the housing open, the mechanism did a little dance, one short move in each direction on both axes.
I suppose I could mine Bitcoin on it now, if I had a few spare centuries. A local baby monitor seems more promising.
Extra Credit
Finding the U-Boot password online saved me some work. If you can't take that shortcut, another way to get a copy of the bootloader is to read the SPI flash chip directly. I had a Tigard to talk to the chip and a Pomona 5250 clip to grab its pins while it was still soldered to the board. The coating kept the clip from making reliable contact, so I never got a dump that way.

The chip was marked 25Q64DSIG and HK2534. The boot log from the other camera led me to the ZB25VQ64D family datasheet as a reference. Check the pinout, supply voltage, and what else shares the bus on the board before clipping anything on. I'd want two matching reads here, too.
Once the clip makes reliable contact, here's how I'd save the first copy with the Tigard.
1 | programmer='ft2232_spi:type=2232H,port=B,divisor=4' |
After safely reseating the clip, I'd read it again and compare the two files.
1 | flashrom --programmer "$programmer" --read flash-second.bin && |
I already had a dump from the microSD backup. The partition map puts U-Boot in the first 256 KiB, so I pulled out that part and looked through its printable strings.
1 | dd if=camera-full.bin of=uboot.bin bs=1024 count=256 && |
That turned up readable authentication text. If the vendor stores the bootloader password as a hash, you can try the same general idea I used for Linux and test guesses offline with Hashcat. You'd need to identify the hash format used by the bootloader and check that Hashcat supports it.
There's more to build
I can boot the modified camera and control the speaker and motors from my own programs. To use it as a camera again, I'd need to bring back local video, get Wi-Fi setup working, and give it controls I'd trust with the housing back on. The reset button, homing and travel limits, and a tested way to update and recover the thing are still on my list.
I hope you finish this feeling like you can do it, too. I want all of us to be able to take control of the devices we own. You can start with something small, like finding out what an old device does when you unplug it from the Internet. Write down what you learn and share it. The next person opening the same box will have somewhere to start.