Skip to content

Instantly share code, notes, and snippets.

@icchy
icchy / solve.py
Created March 5, 2017 16:08
Pragyan CTF Binary Exploitation 150
from unicorn import *
from unicorn.x86_const import *
from capstone import *
from capstone.x86_const import *
flag = ""
rax_flag = False
def hook(uc, address, size, userdata):
cs = Cs(CS_ARCH_X86, CS_MODE_64)
@icchy
icchy / run_angr.sh
Created April 13, 2017 08:32
angr launcher for Docker
function run_angr() {
if [ $# -gt 0 ]; then
WRAPPER=$(basename `mktemp`)
cat << EOF > $WRAPPER
#!/bin/sh
. ~/.virtualenvs/angr/bin/activate
rm -f \$0
\$@
EOF
chmod +x $WRAPPER
@icchy
icchy / exploit.py
Created April 28, 2017 04:06
HITCON CTF 2014 stkof
#!/usr/bin/env python
from pwn import *
context(os='linux', arch='amd64')
context.log_level = 'debug' # output verbose log
RHOST = "127.0.0.1"
RPORT = 10080
LHOST = "127.0.0.1"
LPORT = 10080

Keybase proof

I hereby claim:

  • I am icchy on github.
  • I am icchy (https://keybase.io/icchy) on keybase.
  • I have a public key ASBwarXZmL7KF-RQSjS7SklMWOI0P1w5L7t-fsMNwpDW-Qo

To claim this, I am signing this object:

@icchy
icchy / sync.sh
Last active January 30, 2018 10:37
rsync with fswatch
#!/bin/sh
remote_dir=host:path/to/remote/dir
local_dir=path/to/local/dir
usage () {
echo "usage: $0 [pull|push|sync]" >&2
}
check () {
@icchy
icchy / autossh.service
Last active January 30, 2018 02:03
persistent reverse port forward with systemd
[Unit]
Description = SSH daemon for rescure
After = network.target
[Service]
ExecStart = /usr/bin/ssh \
-N \
-o "ExitOnForwardFailure=yes" \
-o "StrictHostKeyChecking=no" \
-o "UserKnownHostsFile=/dev/null" \
@icchy
icchy / install.md
Last active November 27, 2018 02:07
ArchLinux installation memo

partitioning (GPT, EFI)

  • /boot 200MB fat32 (EFI System)
    • mkfs.fat -F32 /dev/sdX1
  • / rest xfs (Linux filesystem)
    • mkfs.xfs /dev/sdX2
    • xfs_admin -L "arch_os" /dev/sdX2 # label partition

install base system

mkdir -p /mnt/boot
@icchy
icchy / server.go
Created August 7, 2019 15:56
Antivirus Oracle demo server
package main
import (
"bytes"
"crypto/rand"
"crypto/sha256"
"encoding/gob"
"fmt"
"io/ioutil"
"log"
@icchy
icchy / exp.c
Created September 2, 2019 00:30
Oneline Calc
123;
return 123;
}
extern void *opendir(const char *);
extern void *readdir(void *);
extern void *shmat(int, const void *, int);
typedef struct {
ino_t d_ino;
off_t d_off;
unsigned short d_reclen;
@icchy
icchy / solve.py
Created October 7, 2019 06:38
Balsn CTF 2019 pyshv1
import pickle
import io
whitelist = ['sys']
# See https://docs.python.org/3.7/library/pickle.html#restricting-globals
class RestrictedUnpickler(pickle.Unpickler):
def find_class(self, module, name):
print(module)