Skip to content

Instantly share code, notes, and snippets.

@MohitDabas
Last active March 6, 2021 12:37
Show Gist options
  • Save MohitDabas/21a6f47b502bef2213ebfef68c829270 to your computer and use it in GitHub Desktop.
Save MohitDabas/21a6f47b502bef2213ebfef68c829270 to your computer and use it in GitHub Desktop.
The Following code snippets find permission on paths found in autoruns sysinternal utils
import re
import os
autoRunFileData=open('autorun.txt',encoding='utf-16').readlines()
count=1
for line in autoRunFileData:
matches=re.findall(r'[a-zA-Z]:\\[\\\S|*\S]?.*$',line)
try:
path=matches[0].split('"\t')[0]
print(path)
os.system('accesschk64.exe -wvu "'+path+'"')
except Exception as e:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment