A home security camera can be great for peace of mind, and keeping an eye on the house while you’re away. The popular option these days is an IP-based device that is accessible over the Internet through an ethernet or wireless connection to your home router. But what if you could cut out the middle man, and instead turn your router itself into the security camera? [Fred] is here to show us how it’s done.
The hack begins by parsing the original router’s firmware. Through a simple text search, a debug page was identified which allowed telnet access to the router to be enabled. This gives access to a root shell, allowing full control over the Linux system running the show.
After backing everything up, [Fred] grabbed the source code from Netgear and recompiled the kernal with USB video and Video4Linux2 support. This allows the router to talk to a standard USB webcam. It’s then a simple matter of using opkg to install software to set up the router to record video when motion is detected.
Overall, it’s fairly straightforward, but [Fred] came up with an ingenious twist. Because the router itself is acting as the security camera, he is able to set up the camera to only arm itself when his smartphone (and thus, [Fred] himself) is not at home. This prevents the recording of footage of [Fred] moving around the house, allowing the router to only record important footage for security purposes.
It’s possible to do great things with routers – most of them are just tiny boxes running Linux anyway. Check out this one used as an online energy meter.
[Lame comment]
[Abrasive reply]
if you had bothered reading the first line of the linked post:
> Alternative firmwares like OpenWRT or LEDE exist, but they don’t fully support all stock features yet. So instead this approach is based on modified stock firmware.
Open WRT have had USB support for more than 10 years USB webcams also. My old Fonera router V2.0 with a single USB port had an USB camera and server running. What he says in the article, is that some other features of his Netgear router are not yet supported by open WRT.
suppose they wanted to use those stock features of their netgear?
“Grabbed Source from NetGear” Um you mean from OpenWRT.
IF he could get his hands on the Source from NetGear he wouldn’t have needed the Backdoor to root in the first place.
> IF he could get his hands on the Source from NetGear he wouldn’t have needed the Backdoor to root in the first place.
GPL obligated official download here: https://kb.netgear.com/000045291/R7800-Firmware-Version-1-0-2-32
Device probably requires signed updates, hence need for backdoor to bypass.
Can’t believe I have to Pull the wiki Definition of Source code on HACK-a-Day.
“Source code is the fundamental component of a computer program that is created by a programmer. It can be read and easily understood by a human being.”
> “GPL obligated official download here: https://kb.netgear.com/000045291/R7800-Firmware-Version-1-0-2-32”
That link is A compiled Firmware “not” Editable Source Code. ;)
Netgear’s GPL sources are available at https://kb.netgear.com/2649/NETGEAR-Open-Source-Code-for-Programmers-GPL
Hmmmm…. Seems like now the isolated boundary device can be pwned by a error somewhere in the camera side, that previously would require at least some knowledge and skill to find a endpoint that can access the camera (you are filtering inbound right?) then route back across the NAT traversal to get back to the attacker, and then you also have to allow remote access to your router and if you make one bad rule… What could possibly go wrong there…
Yes I have a openwrt router, yes I have ip cameras, no you cannot access the ip cameras directly anyway because there’s another device dedicated to running homeassistant that acts as the bridge, and the filtering is dealt with on the ingress router which can’t be logged into from outside the private lan.
The LUA presence trackers for openwrt using mac addresses are really neat though, homeassistant lets you see who’s on which access point at a glance and do scripted stuff on its basis.
No thank you.
I used to get excited about making embedded things out of routers. I used to grab every router I saw in a thrift shop or hamfest and look up it’s exact model to see if openwrt supported it. Now with Raspberry Pi and similar devices being available and cheap I don’t see the point of it anymore.
I have a tiny pi sized printserver with wifi, usb, and ethernet that is just sitting there till I need more pi’s than I have.
Better WiFi?
This is much better. https://github.com/ccrisan/motioneyeos/wiki
“Because the router itself is acting as the security camera, he is able to set up the camera to only arm itself when his smartphone (and thus, [Fred] himself) is not at home. This prevents the recording of footage of [Fred] moving around the house, allowing the router to only record important footage for security purposes.”
so, if you are home and an intruder comes, it wont be recording you blow their head off.
Are these cameras scattered inside his house? I didn’t see it in the write-up but maybe I missed it.
I suppose the phone sensing feature is nice but now if anything happens while you’re home, while your sleeping perhaps, (vandalism, stolen packages, home invasion(!)) you won’t have evidence of it.
*you’re , ugh
You could take it one step further and have it log the MAC address of all nearby phones when there is an intrusion. This may help find the intruder and bring them to justice.
Would that be called warwatching?
You could also sell this information to advertisers, and use it to display custom advertising on a screen outside your home! Yay!
Great article. I had to dig out a router for the 4K camera I picked up to work on to modify into an SLR. I’m still behind in reading into the newer routers and the router hacks/mods. The newer routers look impressive like they have the computing power of tablets or better now. Definitely on my list of investments… even though I’d prefer all fiber optics and minimal wireless… this looks too cool learn and apply.
This is good, but a better hack would be to turn the camera into a router…. :)
Interesting, but I would only apply this to a retired router already inside my network. Routing packets already taxes the processor on these little routers, ask it to do that PLUS very processor intensive video processing and I can see internet speeds drop through the floor.
As it stands now OpenWRT will already trash your maximum speed because it excludes the firmware blobs that enable hardware packet acceleration. On a bare install I was struggling to get 20 mbps on an Asus RT-AC66U. That’s what happens when you have to rely on the processor and all hardware acceleration is disabled. Now stack video on top of that…
UV4l and V4l2 don’t tax the CPU much, it configures a raw webcam stream and points it to a network. V high bandwidth, but only the client computer has to decode it. So it depends how he is doing his recording, or if he just wants to stream. This could be improved by using a webcam with built in H264 encode like a logitech c920 or MS lifecam
I would think that a “hack” would take it for granted that this type of warranty killing work would be carried out on a currently unused piece of hardware. Not that you would take a BNIB router that you want to use to secure your network
The beauty is that since it’s a personal hack it’s less likely one of the many people trying to hack others will realize the router is modded to have a camera and so won’t attempt to access that camera.
Security through obscurity.
Unless of course he tell the whole world about it and it would get published on HaD.. oh uhm, yeah.