Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python to crack the compressed package encrypted by colleagues

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about how to use Python to crack the compressed package encrypted by colleagues. Many people may not know much about it. In order to let everyone know more, Xiaobian summarized the following contents for everyone. I hope you can gain something according to this article.

Here's what happened:

Milk tea again, okay.

Let's get to work, get this done before Dave gets back.

David says it's a six-digit code.

Then we can generate all six digit passwords using python

#Generate password tables from 000000 to 99999 f = open ('passdict.txt ',' w') for id in range(100000): password = str(id).zfill(6)+'\n' f.write(password)f.close()

In this way, we generate a password table from 000000 to 99999.

And save them to the passdict.txt file.

The 6-digit password table is so big!!!

What's next?

nature is to traverse the passwords in the generated password table,

Brute force cracking!

Popular science time:

zipFile Modular Python comes with modules that provide zip file creation, reading, writing, appending, decompression, and file list operations

extract all (path=None, members=None, pwd=None)

path: Specify the location of the extracted file

members: (optional) Specifies the files to be extracted from the Zip file, the file name must be a subset of the list returned by the namelist() method

pwd: Specify the Zip file decompression password

Then we can use zipFile module to traverse the password table,

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

until success.

Import zipFile

import zipfiledef extractFile (zipFile, password): try: zipFile.extractall (pwd= bytes(password, "utf8" )) print ("Dawei's compressed package password is" + password) #crack successfully except: pass #fail, skip def main(): zipFile = zipfile.ZipFile ('Dawei. 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()

took less than a minute

The password successfully solved is:

Close

Before Dawei came back,

A few more words.

Dawei only set a 6-digit password,

So this time as long as the single-thread violence traversal is ok.

And if there are more digits,

A complex combination of alphanumeric characters?

We can apply multithreaded process decompression to speed things up

There are also brute-force dictionaries on the web,

can be downloaded and used to traverse

Interested friends may wish to try.

David's back.

I told him the password was the date of the compressed packet.

David said: 20191119 He has tried.

However, the compression time of this compressed package was 20191118 the day before.

You keep saying you'll use today's date, but why try today's 1119?

But the milk tea is quite good ~

After reading the above content, do you have any further understanding of how to use Python to crack the compressed package encrypted by colleagues? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report