Skip to content

Instantly share code, notes, and snippets.

@ril3y
Created February 9, 2012 15:24
Show Gist options
  • Save ril3y/1780659 to your computer and use it in GitHub Desktop.
Save ril3y/1780659 to your computer and use it in GitHub Desktop.
Cuckoo Report Copier
#!/usr/bin/python
import os
import commands
import random
basedir = "analysis"
if __name__ == "__main__":
print "Starting"
for root, dirs, files in os.walk(basedir):
if "reports" in dirs:
f = open(root+"/reports/report.txt", "r")
for l in f.readlines():
if "MD5" in l:
dirname = l.split()[1]
break
print("Copying Report: %s" % dirname)
status1 = commands.getstatusoutput("mkdir r/%s" % dirname )
status2 = commands.getstatusoutput("cp -r %s/reports/* r/%s" % (root,dirname))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment