Skip to content

Instantly share code, notes, and snippets.

@hhc0null
hhc0null / poc.js
Created July 29, 2019 15:04
Code Execution PoC for CVE-2019-9791
/*
Code Execution PoC of CVE-2019-9791 for practice of exploiting SpiderMonkey.
- Bug Finder: @saelo
- Target: 67fc2c30797036217de91cdb4b6d77a876bed7db^
- Reference: https://doar-e.github.io/blog/2018/11/19/introduction-to-spidermonkey-exploitation/
% build-release/bin/js67 --version
JavaScript-C67.0a1
% build-release/bin/js67 work/exploit-js67.js
[+] Successfully got the primitives!
@hhc0null
hhc0null / iroiro.sh
Last active February 10, 2019 13:57
memo
function peco-history-selection() {
BUFFER=$(history 1 | sort -k1,1nr | perl -ne 'BEGIN { my @lines = (); } s/^\s*\d+\*?\s*//; $in=$_; if (!(grep {$in eq $_} @lines)) { push(@lines, $in); print $in; }' | peco --query "$LBUFFER")
CURSOR=${#BUFFER}
zle reset-prompt
}
zle -N peco-history-selection
bindkey -M vicmd "^R" peco-history-selection
function select_pid() {
@hhc0null
hhc0null / exploit.py
Created December 29, 2017 20:58
34C3: pwn-300
#!/usr/bin/env python
from pathlib import PurePath, Path
from tempfile import NamedTemporaryFile
from itertools import islice, cycle
from hexdump import hexdump as hd
import binascii
import hashlib
import re
import os
@hhc0null
hhc0null / memo-for-cleaning-docker-images-and-containers.md
Created April 9, 2017 11:15
Cleaning docker images and containers.
@hhc0null
hhc0null / memo-for-pip-in-ubuntu-1404.md
Created March 26, 2017 05:02
Memo for pip in Ubuntu 14.04

"Packaging" has been no longer available so manual installation is needed. pypa/setuptools#937

@hhc0null
hhc0null / exploit.py
Created March 21, 2017 14:40
A foolish solution for 0CTF 2017 diethard
#!/usr/bin/env python2
import binascii
import collections
import hashlib
import itertools
import re
import os
import random
import shlex
mini: file format elf64-x86-64
Disassembly of section .init:
00000000004003c8 <_init>:
4003c8: 48 83 ec 08 sub $0x8,%rsp
4003cc: 48 8b 05 25 0c 20 00 mov 0x200c25(%rip),%rax # 600ff8 <_DYNAMIC+0x1d8>
4003d3: 48 85 c0 test %rax,%rax
@hhc0null
hhc0null / lshift.py
Last active February 16, 2017 16:56
__lshift__
class Cell:
def __init__(self, *args):
self.stock = [*args]
def __lshift__(self, value):
self.stock.append(value)
return self
if __name__ == '__main__':
@hhc0null
hhc0null / Makefile
Last active December 11, 2016 14:21
SECON 2016 Online CTF Exp300 tinypad
CC = gcc
CFLAGS =-c -std=gnu11 -fstack-protector-all -fPIC
LDFLAGS = -Wl,-z,now -Wl,-z,relro #-pie
sources = tinypad.c pwnio.c
objects = $(sources:.c=.o)
solution= tinypad
.PHONY: clean
all: $(sources) $(solution)