Giter VIP home page Giter VIP logo

winrar-bruteforce-script's Introduction

PyWinrarBruteForce

This code tries to brute-force a password-protected RAR file by generating random passwords of increasing length and attempting to extract the file using each one until the correct password is found or the maximum number of tries is reached.

The 'RarFile' class from the 'rarfile' library is used to open the RAR file in read-only mode, and the 'setpassword' method is used to set the password to be used to extract the file. The 'extractall' method is then called to extract the contents of the file to a specified directory. If the password is incorrect, an exception will be raised, and the except block will be executed.

The 'generate_random_password' function uses the 'secrets' module to generate a random string of the specified length using the 'choice' function from the random module, which selects a 'random' element from a given iterable.

The 'is_password_used' function checks if the generated password has already been tried by checking if it is in the 'used_passwords' list. If it has, the function returns True, and the loop will continue to the next iteration without attempting to extract the file. If the password has not been used, it is added to the 'used_passwords' list and the function returns False.

The 'is_max_tries_reached' function checks if the maximum number of tries has been reached by comparing the current number of tries to the specified maximum. If the maximum number of tries has been reached, the function returns True, and the loop will increase the password length and clear the 'used_passwords' list before continuing.

The 'unzip_success' and 'unzip_failure' functions are called when the file is successfully extracted or the maximum number of tries is reached, respectively. These functions print the elapsed time and the number of tries, and then exit the program.

winrar-bruteforce-script's People

Contributors

anthhon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.