Skip to content

Instantly share code, notes, and snippets.

@frainfreeze
Last active November 29, 2019 15:34
Show Gist options
  • Save frainfreeze/33c819295fbdca1ba6a9 to your computer and use it in GitHub Desktop.
Save frainfreeze/33c819295fbdca1ba6a9 to your computer and use it in GitHub Desktop.
Small script for writting dump files of tcpdump
import subprocess
import datetime
today = datetime.datetime.now()
dump_file = ('dumped/' + today + '.txt')
def write_dump():
try:
a = subprocess.check_output(['tcpdump'])
dump = open(dump_file 'w')
dump.write(a)
written = True
dump.close()
print 'Sucessfully dumped info'
except:
print 'error while trying to write dump'
if __name__=="__main__":
write_dump()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment