[ EDIT: I changed the format of the blocklist, so LAN devices can cache the negative lookups, and not hammer the router with repeated lookups. This doubles the size of the blocklist (because we have to list 0.0.0.0 and ::), but it allows device caching. ]
[ EDIT: I discovered that the TV was using hard-coded IPv6 addresses to get around the blocklist. I DROP’d all IPv6 packets from the TV (based upon the MAC address), forcing it to use IPv4. It freaked out, claimed the Home Screen couldn’t load due to a network problem, dropped back to IPv4 and plain http, queried European servers, invoked the Amazon Network Diagnostic domain, hammered the router with IPv6 packets, attempted to use the router to ‘echo’ IPv6 packets to the greater internet… then gave up and started behaving. ]
I have an Amazon HiSense 50QD65QFC FireTV, and I wanted to see how much data it was phoning home. It was a lot. So I blocked it.
I already have /etc/config/dhcp set up like this:
config dnsmasq
option confdir '/etc/dnsmasq.d'
… because I’ve set up the Canary Domains (usually handled by https-dns-proxy, but it messes up the order of the servers) in /etc/dnsmasq.d/canary_domains.conf:
server=/mask.icloud.com/
server=/mask-h2.icloud.com/
server=/icloud.com/
server=/use-application-dns.net/
So, I created a file:
/etc/dnsmasq.d/HiSenseTV
I accessed the TV’s Network Settings and wrote down the MAC address.
Then I did a packet capture (in Terminal, connected to the router via ssh) to find what domains the TV was connecting to:
tcpdump -i br-lan -W 400 -C 512 -w /mnt/sda2/capture.pcap "ether host 44:0f:b4:44:b3:62 and not port 53 and not port 853 and not igmp and not icmp and not icmp6 and not arp"
I can read the packet capture file from my Linux computer as tcpdump is building it via:
tail -f -c +1 /run/user/1000/gvfs/smb-share:server=192.168.1.1,share=scratch/capture.pcap000 | tcpdump -r -
… then I loaded that data into Wireshark with a filter of tls.handshake.extensions_server_name to only show the domains the TV was connecting to.
I copied all the domains from Wireshark into a text editor, stripped out the extraneous stuff, researched each FQDN to find out what it did, then populated the /etc/dnsmasq.d/HiSenseTV file thusly:
# Blocking for HiSense FireTV
# Block Amazon telemetry
address=/aca-livecards-service.amazon.com/0.0.0.0
address=/aca-livecards-service.amazon.com/::
address=/acr-client.amazon.com/0.0.0.0
address=/acr-client.amazon.com/::
address=/ads.na.prod.channels.firetv.amazon.dev/0.0.0.0
address=/ads.na.prod.channels.firetv.amazon.dev/::
address=/amazon-adsystem.com/0.0.0.0
address=/amazon-adsystem.com/::
address=/arcus-uswest.amazon.com/0.0.0.0
address=/arcus-uswest.amazon.com/::
address=/dcape-na.amazon.com/0.0.0.0
address=/dcape-na.amazon.com/::
address=/device-metrics-us.amazon.com/0.0.0.0
address=/device-metrics-us.amazon.com/::
address=/device-metrics-us-2.amazon.com/0.0.0.0
address=/device-metrics-us-2.amazon.com/::
address=/dp-discovery-na-ext.amazon.com/0.0.0.0
address=/dp-discovery-na-ext.amazon.com/::
address=/dss-na.amazon.com/0.0.0.0
address=/dss-na.amazon.com/::
address=/firereleasenotes-na.amazon.com/0.0.0.0
address=/firereleasenotes-na.amazon.com/::
address=/fls-na.amazon.com/0.0.0.0
address=/fls-na.amazon.com/::
address=/ftvpes-na.amazon.com/0.0.0.0
address=/ftvpes-na.amazon.com/::
address=/kinesis.us-east-1.amazonaws.com/0.0.0.0
address=/kinesis.us-east-1.amazonaws.com/::
address=/kraken-measurements.s3-external-1.amazonaws.com/0.0.0.0
address=/kraken-measurements.s3-external-1.amazonaws.com/::
address=/monitoring.us-east-1.amazonaws.com/0.0.0.0
address=/monitoring.us-east-1.amazonaws.com/::
address=/msh.amazon.com/0.0.0.0
address=/msh.amazon.com/::
address=/na.prism.digital.amazon.dev/0.0.0.0
address=/na.prism.digital.amazon.dev/::
address=/pact-proxy.amazon.com/0.0.0.0
address=/pact-proxy.amazon.com/::
address=/paifas.amazon.com/0.0.0.0
address=/paifas.amazon.com/::
address=/podiumedgeservice.amazon.com/0.0.0.0
address=/podiumedgeservice.amazon.com/::
address=/prod.us-east-1.sonar.prime-video.amazon.dev/0.0.0.0
address=/prod.us-east-1.sonar.prime-video.amazon.dev/::
address=/secure-dcr.amazon.com/0.0.0.0
address=/secure-dcr.amazon.com/::
address=/todo-ta-g7g.amazon.com/0.0.0.0
address=/todo-ta-g7g.amazon.com/::
address=/unagi-na.amazon.com/0.0.0.0
address=/unagi-na.amazon.com/::
address=/us-east-1.prod.enira.devices.amazon.dev/0.0.0.0
address=/us-east-1.prod.enira.devices.amazon.dev/::
address=/web.diagnostic.networking.aws.dev/0.0.0.0
address=/web.diagnostic.networking.aws.dev/::
address=/wl.amazon-dss.com/0.0.0.0
address=/wl.amazon-dss.com/::
# Block a2z.com telemetry
address=/global.telemetry.insights.video.a2z.com/0.0.0.0
address=/global.telemetry.insights.video.a2z.com/::
address=/notify.aca.ftv.bugsnag.appstore.a2z.com/0.0.0.0
address=/notify.aca.ftv.bugsnag.appstore.a2z.com/::
address=/prod.service.minerva.devices.a2z.com/0.0.0.0
address=/prod.service.minerva.devices.a2z.com/::
address=/sessions.bugsnag.com/0.0.0.0
address=/sessions.bugsnag.com/::
# Block Alexa
address=/alexa.amazon.com/0.0.0.0
address=/alexa.amazon.com/::
address=/avs-alexa-19-na.amazon.com/0.0.0.0
address=/avs-alexa-19-na.amazon.com/::
address=/prod.cdn.ams.alexa-personality.amazon.dev/0.0.0.0
address=/prod.cdn.ams.alexa-personality.amazon.dev/::
# Block BrightLineTV
address=/brightline.tv/0.0.0.0
address=/brightline.tv/::
# Block Conviva
address=/conviva.com/0.0.0.0
address=/conviva.com/::
# Block Crashlytics
address=/crashlytics.com/0.0.0.0
address=/crashlytics.com/::
# Block DataDog
address=/browser-intake-datadoghq.com/0.0.0.0
address=/browser-intake-datadoghq.com/::
# Block DoubleClick
address=/doubleclick.net/0.0.0.0
address=/doubleclick.net/::
# Block Dynatrace
address=/dynatrace.com/0.0.0.0
address=/dynatrace.com/::
# Block Google
address=/firebaselogging-pa.googleapis.com/0.0.0.0
address=/firebaselogging-pa.googleapis.com/::
# Block HiSense VIDAA OS telemetry
address=/auth-vss.vidaahub.com/0.0.0.0
address=/auth-vss.vidaahub.com/::
address=/partner-detail-ui.vidaahub.com/0.0.0.0
address=/partner-detail-ui.vidaahub.com/::
address=/partner-home-ui.vidaahub.com/0.0.0.0
address=/partner-home-ui.vidaahub.com/::
address=/partner-layout-ui.vidaahub.com/0.0.0.0
address=/partner-layout-ui.vidaahub.com/::
address=/partner.vidaahub.com/0.0.0.0
address=/partner.vidaahub.com/::
address=/policy-jrnl.vidaahub.com/0.0.0.0
address=/policy-jrnl.vidaahub.com/::
address=/rsc-mntz.vidaahub.com/0.0.0.0
address=/rsc-mntz.vidaahub.com/::
address=/static-ui.vidaahub.com/0.0.0.0
address=/static-ui.vidaahub.com/::
address=/ter-jrnl.vidaahub.com/0.0.0.0
address=/ter-jrnl.vidaahub.com/::
address=/tracking-vss.vidaahub.com/0.0.0.0
address=/tracking-vss.vidaahub.com/::
# Block Ketch
address=/global.ketchcdn.com/0.0.0.0
address=/global.ketchcdn.com/::
# Block Kochava
address=/dewrain.life/0.0.0.0
address=/dewrain.life/::
address=/kochava.com/0.0.0.0
address=/kochava.com/::
address=/kvaedit.site/0.0.0.0
address=/kvaedit.site/::
# Block LaunchDarkly
address=/mobile.launchdarkly.com/0.0.0.0
address=/mobile.launchdarkly.com/::
address=/clientsdk.launchdarkly.com/0.0.0.0
address=/clientsdk.launchdarkly.com/::
# Block MoEngage
address=/moengage.com/0.0.0.0
address=/moengage.com/::
# Block Nielsen Digital Content Ratings
address=/nielsen.com/0.0.0.0
address=/nielsen.com/::
address=/vtwenty.com/0.0.0.0
address=/vtwenty.com/::
# Block Omniture / Adobe
# adobedtm.com tells tracking scripts what to track
address=/2o7.net/0.0.0.0
address=/2o7.net/::
address=/adobe.io/0.0.0.0
address=/adobe.io/::
address=/adobedtm.com/0.0.0.0
address=/adobedtm.com/::
address=/adobedc.net/0.0.0.0
address=/adobedc.net/::
address=/adobestats.io/0.0.0.0
address=/adobestats.io/::
address=/demdex.net/0.0.0.0
address=/demdex.net/::
address=/hstatic.io/0.0.0.0
address=/hstatic.io/::
address=/omtrdc.net/0.0.0.0
address=/omtrdc.net/::
# Block RedFast
address=/conduit.redfast.com/0.0.0.0
address=/conduit.redfast.com/::
# Block Samba Telemetry
address=/adserver.org/0.0.0.0
address=/adserver.org/::
address=/api.samba.tv/0.0.0.0
address=/api.samba.tv/::
address=/beacon.samba.tv/0.0.0.0
address=/beacon.samba.tv/::
address=/samba.tv/0.0.0.0
address=/samba.tv/::
address=/tvview.io/0.0.0.0
address=/tvview.io/::
# Block Scorecard Research
address=/scorecardresearch.com/0.0.0.0
address=/scorecardresearch.com/::
# Block SlingTV
address=/p-cg64-slinganalytics.movetv.com/0.0.0.0
address=/p-cg64-slinganalytics.movetv.com/::
# Block Xite:
address=/g.xite.com/0.0.0.0
address=/g.xite.com/::
# DO NOT BLOCK:
# {14 characters}.cloudfront.net - serves the TV Guide graphics under the big banner on the Home screen
# api.amazon.com - Core API functionality
# *.api.amazonvideo.com - Core API functionality
# aptime.movetv.com - time sync for authentication, token generation, live grid guide schedule sync
# cdws.us-east-1.amazonaws.com - Amazon Photos Cloud Drive
# cognito-identity.us-east-1.amazonaws.com - AWS secure system access
# cognito-identity.us-west-2.amazonaws.com - AWS secure system access
# dcm-allowlist-filter-prod.s3.amazonaws.com - Executable files security list
# dp-gw-na.amazon.com - Device Protocol Gateway, North America
# dp-discovery-na-ext.amazon.com – Local connection protocol routing for phone remote apps
# drive.amazonaws.com - Amazon Photos Cloud Drive
# dynaman-or-4.slg.dishtech.org - DishTV back-end session and manifest management system
# firebaseinstallations.googleapis.com - Core developer platform
# firetvcaptiveportal.com - internet connectivity check
# ftv-smtv.ntp-fireos.com - NTP updater
# ftvr-na.amazon.com – System registration and software updater verification
# geo-bas-na.vidaahub.com - VIDAA geolocation firmware updates and app availability
# images-na.ssl-images-amazon.com - core graphics
# imasdk.googleapis.com - Google IMA Ad Player SDK—blocking this freezes stream players when an ad is cued
# img.vidaahub.com - interface thumbnails
# ktpx.amazon.com - Home screen user interface
# linear-ad-segments.frequency.stream - Free Ad Supported Television (FAST) streaming
# m.media-amazon.com - thumbnails and app store icons
# mas-ext.amazon.com - Mobile Appstore Services
# mas-sdk.amazon.com - Mobile Appstore Services
# mediaservices.cdn-apple.com – Handles Apple AirPlay mirroring and the Apple TV app layer if installed.
# p-cdn8-807-cg14-linear-cbd46b77.movetv.com - SlingTV streaming
# p-cmwnext-fast.movetv.com - "Fast Channel" programming frameworks and real-time push events
# p-cmwpush-fast.movetv.com - "Fast Channel" programming frameworks and real-time push events
# p-drmwv.movetv.com - SlingTV Widevine DRM (Digital Rights Management) licensing handshakes
# p-dynaman.movetv.com - SlingTV back-end session and manifest management system
# p-geo.movetv.com - geolocation for regional blackout restrictions, will lock you out completely if blocked
# p-img.movetv.com - SlingTV images and logos
# preprod.amazoncrl.com - verifies security certificates
# saa.pluto.tv - Pluto Service Authentication and Authorization
# spectrum.s3.amazonaws.com - Captive Portal detection
# splice.paramountplus.com - Paramount dynamic streaming
# {29 characters}.ta.pop-vod-dash.main.amazon.pv-cdn.net - Point of Presence - Video on Demand - Dynamic Adaptive Streaming over HTTP (DASH) Prime Video Content Delivery Network
Apparently, if you block enough of the Amazon FireOS telemetry, the underlying OS (VIDAA from HiSense) comes out to play… note the vidaahub.com entries that are coming up in the packet capture.
Then I restarted dnsmasq:
/etc/init.d/dnsmasq restart
NOTE: In this case, you can’t just reload dnsmasq:
/etc/init.d/dnsmasq reload
… that reloads configuration files and hosts files, but not files under the confdir. You have to restart it.
Now the huge ads on the Home Screen are gone, that area just flips between teasers for available videos. The interface is much simpler. The traffic rate is much lower… I captured ~300 MB worth of data with the stock configuration; with the blocklist enabled, and for the same length of time, I captured ~42 MB, and most of that was actual video as I tested the various video sources.
NOTE:
You can block:
# ktpx.amazon.com - Home screen user interface
… but it’ll claim there is a network connectivity issue, and the Home screen won’t show up. You can still access all the various video sources, though.
Of course, as soon as I got it all finished, the TV had an “update” to install, despite the fact that I’d just checked for updates when starting this procedure, and there were none… so I’m doing another packet capture, and I’ll block any domains phoning home.
The TV was still connecting out, even after the blocklist above was implemented. I found it was using hard-coded IPv6 server addresses, and hard-coded IPv4 and IPv6 DNS IP addresses. It specifically injects 8.8.8.8 as a DNS server, even if you set it up to use your own DNS servers.
No problem. We can handle that. Just go into the Network Settings on the TV, get its MAC address, then add the following rules to /etc/config/firewall, using the MAC address of your TV.
config rule
option src 'lan'
option dest '*'
option name 'TV_IPv6_DROP - prevents IPv6 telemetry'
option family 'ipv6'
list src_mac '44:0F:B4:44:B3:62'
option target 'DROP'
option enabled '1'
list proto 'all'
config rule
option src 'lan'
option dest '*'
list src_mac '44:0F:B4:44:B3:62'
list dest_ip '8.8.8.8'
list dest_ip '8.8.4.4'
list dest_ip '2001:4860:4860::8888'
list dest_ip '2001:4860:4860::8844'
option target 'DROP'
option name 'TV_DNS_DROP'
option enabled '1'
list proto 'all'
That blocks the telemetry the TV was sending out via IPv6 (the TV will get an IPv6 address no matter what, because we’re using SLAAC, so we can only block all IPv6 traffic), and blocks the TV from resolving domains via 8.8.8.8, getting around the blocklist above.
In the /etc/dnsmasq.d/canary_domains.conf file, I also added:
server=/resolver.fn.cloudfront.net/
The TV is going to complain at first… it’ll claim there is a networking error; it won’t load the Home Screen; no images will load; if you’re doing a packet capture on the TV, it’ll hammer the router with IPv6 connection attempts and DNS queries to 8.8.8.8… but it’ll eventually figure out that it’s locked down, and everything will settle down, load in, and work properly.