Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print """Simple tool to enable Micrsoft EMET for all executables in system
- This tool creates a bat file which will call emet_conf with suitable
- parameters for all exes in c:\
- Note that some programs might have problems with EMET memory hardenings
- I have added special options for programs I found out causing problems
- in my system.
- If you find out any additional ones, add them to custom settings
- and feel free to tell me.
- Use this program at your own risk, and review the bat file
- before running it
- Created by Jarno Niemela
- Twitter:@jarnomn
- Usage:
- 1. Install EMET http://www.microsoft.com/download/en/details.aspx?id=1677
- 2. run emet_all.py as admin
- 3. run_this_as_admin.bat
- Yes, I know emet_conf has XML import, but that aborts if even
- single exe has some problems"""
- import os
- import os.path
- output=file('run_this_as_admin.bat','w')
- custom_settings=dict()
- custom_settings['dropbox.exe']="+DEP +SEHOP +NullPage +HeapSpray -EAF +MandatoryASLR +BottomUpRand"
- custom_settings['sdiagnhost.exe']="+DEP +SEHOP +NullPage +HeapSpray -EAF +MandatoryASLR +BottomUpRand"
- skip_dirs=['temp','recycle','downloads','installer']
- if os.path.exists("""c:\Program Files (x86)\EMET\emet_conf.exe"""):
- emet_dir="""c:\Program Files (x86)\EMET\emet_conf.exe"""
- elif os.path.exists("""c:\Program Files (x86)\EMET\emet_conf.exe"""):
- emet_dir="""c:\Program Files\EMET\emet_conf.exe"""
- else:
- emet_dir="DEFINE YOUR EMET LOCATION"
- output.write("".join(['"',emet_dir,'"',' --delete_all \n']))
- for root,dirs,files in os.walk ('c:\\'):
- for name in files:
- name=name.lower()
- root=root.lower()
- if name.endswith('exe') and not any(x in root for x in skip_dirs ):
- if name in custom_settings:
- output.write("".join(['"',emet_dir,'"',' --set "%s'%os.path.join(root,name),'" ',custom_settings[name]]))
- else:
- output.write("".join(['"',emet_dir,'"',' --set "%s'%os.path.join(root,name),'"']))
- output.write('\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement