Skip to content

Instantly share code, notes, and snippets.

@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
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
# RSA Decipher for SECCON CTF 4(Yokohama)
# Author: Matsukuma Hiroki a.k.a. hhc0null <hhc.0.null@gmail.com>
# Usage: ./RSA_Decipher < [Crypted Text]
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)
@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