Skip to content

Instantly share code, notes, and snippets.

View Tosainu's full-sized avatar
🌸
ヾ( ╹◡╹ 🌸 )ノ"

Kenta Sato Tosainu

🌸
ヾ( ╹◡╹ 🌸 )ノ"
View GitHub Profile
#!/usr/bin/env stack
-- stack --stack-yaml ./stack.yaml runghc --package pwn
-- Ghost in the Shellcode 2013: Shiftd
-- http://shell-storm.org/repo/CTF/GITS-2013/Pwnable/Shiftd-100/
{-# LANGUAGE OverloadedStrings #-}
import Data.Bits
import qualified Data.ByteString.Char8 as BS
#!/usr/bin/env stack
-- stack --stack-yaml ./stack.yaml runghc --package pwn
-- DEF CON CTF Qualifier 2013: annyong
-- http://shell-storm.org/repo/CTF/Defcon-21-quals/annyong/
{-# LANGUAGE OverloadedStrings #-}
import Data.Bits
import qualified Data.ByteString.Char8 as BS
use std::io::prelude::*;
use std::io;
use std::net::TcpStream;
fn p_32(v: u32) -> [u8; 4] {
[
((v & 0x000000ff)) as u8,
((v & 0x0000ff00) >> 8) as u8,
((v & 0x00ff0000) >> 16) as u8,
((v & 0xff000000) >> 24) as u8,
#ifndef CSV_H
#define CSV_H
// 簡易的な型付きcsvパーサ
//
// const auto c = csv::parse<各列の型, ...>(入力ストリーム);
// のように呼び出すことで, 読み込んだ結果をtupleの配列として受け取ることができる.
#include <fstream>
#include <locale>
#!/usr/bin/env python2
# ASIS CTF Quals 2017 : Start (89 points)
from pwn import *
import sys
# RAX: 0x0
# RBX: 0x0
# RCX: 0x7f0d40ce0360 (<__read_nocancel+7>: cmp rax,0xfffffffffffff001)
#!/usr/bin/env python2
# Codegate CTF 2016 : old-school
# https://github.com/ctfs/write-ups-2016/tree/master/codegate-ctf-2016/pwn/old-school
from pwn import *
import sys
# $ ./oldschool
# YOUR INPUT :AAAA%p.%p.%p.%p.%p.%p.%p.%p.%p
#!/usr/bin/env python2
# Insomni'hack Teaser 2017 : baby-50
# https://github.com/ctfs/write-ups-2017/tree/master/insomnihack-teaser-2017/pwn/baby-50
from pwn import *
import sys
# Your format > AAAAAAAA.%9$p
# AAAAAAAA.0x4141414141414141
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN \
apt-get update && \
apt-get install -y libc6-i386 socat && \
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
CMD ["/bin/bash"]
#!/usr/bin/env python2
# DEF CON CTF Qualifier 2016 : feedme
# https://github.com/ctfs/write-ups-2016/tree/master/def-con-ctf-qualifiers-2016/pwn/feedme
from pwn import *
# [0x08049036]> pdf
# / (fcn) fcn.08049036 122
# | fcn.08049036 ();
#!/usr/bin/env python2
# 31C3 CTF : cfy
# https://github.com/ctfs/write-ups-2014/tree/master/31c3-ctf-2014/pwn/cfy
from pwn import *
# 0x00400891 488b05300820. mov rax, qword [obj.stdin]
# 0x00400898 4889c2 mov rdx, rax
# 0x0040089b be00040000 mov esi, 0x400