Skip to content

Instantly share code, notes, and snippets.

View rgerganov's full-sized avatar

Radoslav Gerganov rgerganov

View GitHub Profile
@rgerganov
rgerganov / stb-update-proxy.md
Last active August 4, 2024 14:00
Proxying the update host for Eurolan STBs

Proxying the update host for Eurolan STBs

Firmware updates for TH100/TH200/TH300 set-top boxes are served from stb.xakcop.com:443. If this host is not reachable from your internal IPTV network, then you can setup a proxy update host:

+------------+           +--------------+           +--------------------+
|            |           |              |           |                    |
| TH100 STBs |<--------->| Proxy Update |<--------->| stb.xakcop.com:443 |
|            |           |     Host     |           |                    |
+------------+ +--------------+ +--------------------+
@rgerganov
rgerganov / build.md
Last active December 20, 2023 08:33
Pixel 8 Pro results
➜  build-android2 git:(master) ✗ make -j
[  1%] Generating build details from Git
[  2%] Building C object CMakeFiles/ggml.dir/ggml.c.o
[  3%] Building C object CMakeFiles/ggml.dir/ggml-alloc.c.o
[  4%] Building C object CMakeFiles/ggml.dir/ggml-backend.c.o
[  5%] Building C object CMakeFiles/ggml.dir/ggml-quants.c.o
-- Found Git: /usr/bin/git (found version "2.25.1") 
Scanning dependencies of target build_info
[  6%] Building CXX object common/CMakeFiles/build_info.dir/build-info.cpp.o
@rgerganov
rgerganov / dump_signatures.py
Last active September 28, 2023 11:13
Get precomputed signatures from AirReceiver
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
from datetime import date, timedelta
ADB_PATH = '/tmp/platform-tools/adb'
AUTH_CMD = '/tmp/auth'
IP_ADDR = '192.168.1.213'
@rgerganov
rgerganov / SimpleHTTPServerWithUpload.py
Created May 12, 2022 14:53 — forked from smidgedy/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/env python3
########################################################################
#
# Simple HTTP server that supports file upload for moving data around
# between boxen on HTB. Based on a gist by bones7456, but mangled by me
# as I've tried (badly) to port it to Python 3, code golf it, and make
# It a little more robust. I was also able to strip out a lot of the
# code trivially because Python3 SimpleHTTPServer is a thing, and the
# cgi module handles multipart data nicely.
#
@rgerganov
rgerganov / th100-howto-wg.md
Last active May 21, 2023 19:50
TH100 Wireguard HOWTO

Connecting TH-100 STBs to Wireguard VPN server

This guide shows how to connect TH-100 STBs to a Wireguard VPN server. On the server side you need a Linux box with Wireguard installed. For Debian/Ubuntu simply run:

$ sudo apt install wireguard
$ sudo sysctl -w net.ipv4.ip_forward=1

Your TH-100 STBs needs to run firmware version 286 or later.

@rgerganov
rgerganov / nss-db.sh
Last active May 10, 2024 13:40
Create NSS db for Firefox/Chrome/LibreOffice
# build and install libccid from source
# do not install opensc from packages, build it from source
sudo apt-get install libnss3-tools
cd $HOME
mkdir -p .pki/nssdb
modutil -dbdir sql:.pki/nssdb -add "stampit" -libfile /usr/local/lib/opensc-pkcs11.so
modutil -dbdir .pki/nssdb -add "stampit" -libfile /usr/local/lib/opensc-pkcs11.so
@rgerganov
rgerganov / passcode.py
Created July 30, 2021 12:01
APRS passcode generator
#!/usr/bin/env python3
import sys
if __name__ == '__main__':
callsign = sys.argv[1].upper()
print(callsign)
hash = 0x73e2
for i in range(0, len(callsign), 2):
hash ^= ord(callsign[i]) << 8
if i + 1 < len(callsign):
@rgerganov
rgerganov / softhsmv2.py
Last active April 13, 2021 07:27
SoftHSMv2
#!/usr/bin/env python3
# This script derives the masterKey and tokenKey from a SoftHSMv2 token.
# For more details: https://xakcop.com/post/softhsmv2/
import sys
from Cryptodome.Hash import SHA256
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import unpad
PBE_ITERATION_BASE_COUNT = 1500
@rgerganov
rgerganov / create-vmdk.sh
Created August 26, 2020 08:44
Create VMDK disk suitable for syzkaller
#!/bin/bash
VMDK_FILE="syzkaller.vmdk"
VMDK_SIZE="3GB"
NBD_DEV="/dev/nbd0"
NBD_DEVP1="${NBD_DEV}p1"
MOUNT_DIR="/tmp/vmdk"
ROOTFS="${1:-stretch.img}"
echo "Using ROOTFS=$ROOTFS"
@rgerganov
rgerganov / sign
Created February 18, 2020 09:41
TPM2 sign
#!/bin/sh
tpm2_createprimary -c primary.ctx
tpm2_create -C primary.ctx -G ecc -u key.pub -r key.priv
tpm2_load -C primary.ctx -u key.pub -r key.priv -c key.ctx
tpm2_readpublic -f pem -o key.pem -c key.ctx
echo "my message" > message.dat
sha256sum message.dat | awk '{ print "000000 " $1 }' | xxd -r -c 32 > message.dat.digest
tpm2_sign -c key.ctx -g sha256 -d -f plain -o message.dat.sig message.dat.digest
openssl dgst -verify key.pem -keyform pem -sha256 -signature message.dat.sig message.dat