wz_mini_hacks icon indicating copy to clipboard operation
wz_mini_hacks copied to clipboard

Block Wyze streaming at camera level

Open Vendo232 opened this issue 2 years ago • 16 comments

Create ability to block Wyze cam contacting Amazon Kinesis server "c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com" at camera level in order to reduce Internet/Lan traffic

c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com

Vendo232 avatar May 27 '22 19:05 Vendo232

you can enable iptables and block this host from the command line

gtxaspec avatar May 27 '22 19:05 gtxaspec

thankk you, would it be something like this?

iptables -I INPUT -s c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com -j DROP service iptables save

Vendo232 avatar May 27 '22 19:05 Vendo232

the url translates into 3 IPs c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com. 60 IN A 34.215.43.178 c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com. 60 IN A 52.42.92.175 c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com. 60 IN A 54.185.42.140

will try iptables -I INPUT -s 54.185.42.140 -j DROP ( on all 3 ) and see if the traffic stops

Vendo232 avatar May 27 '22 20:05 Vendo232

Does adding the following entry to /etc/hosts work?

127.0.0.1 c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com

endertable avatar May 28 '22 02:05 endertable

@endertable yes that should work too and is probably better than iptables no kernel modules required.

gtxaspec avatar May 28 '22 04:05 gtxaspec

Also, the IP addresses for AWS DNS entries typically rotate on a regular schedule, so the /etc/hosts entry will likely be more effective long-term and require less maintenance.

claudobahn avatar May 29 '22 21:05 claudobahn

Maybe what makes more sense is having an option to not start (or kill) the Wyze processes, though? Instead of trying to block their communication.

Some probably need to be started at some point to set up the channels, though. Not sure how all of that is initialized at startup.

claudobahn avatar May 31 '22 23:05 claudobahn

it's all integrated. if you don't start iCamera, you don't get video, and nothing works without it. so that means no rtsp

gtxaspec avatar May 31 '22 23:05 gtxaspec

Doesn't the KVS/AWS IoT core stuff get started by another script or is that just the certificates/config?

mrlt8 avatar May 31 '22 23:05 mrlt8

A bunch of stuff runs:

/system/bin/assis
/system/bin/sdkshellcalltool
/system/bin/hl_client
/system/bin/iCamera
system/bin/dongle_app (v2)
/system/bin/sinker
/system/bin/timesync
/system/bin/dumpload

and theres more, the edge ai stuff, the web rtc stuff too. They are launched by the app_init script, and if any are killed (except time and dumpload) , iCamera will segfault and the camera will reboot once the watchdog says so.

If you try to launch iCamera alone, it segfaults and the camera reboots...lol.

This applies to any Hualai Ingenic based cameras. It's just how they have designed their camera system.

The KVS/AWS stuff is inside iCamera, hl_client, webrtc, edgeai, its all intertwined from what I can tell.

gtxaspec avatar Jun 01 '22 00:06 gtxaspec

What about /tmp/webrtc/launch.sh?

mrlt8 avatar Jun 01 '22 01:06 mrlt8

that script is currently broken because it calls /bin/bash when bash is not present on the production builds pushed to the cameras

gtxaspec avatar Jun 01 '22 01:06 gtxaspec

sorry, I didn't read that correctly, the web rtc client is run by launch.sh, the aws stuff is hl_client, iCamera, sinker I believe

gtxaspec avatar Jun 01 '22 02:06 gtxaspec

Does adding the following entry to /etc/hosts work?

127.0.0.1 c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com

I`m getting read only error

image

Vendo232 avatar Jun 04 '22 00:06 Vendo232

save that file elsewhere, example to /opt/hosts then mount --bind /opt/hosts /etc/hosts

gtxaspec avatar Jun 04 '22 01:06 gtxaspec

save that file elsewhere, example to /opt/hosts then mount --bind /opt/hosts /etc/hosts

First of all, "Thank You!". I just saw this post and tried it on one of my cameras. It appears to have solved ALL of the tearing issues I was having with the 1080P stream. I am not that familiar with Linux and was hoping you could answer a quick question for me. When I run the command: mount --bind /opt/hosts /etc/hosts it works until the camera is restarted, the mount operation apparently is reset after a reboot. What would be the best way to perform this command at power up? I assume a custom script, but could someone tell me what this script would look like and where to put it?

Thanks in advance!

tbrausch avatar Oct 25 '22 21:10 tbrausch

self-hosted mode was added.

gtxaspec avatar Sep 26 '23 00:09 gtxaspec