nbc

package
v1.8.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: OSL-3.0 Imports: 11 Imported by: 0

README

NBC

how to get drmProxySecret value?

if you visit a page such as this:

https://nbc.com/saturday-night-live/video/january-20-jacob-elordi/9000283424

you should see a request like this:

https://www.nbc.com/generetic/generated/generetic.971bc5df5bddfb45624e.js

in the response body, you should see something like this:

{
  "coreVideo": {
    "drmProxyUrl": "https://drmproxy.digitalsvc.apps.nbcuni.com/drm-proxy/license",
    "drmProxySecret": "Whn8QFuLFM7Heiz6fYCYga7cYPM8ARe6"
  }
}

how to get hash value?

POST https://drmproxy.digitalsvc.apps.nbcuni.com/drm-proxy/license/widevine?time=1699126072315&hash=0df6ff2b81e42c3ec10d1c4946cebce7ddd631a4130841fd74ba5fa0c3d7c02a&device=web HTTP/2.0
content-type: application/octet-stream

in the code we have this:

return ""
   .concat(const174_.drmProxyUrl, "/")
   .concat(const181_, "?time=")
   .concat(const182_, "&hash=")
   .concat(const184_, "&device=web")
   .concat(param178_2 ? "&keyId=".concat(param178_2) : "");

simplify:

var91_ = param74_3(1358),
var92_ = param74_3.n(var91_),
let let179_ = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
const182_ = new Date().getTime() + let179_,
const const181_ = param178_.toLowerCase(),
const183_ = const182_ + const181_,
const184_ = var92_()(const183_, const174_.drmProxySecret);
"&hash=" + const184_

we should print these:

console.log('DRM', var92_().toString());
console.log('DRM', const183_);
console.log('DRM', const174_.drmProxySecret);

script:

from mitmproxy import ctx, http

def response(f: http.HTTPFlow) -> None:
   if f.request.path.startswith('/generetic/generated/chunks/12.ff734ba67f44a707e609.js'):
      f.response.text = open('hello.js', 'r').read()

Android

only requires Android 5:

> play -a com.nbcuni.nbc
requires: 5.0 and up
version code: 2000004392
version name: 9.4.1

which means we can install up to Android 6 and install user certificate. If we do that and start the app, we get:

Unable to Connect

Please check your internet connection and try again.

If we FORCE STOP the app, set No proxy and try again, it works. next we can try system certificate. same result. this result also repeats with older versions back to:

package: name='com.nbcuni.nbc' versionCode='2000003396' versionName='9.0.0'
compileSdkVersion='31' compileSdkVersionCodename='12'

with older versions:

package: name='com.nbcuni.nbc' versionCode='2000003368' versionName='7.35.1'
compileSdkVersion='31' compileSdkVersionCodename='12'

we get:

ACTION REQUIRED

To keep watching your favorite shows, movies and more, you'll need to update to the latest version of the NBC App.

next we can try:

pip install frida-tools

download and extract server:

https://github.com/frida/frida/releases

for example:

frida-server-16.1.7-android-x86.xz

https://github.com/httptoolkit/frida-interception-and-unpinning

install app, then push server:

adb root
adb push frida-server-16.1.7-android-x86 /data/app/frida-server
adb shell chmod +x /data/app/frida-server
adb shell /data/app/frida-server

then:

frida -U `
-l config.js `
-l native-connect-hook.js `
-l android/android-system-certificate-injection.js `
-l android/android-certificate-unpinning.js `
-l android/android-certificate-unpinning-fallback.js `
-f com.nbcuni.nbc

with MITM Proxy, app just gets stuck on loading screen. also, instead of my own script I tried this instead:

https://github.com/httptoolkit/httptoolkit-server/blob/8577f6a/src/interceptors/android/adb-commands.ts#L271-L294

my device does not have /apex, which seems to simplify the process. but even still, MITM Proxy fails. I guess at this point its a MITM Proxy issue. I did notice that I was using an older MITM Proxy version 9, but trying version 10 and even 8 didn't resolve the problem either. note I also tried using HTTP Toolkit certificate with MITM Proxy with no luck. here is something. I had idea to try older Frida, so I tried again with Frida 15.2.2. still failed, but a different error:

javax.net.ssl.SSLHandshakeException:
java.security.cert.CertPathValidatorException: Trust anchor for certification
path not found.
at
com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:328)

using HTTP Toolkit instead of MITM Proxy works.

https://github.com/httptoolkit/frida-interception-and-unpinning/issues/56

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	AirDate          string
	EpisodeNumber    int   `json:",string"`
	MpxAccountId     int64 `json:",string"`
	MpxGuid          int64 `json:",string"`
	ProgrammingType  string
	SeasonNumber     int `json:",string"`
	SecondaryTitle   string
	SeriesShortTitle string
}

func (Metadata) Episode

func (m Metadata) Episode() int

func (*Metadata) New added in v1.7.7

func (m *Metadata) New(guid int) error

func (Metadata) OnDemand added in v1.7.7

func (m Metadata) OnDemand() (*OnDemand, error)

func (Metadata) Season

func (m Metadata) Season() int

func (Metadata) Show added in v1.7.5

func (m Metadata) Show() string

func (Metadata) Title

func (m Metadata) Title() string

func (Metadata) Year added in v1.7.5

func (m Metadata) Year() int

type OnDemand added in v1.7.7

type OnDemand struct {
	PlaybackUrl string
}

type Video

type Video struct {
	DrmProxyUrl    string
	DrmProxySecret string
}

func Core added in v1.7.1

func Core() Video

func (Video) RequestBody added in v1.7.7

func (Video) RequestBody(b []byte) ([]byte, error)

func (Video) RequestHeader added in v1.7.7

func (Video) RequestHeader() (http.Header, error)

func (Video) RequestUrl added in v1.7.7

func (v Video) RequestUrl() (string, bool)

func (Video) ResponseBody added in v1.7.7

func (Video) ResponseBody(b []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL