Skip to content

Instantly share code, notes, and snippets.

View ptr-yudai's full-sized avatar

Yudai ptr-yudai

  • Japan
View GitHub Profile
@ptr-yudai
ptr-yudai / steak.c
Created February 6, 2016 14:51
beef_steak
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char cmpdata[0x28] = "\x62\x31\xaa\x85\xbd\xbf\x9f\xf3\x8a\x02\x0c\x75\xac\x23\xab\xe4\x82\xc5\x25\x7a\xef\xbd\xc9\x61\x00\x54\x68\x61";
/* 0x400da6 */
char key[0x28]; /* 0x6020e0 */
char output[0x28]; /* 0x602120 */
unsigned char state[0x100]; /* 0x602160 */
# coding: utf-8
from z3 import *
s = Solver()
LENGTH = 6
# 6文字のテキスト
text = [BitVec('text[{0}]'.format(i), 32) for i in range(LENGTH)]
@ptr-yudai
ptr-yudai / brainf__k.py
Created August 14, 2016 07:08
brainf**kで文字列を出力するコードを出力するコード
# coding: utf-8
import math
# 出力されるbrainf**kコード
code = ""
# brainf**kから出力したい文字
text = "Furutsuki is a Pro!"
# 1文字ずつ
for c in text:
@ptr-yudai
ptr-yudai / solve_hashme.py
Last active August 28, 2016 15:31
hashme - Cryptography - katagaitaiCTF#5 関西med
# coding: utf-8
from pwn import *
#
# crypto200.pyからそのまま引用
#
from math import sin
from urlparse import parse_qs
from base64 import b64encode
from base64 import b64decode
@ptr-yudai
ptr-yudai / elf_md5colliding.c
Last active August 28, 2016 14:04
md5colliding - Cryptography - katagaitaiCTF#5 関西med
/* for x86 linux */
#include <stdio.h>
int main(int argc, char** argv)
{
char c = argv[0][2];
if (c == '1') {
puts("All Eindbazen are wearing wooden shoes");
} else if (c == '2') {
@ptr-yudai
ptr-yudai / tp_exploit.py
Created August 28, 2016 15:21
tp - Pwn - katagaitaiCTF#5 関西med
from pwn import *
class tp:
#
# Constructor
#
def __init__(self, host, port):
# Connect to server
self.sock = remote(host, port)
# List of commands
@ptr-yudai
ptr-yudai / Makefile
Created December 22, 2016 13:05
きつねさんとLLVMで作った電卓
# calc.binを出力するコマンド
calc.bin: y.tab.c lex.yy.c # 下のコマンドに必要なファイル
cc -o calc.bin y.tab.c lex.yy.c
# y.tab.cを出力するコマンド
y.tab.c: calc.y # 下のコマンドに必要なファイル
yacc -dv calc.y
# lex.yy.cを出力するコマンド
lex.yy.c: calc.l # 下のコマンドに必要なファイル
@ptr-yudai
ptr-yudai / calc.l
Created December 22, 2016 13:25
きつねさんとLLVMで作った電卓2
%{
#include <stdio.h>
#include "y.tab.h"
int yywrap(void) { return 1; }
%}
%%
"+" return OPERATOR_ADD;
"-" return OPERATOR_SUB;
"*" return OPERATOR_MUL;
@ptr-yudai
ptr-yudai / record.py
Created March 29, 2017 14:04
[LINUX] Voice Recorder for TOEFL Speaking Test
# Simple Voice Recorder for TOELF Speaking Test
# Usage:
# python record.py [output.wav]
# Requirement:
# Python 2, arecord (often pre-installed on linux)
# What does this program do?
# First, this program will wait 15 seconds, which is the same length given in the TEFL test for preparing your answer.
# Second, arecord will begin to record your voice for 45 seconds in which you need to answer the question.
# After that, the recorded voice will be saved as a wav file.
# Optionally, you can listen to the recorded voice after your answer.
@ptr-yudai
ptr-yudai / service.py
Created August 28, 2018 12:44
研究室内CTFで出題したCrypto問題のサービス
#!/usr/bin/python
import hashlib
import base64
import re
from secret import FLAG, SALT
def construct(data):
ret = {}
regs = data.split('|')
for reg in regs: