Skip to content

Instantly share code, notes, and snippets.

@parksjin01
Last active March 16, 2017 20:44
Show Gist options
  • Save parksjin01/8725437317a20f4e79a6b9fa742b283e to your computer and use it in GitHub Desktop.
Save parksjin01/8725437317a20f4e79a6b9fa742b283e to your computer and use it in GitHub Desktop.
pwnable.kr mistake writeup
from pwn import *
import time
sh = ssh(host='pwnable.kr', user='mistake', password='guest', port=2222)
passwd = raw_input(text.green_on_black('Plz type password(password should be 10 chars)')).strip()
while len(passwd) != 10:
        passwd = raw_input(text.green_on_black('Plz type password(password should be 10 chars)'))
chpasswd = ''
for i in passwd:
        chpasswd += chr(ord(i)^1)
proc = sh.process('/home/mistake/mistake')
proc.recv(1024)
proc.sendline(passwd)
proc.sendline(chpasswd)
print proc.recv(1024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment