Skip to content

Instantly share code, notes, and snippets.

View d4em0n's full-sized avatar
🧐
learning

M Ramdhan d4em0n

🧐
learning
View GitHub Profile
@d4em0n
d4em0n / exp.c
Created July 16, 2023 05:14
zer0pts 2023 flipper exploit: exploiting single bit flip inside kernel heap
#define _GNU_SOURCE
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <err.h>
#include <sys/wait.h>
@d4em0n
d4em0n / exploit.c
Created August 2, 2021 10:15
UIUCTF 2021: bpf_badjmp solutions
// Running with: ./exploit $(cat /proc/kallsyms | grep uiuctf | awk '{print $1}')
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <pthread.h>
@d4em0n
d4em0n / analysis.draft.md
Created July 23, 2021 03:41 — forked from MattPD/analysis.draft.md
Program Analysis Resources (WIP draft)
@d4em0n
d4em0n / exploit.c
Created January 11, 2021 02:17
Real World 3rd CTF: Easy Escape
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
#include <assert.h>
@d4em0n
d4em0n / exploit.c
Created December 6, 2020 14:31
CVE-2020-25221
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <dlfcn.h>
#include <string.h>
@d4em0n
d4em0n / exploit.py
Last active November 23, 2020 09:13
Heap-HOP Dragon Sector CTF
from pwn import *
context.arch = "amd64"
context.terminal = "tmux splitw -h -f".split()
#cmd = "b* $_base()+0x1586"
cmd = ""
DEBUG = 0
p = process("./heap")
#p = remote("yetanotherheap.hackable.software", 1337)
if DEBUG:
gdb.attach(p, cmd, gdb_args=['--init-eval-command="source ~/ctf/tools/gef/gef.py"'])
@d4em0n
d4em0n / exploit.js
Created November 8, 2020 14:51
quickjs exploit
var buf = new ArrayBuffer(8);
var f64_buf = new Float64Array(buf);
var u64_buf = new Uint32Array(buf);
function ftoi(val) {
f64_buf[0] = val;
return BigInt(u64_buf[0]) + (BigInt(u64_buf[1]) << 32n);
}
function itof(val) {
@d4em0n
d4em0n / crasher.c
Created October 16, 2020 14:30
Exploit CVE-2020-8835
#define _GNU_SOURCE
#include <err.h>
#include <stdint.h>
#include <linux/bpf.h>
#include <linux/filter.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <asm/unistd_64.h>
#include <sys/types.h>
@d4em0n
d4em0n / crasher.c
Last active October 15, 2020 01:08
Exploit CVE-2017-16995
#define _GNU_SOURCE
#include <err.h>
#include <stdint.h>
#include <linux/bpf.h>
#include <linux/filter.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <asm/unistd_64.h>
#include <sys/types.h>
@d4em0n
d4em0n / exploit.c
Last active October 11, 2020 08:05
SECCON 2020 kstack exploit script
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>