That's what happened:
But also tea, okay okay.
Hurry start, before Li Dawei to fight to get back.
Dawei said the six-digit password
So we can use python to generate all of the six-digit password
#生成从000000到99999的密码表
f = open('passdict.txt','w')
for id in range(1000000):
password = str(id).zfill(6)+'\n'
f.write(password)
f.close()
Thus, we generated a password table from the 000000-99999.
Passdict.txt and stores them to a file.
6 password table is so big! ! !
What to do next?
Nature is traversed password password will be generated in the table,
Brute force it!
Science Time:
zipFile modular built-in Python module that provides for the creation of a zip file, read, write, append, extract files and list the action list
The method of using the decompression extractll extractall (path = None, members = None, pwd = None)
- After specifying the location of the extracted files: path
- members :( Optional) Specifies the Zip file you want to extract a file, the file name must be a method to return the list by namelist () subset
- Extract the password specified Zip file: pwd
So we can use zipFile module to traverse the password table,
One by one by one password try, see if I can open the archive.
Until it succeeds.
Import zipFile
import zipfile
def extractFile(zipFile, password):
try:
zipFile.extractall(pwd= bytes(password, "utf8" ))
print("李大伟的压缩包密码是" + password) #破解成功
except:
pass #失败,就跳过
def main():
zipFile = zipfile.ZipFile('李大伟.zip')
PwdLists = open('passdict.txt') #读入所有密码
for line in PwdLists.readlines(): #挨个挨个的写入密码
Pwd = line.strip('\n')
guess = extractFile(zipFile, Pwd)
if __name__ == '__main__':
main()
It took less than a minute
Successfully solved the password is:
Li Dawei set just six digit password,
The violence so long as a single thread traversing ok.
What if more bits,
Special character alphanumeric password complex mix it?
We can use a multithreaded process decompression, speed
There are some on the network brute force dictionary,
It can be used to traverse download
Interested friends may wish to try.
PS: If you want to learn more about the application of python, can private letter I, or click on the link below self-acquire (http://t.cn/A6Zvjdun)