Skip to content

Instantly share code, notes, and snippets.

@zeheater
zeheater / apkinject.py
Created March 26, 2020 06:28
Simple tool to automate injecting network_security_config to a decompiled apk, using apktool & jarsigner.
import os
import subprocess
import re
import sys
#from defusedxml.ElementTree import parse as parsexml
from xml.etree.ElementTree import parse as parsexml
from xml.etree.ElementTree import register_namespace
from xml.etree.ElementTree import dump as xmldump
from xml.etree.ElementTree import fromstring as xmlfromstring
import ntpath
@zeheater
zeheater / KissmangaPOC.py
Created April 20, 2020 06:57
[POC] Extract encrypted image urls from Kissmanga website, using Node.JS VM binding from python
import sys
import cfscrape
from bs4 import BeautifulSoup as BS
import argparse
from node_vm2 import VM
import re
BASE_URL = 'https://kissmanga.com'
args = None
scraper = cfscrape.create_scraper(delay=10)
@zeheater
zeheater / JWT.md
Last active July 22, 2020 17:27
JWT Notes

JWT from Scratch

JWT Consist of 3 parts:

  • Header
  • Data
  • Verification
Sample:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
@zeheater
zeheater / Step-by-Step GCC.md
Created October 2, 2020 16:01
A step-by-step breakdown of GCC compile and link process

Step-by-Step GCC

main.c

#include<stdio.h>

int main(int argc, char *argv[])
{
  printf("Hello, World !");
  return 0;
}

The basic concept of UN-ENCRYPTED VPN is to route all network packets to the client's TUN interface, where the VPN Client Sofware will read the packets from the TUN interface and write them into a buffer which then will be sent via TCP/UDP connection to the VPN Server. The VPN Server Software writes all data to the server's TUN interface so that it can go to the intended recipient. At this point there are important settings a server must be configured with.

# Server side configuration
sysctl -w net.ipv4.ip_forward=1
iptables -t filter -A FORWARD -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE -s <TUN_IP/MASK>
@zeheater
zeheater / async_udp_server.py
Last active February 25, 2021 12:48
Python Async UDP Server
import sys
import asyncio
import concurrent.futures
from hexdump import hexdump
class DebugServer():
def connection_made(self, transport):
self.transport = transport
@zeheater
zeheater / sixpair.c
Last active March 17, 2021 06:57
Set SixAxis Bluetooth Pair
/**
* Author: zeheater@gmail.com
* Credits:
* 1. https://help.ubuntu.com/community/Sixaxis?action=AttachFile&do=get&target=sixpair.c
* 2. https://github.com/kLeZ/SixPair
*
* Compile with:
* clang -Weverything -o sixpairng sixpairng.c -lusb-1.0
* OR
* gcc -o sixpairng sixpairng.c -lusb-1.0
@zeheater
zeheater / send_bytes_bluetoothctl_spp.md
Created May 27, 2021 07:04
Sending raw bytes to SPP Mobile Printer with bluetoothctl bluez

Send Raw Bytes to Bluetooth SPP with bluetoothctl

bluetoothctl gatt.list-attributes
bluetoothctl gatt.select-attributes <spp - attributes>
bluetoothctl gatt.write "0xhh 0xhh ..."

Using interactive cli

@zeheater
zeheater / old_excel_crack_macro.vbs
Last active March 6, 2022 06:10
Unlock Old Excel Protected Sheet Without Password
Option Explicit
Sub GetPass()
Const a = 65, b = 66, c = 32, d = 126
Dim i#, j#, k#, l#, m#, n#, o#, p#, q#, r#, s#, t#
With ActiveSheet

Looking to create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04?

Screen Shot 2020-06-05 at 20 55 31

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/install/storage) is outdated/wrong. And as of March 2021 it's possible that there's a bug as well with how the bios_grub partitions are created when using multiple disks.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage configuration step of the installer.
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.