Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Help 

Someone guide me here

Hey guys,

I am currently trying to recreate GET request which an android app sends to a server to get a specific response.

The app is showing for german tv channels if there are currently advertisements running or not. And this information it is getting from the server the app is using.

I want to make use of that information and use them to create an enigma2 python plugin which is zapping back to the channel I was watching as soon as the advertisment brake is over.

Now I am running into a problem, the app is sending 2 get requests:
https://pastebin.com/wYYRFz6P --> it is just a get request to this url: http://werbesignal.fernsehfee.de:8080/socket.io/1/

the second one has to do something with websockets and this is where I am stuck and do not know how to proceed:
https://pastebin.com/H5ud78Ah

This is the response the second request generates:
https://pastebin.com/5mrpneJk
(That is the data I want to make use of..)

There they make use of a " sec-websocket-key " which probably gets genrated by the app. But I could not figure out how exactly it is generated because I am not very familiar with java or android in general.

I uploaded the decompiled app: http://www.mediafire.com/file/7uqwqiz9ir...om.apk.zip

Could somebody help me to figure out how I need to generate the websocket key so I can make use of the response data?

regards,
gelsas
Okay now I am one step further.

I was able to find out that they use socket.io so they are using websockets..

To connect to the websocket it requires socket.io version 0.9.11

and this code:

Code
var io = require('socket.io-client');

var socket = io.connect(
  'http://werbesignal.fernsehfee.de:8080/',
  {
    // //path: '/socket.io',
     transports: ['websocket'],
     transportOptions:{
         polling: {
           extraHeaders:{
              'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 5.1.1; D5503 Build/14.6.A.1.236)'
           }
         }
      }
  }
);

var original_$emit = socket.$emit;
socket.$emit = function() {
  var args = Array.prototype.slice.call(arguments);
  original_$emit.apply(socket, ['*'].concat(args));
  if (!original_$emit.apply(socket, arguments)) {
    original_$emit.apply(socket, ['default'].concat(args));
  }
};

socket.on('connect', function() {
  console.log('connect');
  socket.emit('news', { hello: 'world' });
});
socket.on('*', function(data) {
  console.log('event', data);
});
socket.on('disconnect', function() {
  console.log(disconnect);
});
socket.on('error', function(err) {
  console.log(err);
});

Now I am already connected but can not get the needed data (see here for example of the data @line 13: https://pastebin.com/5mrpneJk)

What am I missing here?

Regards,
gelsas