Transcoding
|
Posts: 16
Threads: 1
Joined: Nov 2015
Reputation:
5
[Solved]
Nov 03, 2015, 07:39 AM
Hi Mike,
Yup, thanks, found it.
My plan is to:
1) Block the Google DNS servers (8.8.8.8, 8.8.4.4) in my router so that the Chromecast uses the router as DNS server.
2) Use dnsmasq on my router to redirect all requests to chromecast.plex.tv to my Raspberry Pi.
3) Install lighttpd on my Raspberry Pi and host a copy of the required files on it.
I have not tried this, but I will let you know the outcome.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 03, 2015, 06:17 PM
(This post was last modified: Nov 03, 2015, 06:19 PM by tragidy.)
Yes indeed as I said in post, using BIND or your own DNS server is the solution handle requests to a private server, in my case a generic apache 2 running on my router along with bind, the entire house is fed dns from this location.
After looking at situation for small guide as requested.
Install apache or any http server
install bind/nsd/other or mess with tables
iptables gDNS if using chromecast or google related venues ** optional
add a dns zone for plex.tv
add a records
HIUP / reload / restart bind
set all plex devices to use internal dns server, ex; 192.168.34.2 or have your router force set dns
install self signed ssl
upload plex.js to mimic structure on new plex.tv which is ran on your own apache
Be certain you add re-writes in apache or your bind server to only catch the plex.js and transparently goto plex.tv for content, this can be done many ways net interception, packet re-writing or simple but long rules of dns to ip based servo for the rest of the content.
There is also another solution to iptables and netfilter everything but its quite long and does not work as effective as complete dns re-writing.
I'm certain there may be a faster, easier solution but this works.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 03, 2015, 09:31 PM
(This post was last modified: Nov 03, 2015, 10:21 PM by Mike.)
Looks like this should work, I do not have a Chromecast to test but I am able to get a modified plex.js using this method using dnsmasq as a local DNS server which reads its /etc/hosts file and passes any other DNS requests it can't handle upstream to Google's DNS. You will need to stop bind9 if you are using it to test this.
There is no https involved here because, as far as I can tell, plex does not use https for transferring the scripts. If you do find you need the https, I have a guide on creating ssl certificates and applying the configuration to an nginx server here. https now included.
Create the folder to mimic the chromecast.plex.tv structure, modify the plex.js as necessary and change the ownership of the folder
Code:
mkdir -p /var/www/chromecast/production/js
cd /var/www/chromecast/production/js
wget http://chromecast.plex.tv/production/js/plex.js
sudo chown -R www-data:www-data /var/www
Modify the hosts file on the Plex server and add chromecast.plex.tv so it points to the plex server
Code:
sudo nano /etc/hosts
Paste this line, IP should be your Plex server
Code:
192.168.60.135 app.plex.tv chromecast.plex.tv
Modify resolv.conf to use the Google DNS servers, this way any request will be forwarded to Google (you can set your router to use the Plex server as a DNS server)
Code:
sudo nano /etc/resolv.conf
Add Google DNS, btw you can make resolv.conf permanent with a small section from this guide
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save resolv.conf and make it immutable (i.e. unchangeable)
Code:
sudo chattr +i /etc/resolv.conf
Install dnsmasq and nginx
Code:
sudo apt-get install dnsmasq nginx openssl -y
Create the ssl folder and generate an SSL certificate
Code:
sudo mkdir -p /etc/nginx/ssl
sudo openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
Create a virtual host for the chromecast subdomain
Code:
sudo nano /etc/nginx/sites-enabled/chromecast
Paste this configuration
Code:
server {
server_name chromecast.plex.tv;
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
access_log /var/log/nginx/chromecast.plex.tv.access.log;
error_log /var/log/nginx/chromecast.plex.tv.error.log;
root /var/www/chromecast;
autoindex on;
}
Save it and restart nginx
Code:
sudo service nginx restart
Now have your Chromecast DNS point to the Plex server, or alternatively have your router's DHCP server give the DNS server as the Plex server.
See this for modifying the bitrate as well
Let me know if this works and I'll put it on the main site in a day or two (this guide is not allowed to be published elsewhere without proper attribution).
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 03, 2015, 10:04 PM
(This post was last modified: Nov 04, 2015, 03:52 AM by tragidy.
Edit Reason: Trolling
)
lol @ legaling the guide, you best give me attribution. +TROLLFACE
Just playing around mate good work on the write up
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 03, 2015, 10:08 PM
(This post was last modified: Nov 03, 2015, 10:25 PM by Mike.)
(Nov 03, 2015, 10:04 PM)tragidy Wrote: lol @ legaling the guide, you best give me attribution.
Of course you will get full credit I just need to make sure nobody copies and pastes the full step-by-step instructions on other sites and claim it as their own (I have had several guides copy and pasted without even a link back). If you are interested in making step-by-step instructions for other guides I am hiring writers.
The funny thing is we used dnsmasq for testing man in the middle attacks in school not that long ago and my brain didn't connect the dots, after you mentioned your method it all came together. Thank you for helping resolve this and checking back on this old thread.
Posts: 16
Threads: 1
Joined: Nov 2015
Reputation:
5
[Solved]
Nov 04, 2015, 12:30 AM
(This post was last modified: Nov 04, 2015, 01:00 AM by lukas.)
Hi Mike & tragidy,
Thanks, I was working on something similar with lighttpd yesterday.
Is the Chromecast accessing the plex.tv via the local plex server? Would it not access plex.tv directly?
I currently configured my router so that all requests to chromecast.plex.tv are redirected to my lighttpd server on my Raspberry Pi.
However, when I start the Chromecast app, it says "Brain frezze. We're sorry, an error occurred while loading". I guess that I am getting this error because my SSL certificate is self-signed. I am not sure yet how to solve this issue.
Once I have figured it out, I can post my instructions here.
Edit: This might be a workaround - creating your own Chromecast application: https://www.andrewmunsell.com/blog/how-t...hromecast/
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 04, 2015, 03:56 AM
(This post was last modified: Nov 04, 2015, 06:49 AM by Mike.)
I can confirm Chromecast is capable of that message mine is now doing this.
Since Chromecast app is server side I wouldn't be surprised if something is changed, you should root your Chromecast if possible as you can add exception if you think ssl is issue,
I will get equipment to root mine soon and report results
We need a proper dump of the files on the plex server that are not server side but in rendered state can someone do this then package as server files. Zip this is ironic after progress is made they patched against us.
I will work with you all to the best of my ability if we can create a proper collection of tools and files we can or I can write a auto installer SH script to help users make change effective.
Ultimately we need plex developers to accept arm as a processor of various capability they could simply implement a check box preference that is issued as a variable of transcode on or off. This would be simple to implement and the fact they have not is astonishing.
Basically mike got it right a simple man in the middle attack is best used here but ssl can pose an issue perhaps or maybe it's an app change on the server side
Posts: 16
Threads: 1
Joined: Nov 2015
Reputation:
5
[Solved]
Nov 04, 2015, 05:13 AM
(This post was last modified: Nov 04, 2015, 05:19 AM by lukas.)
I managed to set up my own Chromecast app that is pointing to a copy of the Plex receiver website.
After changing the Chromecast app ID in the plex.js on my PMS, I can use Chrome to cast videos to my Chromecast and I don't get any error messages anymore!
I might have also found a way to modify the Chromecast App ID in the Plex app, but I will be only able to test it when I am home tonight. I will share my results once I have tested it.
The advantage of this method would be that no re-routing etc. would be required.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 04, 2015, 03:23 PM
Lukas
That's a better idea right there, an even better one is writing the webserver into the app making the app a one stop solution where nobody will need a rogue webserver.
It's ambitious
I think you will run into routing and authorization token errors though if plex does a random key change.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 04, 2015, 11:51 PM
Well well, the rabbit hole goes deeper. Never have I seen a piece of software put so much effort into preventing users from using it. Well done for all of your efforts on defeating this issue - it is exactly what I hoped would happen in the forum
I think a combination of these methods may be a good shout. In the Plex chromecast package you should be able to change the plex.js target to be a modified plex.js in the /var/lib/plexmediaserver (or it may be /usr/lib) but it would require some better understanding of how the plex media server is built up to do redirects. It may at this point be easiest to edit the index.html of the chromecast plex app to point to the custom web server (then https should not matter).
Of course this could be an issue if the authorization token issues tragidy mentions fuck things up.
The downside of building the plex chromecast app is you will have to rebuild it for new major changes in the app, I'm not sure how time consuming this was for you lukas. The upside is it will work without plex being able to override things as they clearly love to do.
I would love to see a tcpdump or wireshark of the Chromecast plex app making a normal request vs the modified request.
Ordered a Chromecast the other day to join you all on this journey.
tragidy, I remember seeing the rooting process a while ago, it was sort of straight forward if you had a specific piece of hardware, looking forward to your rooting results.
|
|
Recent Posts
|
Split Tunnel Docker Containers
jonesPhedra Mar 27, 2024, 03:10 AM
|
Plex server not powerful enough, but only with s...
jonesPhedra Mar 27, 2024, 03:02 AM
|
About Swap
jonescelinaa Mar 18, 2024, 02:11 AM
|
game Geometry Dash Scratch
jonescelinaa Jan 31, 2024, 04:21 AM
|
Find My IP Address - Kodi - Updated
jonesPhedra Jan 29, 2024, 02:56 AM
|
Latest unread posts | Unanswered posts |
|