§前言
对于各路资源大佬们来说,Emby 的大名肯定不陌生了,不了解这是啥的同学可以移步这篇文章看看效果:EMBY用刮削好的Google Drive资源,直接挂载即可使用(VIP版) - 科学小怪人的实验室 。
原理和过于细节的操作就不涉及了,如果看不懂,那么你可能需要补充一些 web 相关的基础知识。
本文只记录俺的配置过程,环境为:
- 客户端
- 操作系统:Manjaro KDE x64
- App 版本:Emby Theater 3.0.12
- 服务端(伪站所在的服务端,非 Emby Server)
- 操作系统:CentOS 7 x64
- Web 环境:Nginx 1.16.0
§开搞
思路其实很简单,建立一个域名为 mb3admin.com
的伪站,并配置伪静态,返回客户端验证所需的 json 数据,然后在客户端所在的机器对伪站的自签名证书添加信任即可。
§建立伪站
俺的 Nginx 伪静态配置:
location /admin/service/registration/validateDevice {
default_type application/json;
return 200 '{"cacheExpirationDays": 3650,"message": "Device Valid","resultCode": "GOOD"}';
}
location /admin/service/registration/validate {
default_type application/json;
return 200 '{"featId":"","registered":true,"expDate":"2099-01-01","key":""}';
}
location /admin/service/registration/getStatus {
default_type application/json;
return 200 '{"deviceStatus":"","planType":"Lifetime","subscriptions":{}}';
}
在伪站的配置文件中添加以下内容,防止跨域访问报错:
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Allow-Method *;
add_header Access-Control-Allow-Credentials true;
然后给伪站添加上自签名证书,需要的是这三个文件:
- 密钥:
mb3admin.com.key
- 证书:
mb3admin.com.pem
- 根证书文件:
mb3admin.com.crt
其中【根证书文件】其实就是【证书】文件的后半部分(参考后文【附录】部分的文件内容),【密钥】和【证书】这俩在签发的时候是成对生成的,自己打开【证书】文件复制出来后半部分保存一下就好了。
可以使用 OpenSSL 或者国密自己签,也可以到后文【附录】部分直接使用俺的,除了证书有效期以外都是一样的。
§客户端系统对伪站的根证书添加信任
俺的桌面系统使用 Manjaro,Arch Linux 以及其他的衍生发行版是一样的操作:
将 mb3admin.com.crt
文件移动至 /etc/ca-certificates/trust-source/anchors/
目录下,然后执行:
|
|
§客户端 HOSTS 修改 / 劫持 DNS
修改系统的 HOSTS,添加以下这行:
<伪站服务器 IP> mb3admin.com
或者高端的自建 DNS 之类的也可以,总之能实现【劫持客户端机器对 mb3admin.com
的请求至伪站服务器】就可以了。
§尾声
好了,以上就是俺破解 Emby 客户端的过程。虽然上了正版车,但因为一直懒得搭建服务端(正所谓“书非借不能读也”嘛哈哈哈),所以折腾了下白嫖,生命在于折腾。
至于本文没有提及的内容,比如:
- Windows / Android / IOS / MacOS / xxOS 客户端怎么破解
- 如何建立伪站
- 自签名证书怎么搞
- 如何修改 HOSTS / 劫持本机 DNS
- ……
原理都是差不多的,自己摸索一下就可以了,也可以参考文末【参考链接】中的教程,本文就是基于两位前辈的分享才完成的,在此感谢他们!
§附录
以下是俺生成好的证书文件,如果你不会 / 懒得自己生成,可以直接复制粘贴保存下来使用。
注意一下有效期是到 2023.02.23,届时俺应该会提前更新好。
密钥(mb3admin.com.key
):
点击展开
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAyE3Smwqo9E6CbAyN8zLOh44/6/YhBSafpDZbt9LfYl5fV2Qd
6m/pFPyXhJwcLuLB1BCEbCDYjEfq+HVcVV28nioUHyQJ6Uw2rViNNEeL3BHkgJJ4
cGzdSG9JPuuvIWc5b2P7NDhishzmhf23ZsuEHmW/3LXnlxtxFK0ZVW81gcxcgMGK
LwdYMo48+DAEmBaJ/SWeH7yEd2n/1i/75V366CkY3Mx7GDKXl7OL+kll8lssKSC/
OC/aZ/kV9ubUPD6gqjhP7qnm6J/UOVFbjNTvcd+ANZbqg1YMIU6bDruWQ9QGgd28
onlGj1JuCuXBDZIFCABkQnRE7J6Jmnj65bRVIwIDAQABAoIBAQCvxIKr5JXQFFik
QfwKTionj68N+2SMZZEvAzhGvbeiVVfqkwMhZuSsst6u0mJ0zizyTzA0xjngF3fc
YPgOPPw3+oq/rNs5qtRMFumJ18Kl8dmG7YDcfttLJcSrfxul/zPKSHz2HQiWbX/o
UnSusqYU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ngOuxhmV7WU0
xNasollGGuzjBmp46/bev8aomkI33OxSXWna3oCn3BSScgkoyWJTNN1+EwCZANO3
FeKUyPMGOhi49QlV4OyUgCfGlFqhAGZAT/PMo8oPwwmyHrlyn+jqin7+qKVF9loc
Nle9YyBi7eZkDbSoAUOg2WFaDDRrPhUnNU+l2TqCP+uCgyxU74Lphj00v00CAwEA
AaNdMFswHQYDVR0OBBYEFJon65yAk8sN6cM90Wp6HOKxnzjpMB8GA1UdIwQYMBaA
FJon65yAk8sN6cM90Wp6HOKxnzjpMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEG
MA0GCSqGSIb3DQEBCwUAA4IBAQBcoJlabv5wgUj6tgbb3gUVYHKlQWr2aaPWg1Vs
ru5ExyPcEhyQ2XM5AdnOMjKiTikyPYwk1/K1tJSNN5AmCfdofWr4m074s+Rf/i+h
dBuh2vjZee9L/NV2ZRcxpwp9e561+JBXoHvZ0JHDBGQ0WYsJ+m9fRxCR12oIVWWv
SAjbyetRRO+oTvi3dX2OQUgJhflS4/cxQblYxgL5nMIa+MVamXUNNfwEk3TZh4K/
NgtQY5KraEUU7bCkbbKdX2r+njobTQpbBV8uZ/JwsNghx4gfB+3QrteVfceQ+ip+
CpEU9X3JD9WkxEVFKBa0Q+TllSny07of0cWmRuwZlLUruBJD
-----END CERTIFICATE-----
客户端所在机器需在系统添加信任的根证书文件(mb3admin.com.crt
):
点击展开
-----BEGIN CERTIFICATE-----
MIIDsDCCApigAwIBAgIJAMjrH5w5KmnFMA0GCSqGSIb3DQEBCwUAMGgxCzAJBgNV
BAYTAkNOMRAwDgYDVQQIDAdCZWlqaW5nMRAwDgYDVQQHDAdIYWlEaWFuMRMwEQYD
VQQKDApHTUNlcnQub3JnMSAwHgYDVQQDDBdHTUNlcnQgUlNBIFJvb3QgQ0EgLSAw
MTAeFw0xOTEwMjQxMjM3NDRaFw0zOTA3MTExMjM3NDRaMGgxCzAJBgNVBAYTAkNO
MRAwDgYDVQQIDAdCZWlq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