Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Nov 27, 2021. It is now read-only.

erkexzcx/stalkerhek

Repository files navigation

Stalkerhek

Build Status Go Report Card

Stalker is a popular IPTV streaming solution. You can buy a preconfigured TV box or buy Stalker portal connection details which can be used with special TV Boxes or emulators such as Stbemu. Stalker portal connection details consist of username & password pair, 2 unique device IDs, signature, mac address and so on. On top of that, if you setup Stalker portal in another TV Box, the other one will get disconnected, making it possible to only watch on a single device at the same time.

Stalkerhek is a middleware/proxy/gateway application that allows watching Stalker IPTV on a simple video players, like VLC. Stalkerhek serves HLS (M3U) playlist via its integrated HTTP server, rewritting all the further links and effectively hiding original viewer's source IP from the Stalker portal.

Advantages:

  • Watch Stalker IPTV on a simple media players (e.g. VLC).
  • Watch on multiple devices, even from different source IP addresses, at the same time.

Disadvantages/missing features:

  • Based on reverse-engineering. Expect some channels/configurations not to work at all.
  • No catching (if 5 viewers are watching the same IPTV channel at the same time, then IPTV channel will receive 5x more requests).
  • No VOD.
  • No EPG.

Usage

1. Extract Stalker authorization details from TV box

You can skip this step if you have below details already and you are sure that they are working.

To extract all the authentication details, use wireshark to capture HTTP requests and analyse them by hand. I used capture filter port 80 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420 and display filter http.request.method == GET. You will likely want to use MITM attack using arpspoof. You will also need to restart TV box when capturing requests to see your TV box logging into stalker portal with stored authentication details. If you are smart/lucky enough, you can use port mirroring on your router and wireshark on the mirrored-to port. Anyway, you must capture the traffic in any way you can.

You will need the following details extracted from the wireshark logs (see stalkerhek.example.yml file):

  • model - from request headers
  • sn (serial number) - from URL
  • device_id - from URL
  • device_id2 - from URL
  • signature - from URL
  • mac - from request headers
  • login - from URL
  • password - from URL
  • timezone - from request headers
  • location (URL address) - from URL
  • token - from request headers, next to "Bearer ". Does not matter that much since stalker server should issue new token if provided is in use.

Regarding URL address/location: If your tv box connets to http://domain.example.com/stalker_portal/server/load.php?... then it's going to be http://domain.example.com/stalker_portal/server/load.php. If it connects to http://domain.example.com/portal.php?..., then it's going to be http://domain.example.com/portal.php. Wireshark will tell you where it connects. :)

All this info will be visible in the URLs or request headers (everything should exist in wireshark capture).

2. Create configuration file

cp stalkerhek.example.yml stalkerhek.yml
vim stalkerhek.yml

3. Build application

First, you have to download & install Golang from here. DO NOT install Golang from the official repositories because they contain outdated version which is not working with this project.

To ensure Golang is installed successfully, test it with go version command. Example:

$ go version
go version go1.16.2 linux/amd64

Then build the application and test it:

go build -ldflags="-s -w" -o "stalkerhek" ./cmd/stalkerhek/main.go
./stalkerhek -help
./stalkerhek -config stalkerhek.yml -bind 0.0.0.0:9999

If you decide to edit the code, you can quickly test if it works without compiling it:

go run ./cmd/stalkerhek/main.go -help
go run ./cmd/stalkerhek/main.go -bind 0.0.0.0:9999

4. Run application

I suggest first testing with CURL:

curl http://<ipaddr>:8987/iptv

You might see that there are no channels - in such case simply restart this application and try again.

If there are channels loaded, you can use above URL in VLC/Kodi. :)

5. Installation guidelines

  1. Copy/paste file stalkerhek.service to /etc/systemd/system/stalkerhek.service.
  2. Edit /etc/systemd/system/stalkerhek.service file and replace myuser with your non-root user. Also change paths if necessary.
  3. Perform systemctl daemon-reload.
  4. Use systemctl <enable/disable/start/stop> stalkerhek.service to manage this service.

P.S. Sorry for those who are looking for binary releases or dockerfile - I will consider it when this project becomes more stable.

About

Stalker portal proxy server that allows sharing account on multiple STB boxes and play on VLC.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages