This is how it happened:

Milk tea again, all right, all right.

Let’s get to work. Get it done before David gets back.

David said it was a six-digit code

Then we can use Python to generate the full six-digit password

Create password table from 000000 to 99999
f = open('passdict.txt'.'w')
for id in range(1000000):
 password = str(id).zfill(6)+'\n'
 f.write(password)
f.close()Copy the code

Thus, we generate a table of passwords ranging from 000000 to 99999.

Save them to the passdict.txt file.

That’s how big a 6 digit password list is!!

What’s the next step?

Naturally, the passwords in the generated password table are traversed,


Brute force cracking!

Popular Science Time:

ZipFile is a Python module that allows you to create, read, write, append, extract, and list zip files


Extractall (Path =None, members=None, PWD =None)


  • Path: specifies the location of the decompressed file
  • Members :(optional) specifies the file in the Zip file to extract. This file name must be a subset of the list returned by the namelist() method
  • PWD: specifies the password for decompressing the Zip file

So we can use the zipFile module to walk through the password table,


Try password by password to see if you can open the package.

Until you succeed.

Import zipFile

import zipfile

def extractFile(zipFile, password):
 try:
 zipFile.extractall(pwd= bytes(password, "utf8" ))
 print("David's zip code is." + password) # Decrypted successfully
 except:
 pass # Fail, skip

def main():
 zipFile = zipfile.ZipFile('David. Zip') 
 PwdLists = open('passdict.txt') Read all passwords
 for line in PwdLists.readlines(): # Write passwords one by one
 Pwd = line.strip('\n')
 guess = extractFile(zipFile, Pwd)

if __name__ == '__main__':
 main()Copy the code


It took less than a minute

The password successfully solved is:

Call it a day)

And before David gets back,

Say more.


All David had set up was a six-digit code,

So this time just a single thread violence traversal ok.

So if I have more digits,


What about complex passwords that combine alphanumeric special characters?


We can use a multi-threaded process to decompress and speed things up


There are also some brute-force dictionaries on the Internet,


You can download it and walk through it


Interested friends may wish to try.

David is back.

I told him the password was the date of the package.

David said: 20191119 he has tried.

However, the compression time of this package is 20191118.


Why do you claim to use today’s date to try today’s 1119?

But milk tea is very good ~