(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
| #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> |
| // 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> |
(draft; work in progress)
See also:
| #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> |
| #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> |
| 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"']) |
| 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) { |
| #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> |
| #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> |
| #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> |