Ingin menangid
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
400 B

5 years ago
  1. from pwn import *
  2. r = remote("103.200.7.156", 1003)
  3. r.recvuntil(">>> ")
  4. r.sendline("2")
  5. for i in range(5):
  6. r.recvuntil("e = ")
  7. e = r.recvline()
  8. e = int(e[:-1])
  9. r.recvuntil("n = ")
  10. n = r.recvline()
  11. n = int(n[:-1])
  12. r.recvuntil("c = ")
  13. c = r.recvline()
  14. c = int(c[:-1])
  15. p = 1000
  16. while True:
  17. if(pow(p, e, n) == c):
  18. break
  19. p +=1
  20. r.sendline(str(p))
  21. print "p = ", p
  22. r.interactive()