Question

In: Computer Science

Write a Python script that performs brute force to extract a password protected zip file named...

Write a Python script that performs brute force to extract a password protected zip file named sec2.zip. The password is believed to be associated with one of the dictionary word in the 'wordlist.txt file.

a) Paste your code here

b) What is the password?

Solutions

Expert Solution

pip3 install tqdm

import zipfile
from tqdm import tqdm

# the password list path you want to use, must be there in the current directory
wordlist = " wordlist .txt"


# the zip file
zip_file = "secret.zip"

# initializing the Zip File object
zip_file = zipfile.ZipFile(zip_file)


# count the no of words in this wordlist
n_words = len(list(open(wordlist, "rb")))


# print the total number of passwords
print("Total passwords: ", n_words)


with open(wordlist, "rb") as wordlist:
    for word in tqdm(wordlist, total=n_words, unit="word"):
        try:
            zip_file.extractall(pwd=word.strip())
        except:
            continue
        else:
            print("[+] Password found!:", word.decode().strip())
            exit(0)
print("[!] Sorry Password not found, try other wordlist.")


root@rockikz:~# gunzip /usr/share/wordlists/rockyou.txt.gz
root@rockikz:~# python3 zip_cracker.py secret.zip /usr/share/wordlists/ wordlist .txt
Total passwords: 14344395


Password found: abcdef12345


Related Solutions

•Write a Write a Python script that performs brute force to extract a password protected zip...
•Write a Write a Python script that performs brute force to extract a password protected zip file named sec3.zip. The password is believed to be associated with one of the dictionary words in the 'wordlist.txt file. The password policy enforces that all employees MUST use passwords that include at least one capital and one digit. The files are attached (hint must import zipfile)
Write a python program that implements a Brute Force attack on Shift Cipher. In this program...
Write a python program that implements a Brute Force attack on Shift Cipher. In this program there is only one input - ciphertext - is a sequence of UPPER CASE letters. To make it easy, the program will be interactive and will output all possible plaintexts and ask user which plaintext makes sense. As soon as user will decide YES, the program will stop searching and print the desired plaintext and the found SHIFT KEY.
Write psuedocode to brute-force a simple password engine. Then, offer advice on making passwords more secure...
Write psuedocode to brute-force a simple password engine. Then, offer advice on making passwords more secure to brute-force attacks.
Write a shell script that will create a new password-type file that contains user information. The...
Write a shell script that will create a new password-type file that contains user information. The file should contain information about the last five users added to the system with each line describing a single user. This information is contained in the last five lines of both the /etc/shadow and the /etc/passwd files. Specifically, you should produce a file where each line for a user contains the following fields: user name, encrypted password, and shell. The fields should be separated...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017 solution named Ass3, which contains one C# Windows Forms App project also named Ass3 and the project contains a default form, Form1.cs and Program.cs. No change should be made in Program.cs, but your Form1 must be designed and implemented to satisfy the following requirements. **Do not submit only a single file of the solution or project. The whole solution folder of VS 2017 must...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017 solution named Ass3, which contains one C# Windows Forms App project also named Ass3 and the project contains a default form, Form1.cs and Program.cs. No change should be made in Program.cs, but your Form1 must be designed and implemented to satisfy the following requirements. **Do not submit only a single file of the solution or project. The whole solution folder of VS 2017 must...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017...
C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017 solution named Ass3, which contains one C# Windows Forms App project also named Ass3 and the project contains a default form, Form1.cs and Program.cs. No change should be made in Program.cs, but your Form1 must be designed and implemented to satisfy the following requirements. **Do not submit only a single file of the solution or project. The whole solution folder of VS 2017 must...
Write out the “brute-force” (exact) expressions for force and torque on a loop 1 in the...
Write out the “brute-force” (exact) expressions for force and torque on a loop 1 in the magnetic field B of loop 2. Write these expressions using magnetic moment of loop 1. Pay attention to the r, r’, … vectors. A magnet (magnetic dipole) tends to align itself parallel to external field. If the magnetic moment is 5 [CGS units] in -z direction and magnetic field is 25 [CGS units] in z direction. What is the value of the torque? Plot...
Problem: Write a Python module (a text file containing valid Python code) named p5.py. This file...
Problem: Write a Python module (a text file containing valid Python code) named p5.py. This file must satisfy the following. Define a function named rinsert. This function will accept two arguments, the first a list of items to be sorted and the second an integer value in the range 0 to the length of the list, minus 1. This function shall insert the element corresponding to the second parameter into the presumably sorted list from position 0 to one less...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on...
Create a bash script file named assessment-script-a that: 1. Accepts any number of file names on the command line 2. For each file name provided, delete any line that contains the string: qwe.rty When the changes are completed, the script should display the total number of files scanned, and the total number of files changed. Example Command: assessment-script-a file.a file.b file.c file.d file.e    Example Output: 5 files scanned, 3 files changed 3. Your script should include a series of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT