1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
for path, dirs, files in os.walk(windows):
for filename in (files):
# Si Fichier trouvé dans repertoire windows winlogon
fichier = os.path.join(path, filename)
rep = os.path.join(path)
cle = hashlib.md5()
try:
if unicode(''.format(filename).encode("utf-8")) == 'winlogon.exe':
with open(fichier, "rb") as f:
cle.update(f.read())
res = cle.hexdigest()
text2.insert(END,'Winlogon : '+rep+'\n\r')
text2.insert(END,'MD5 : '+str(res)+'\n\n\r')
text2.update()
if filename == 'explorer.exe':
with open(fichier, "rb") as f:
cle.update(f.read())
res = cle.hexdigest()
text2.insert(END,'Explorer : '+rep+'\n\r')
text2.insert(END,'MD5 : '+str(res)+'\n\n\r')
text2.update()
if filename == 'wininit.exe':
with open(fichier, "rb") as f:
cle.update(f.read())
res = cle.hexdigest()
text2.insert(END,'Wininit : '+rep+'\n\r')
text2.insert(END,'MD5 : '+str(res)+'\n\n\r')
text2.update()
except IOError:
pass |