Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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>