zipfile 썸네일형 리스트형 압축 파일의 패스워드 찾기 root@bt:~/Desktop# vi unzip.py import zipfile zFile = zipfile.ZipFile('evil.zip') zip된 파일 열기 passFile = open('dictionary.txt') dictionary 파일 열기 for line in passFile.readlines(): password = line.strip('\n') try: zFile.extractall(pwd=password) 사전에서 가지고 온 패스워드를 인자로 전달 print '[+] Password = ' + password + '\n' exit(0) except Exception, e: pass root@bt:~/Desktop# python unzip.py [+] Password = secret.. 더보기 압축파일에 잘못된 패스워드를 입력 root@bt:~/Desktop# vi unzip.py import zipfile zFile = zipfile.ZipFile('evil.zip') try: zFile.extractall(pwd='oranges') 잘못된 패스워드를 인자로 전달 except Exception, e: print e root@bt:~/Desktop# python unzip.py ('Bad password for file', ) 에러메세지를 출력 더보기 이전 1 다음