• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 13
NBC Peacock Addon Request
#61
@matthuisman 

I've done a lot more digging on this.

Within the apk for android there's main.bundle.js that is a webpack file, so I unpacked it. For it's signature hashing it's actually included js-sha256 from https://github.com/emn178/js-sha256

Within that source I noted 2 functions of interest.

javascript:

    method.create = function (key) {
      return new HmacSha256(key, is224);
    };
    method.update = function (key, message) {
      return method.create(key).update(message);
    };

So I loaded it up into chrome on my computer and performed an client side injection with a modified version to output the keys to the console when called however those functions were never called in chrome.

Further investigation the site itself using a similar method of packing (which I couldn't unpack) in https://www.peacocktv.com/webwatch/relea...30/main.js and within this file it uses HMAC.init(e,n)

Investigation on this function leads me here https://stackoverflow.com/questions/2000...-of-string which shows the call to the function is initializing the key which could then be trapped.

I believe you could make a modified main.js which echos the key to the console and inject it into the browser to use your copy instead.

If trapped and the Android app is using an open source hashing mechanism then that same mechanism can be used with the key, at least during a testing phase.

Other modification could reveal exact information being hashed. Tracing callbacks could reveal if the key is generated client side (which I think it is because as yet I haven't trapped any requests providing it) or pulled from a server.

I think you're the only one who can make use of this information which is why I directed it to you specifically.

** EDIT:

You can see a somewhat more readable version of main.js if you run it through https://lelinhtinh.github.io/de4js/

A more readable version of the function containing HMAC.init I posted up here https://paste.kodi.tv/dowavejuxe
Reply
#62
The signature isn't the problem unfortunately. It's VMP
Reply
#63
Alright, I'll leave this alone then.
Reply
#64
Oh. Feel free to keep exploring!! It's pretty fun trying to reverse engineer the apps
Reply
#65
@matthuisman @"nymdbwdp" FYI https://github.com/Avalonswanderer and https://people.irisa.fr/Gwendal.Patat/publications/
Maintainer of Kodi from Debian | Got an issue with Kodi from Debian? Report it here: Kodi from Debian - Support Thread
Reply
#66
(2023-01-05, 07:38)basilgello Wrote: FYI https://github.com/Avalonswanderer and https://people.irisa.fr/Gwendal.Patat/publications/

Interesting, Thanks
Reply
#67
(2023-01-04, 21:30)User 476552 Wrote: I believe you could make a modified main.js which echos the key to the console and inject it into the browser to use your copy instead.
Hi. Using local overrides (see pic. 2), I was able to figure out that the х_skу_sig//ture is given the body of the license request as an array of words (see pic. 1, there is two unique word arrays: first consisting of two bytes is 0x08, 0x04 for cert request, second is the challenge itself). These wordarrays are then hashed with MD5 and passed as parameters for the subsequent signature generation (base64 encoded).
However, I could not get the _createHmacHelper function to be called and hence new f.HMAC.init(e, n).finalize(t) was not called.
The same behaviour occurs for version 4.1.12 and 3.11.30.
I also tried to find the code segment responsible for generating the header with the signature (I searched js files for (",") hoping to find concat or join but found nothing useful). However, timestamp search was more successful, found some functions related to request headers, but again nothing related to signature calculation.
In short, either the hmac function is quite difficult to catch, or it is called from another file (not main.js)
Reply
#68
pic 1 - https://prnt.sc/lXDzADxHYQPF
pic 2 - https://prnt.sc/nwdAmc4fx5WF
Reply
#69
(2023-01-04, 21:30)User 476552 Wrote: Further investigation the site itself using a similar method of packing (which I couldn't unpack)
I traced the function call stack to kw(), which takes a dictionary with request parameters (path, headers, method, etc.) and returns roughly the same dictionary, but with a custom x-sky-signature header.
kw() function is obfuscated quite well (with control flow flattening - it's irreversible), so web version is a dead end.
Reply
#70
I've just subscribed to skyshowtime and it seems it uses this peacock thing. Does anyone have an updated code to get those signatures for the header?
Reply
#71
I'm doing an addon for Peacock. So far playback works, on Android. I'm having problems with the login function, though.
Reply
#72
@Paco8  Can you share your plugin?
Reply
#73
Sure, I'll publish a version soon. First I'd like to clean up the code a little bit since it's full of experimental code.
Reply
#74
share the code youre using for the signatures real quick in a paste i'd like to see how it works
Reply
#75
It's basically the code from this post using the key mentioned there.

But I need help with the login function. The credentials have to be sent to https://rango.id.peacocktv.com/signin/se...ernational but it seems it requires some strange headers with names such as ak4ytpe4w0-a, ak4ytpe4w0-b, ak4ytpe4w0-c... with encrypted data. Without those headers the login fails. Does anyone know how to create those headers?
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 13

Logout Mark Read Team Forum Stats Members Help
NBC Peacock Addon Request0