Skip to content

Instantly share code, notes, and snippets.

@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)
@hhc0null
hhc0null / weather
Last active November 13, 2016 06:41
RuCTFE: weather (explicit bof and fsb by sprintf())
@hhc0null
hhc0null / battery
Created September 21, 2016 09:36
battery?
#!/bin/sh
CAPACITY_PATH="/sys/class/power_supply/BAT1/capacity"
capacity=$(cat ${CAPACITY_PATH})
ESC="\e"
BK=40
LBK=100
FW=30
LFW=90
@hhc0null
hhc0null / exploit.py
Last active September 9, 2016 01:31
{DEF CON CTF 2016 Qualification] pwn-pillpusher (I couldn't solve it during competition but thanks for reversing by @ytoku)
#!/usr/bin/env python2
import binascii
import hashlib
import re
import random
import socket
import string
import struct
import subprocess
@hhc0null
hhc0null / my_first_fuzzing.py
Created April 2, 2016 23:16
For NDH2K16: Crazy Town Famous(pwn350). Works not well, I have no taste for programming...
#!/usr/bin/env python2
import binascii
import hashlib
import itertools
import random
import re
import socket
import string
import struct
#!/usr/bin/env python2
import binascii
import hashlib
import re
import socket
import string
import struct
import subprocess
import time
@hhc0null
hhc0null / WoS3
Last active September 9, 2016 01:30
VolgaCTF 2016 Quals: Web of Science (250pts) & Web of Science 2 (350pts)
I was cooking and eating curry...
@hhc0null
hhc0null / readme.md
Created March 24, 2016 16:04
somthing on heap

?

@hhc0null
hhc0null / 0ctfq.md
Last active March 16, 2016 16:29
I didn't submit any flags on this contest:P

A writeup(?) for 0CTF 2016 Quals

trace (rev 4pts)

First, I sorted the log file by a snippet shown below to analyze its behaviour.
After that I noticed that it showed a process of quick-sorting some characters('a'-'z'|'A'-'Z'|'0'-'9'|flag).

#!/usr/bin/env python2

import collections
@hhc0null
hhc0null / seeing-the-behavior-by-ltrace
Last active March 10, 2016 03:26
some study of heap exploitation
(12:23) hhc0null@arch_on_vbox% ltrace -s 512 -e "[email protected].*" ./freenote [~/ctf] [8296]
freenote->malloc(6160) = 0x17d0010
== 0ops Free Note ==
1. List Note
2. New Note
3. Edit Note
4. Delete Note
5. Exit
====================
Your choice: freenote->read(02