Giter Club home page Giter Club logo

zydra's Introduction

Zydra

Zydra is a file password recovery tool and Linux shadow file cracker. It uses the dictionary search or Brute force method for cracking passwords.

Supported Files

  • RAR Files
  • Legacy ZIP Files
  • PDF Files
  • Linux Shadow Files (zydra can find all the user’s password in the linux shadow file one after the other)

Prerequisites

To run the app, minimal requirements are:

  • Python 3.3 or higher
  • debian-based linux distro, preferably Kali linux 2
  • qpdf and unrar packages
    Installing these packages on kali is as easy as running the following commands on terminal:
    $ sudo apt-get update
    $ sudo apt-get install qpdf unrar
  • some python modules in this program need to be installed manually, like: zipfile, rarfile, crypt, pyfiglet, py-term(for term module) and so on. you can use pip3 for install them example:
    $ pip3 install py-term
    notice: rar,zip and pdf files must have an extension, shadow files does not need an extension.
  • Install figlet font "epic" if it does not exists on your system:
    sudo wget http://www.figlet.org/fonts/epic.flf -O /usr/share/figlet/epic.flf

Disclaimer

This tool is only for testing and academic purposes Do not use it for illegal purposes!

Features

  • Cracking files password using two methods: 1. dictionary method 2. brute force method
  • In the brute force method, you can specify the min length and max length of the passwords.
  • In the brute force method, you can specify the type of characters that may be used in the password.
  • There is a percent progress bar showing how much of the process has been performed.
  • Error handling.
  • One of the most important features of Zydra is the multiprocessing feature that speeds up the program. For example if you have 8 CPU cores, Zydra will use all of them for processing at the same time.

Installation

Download Zydra by cloning the Git repository:
$ git clone https://github.com/hamedA2/Zydra.git

You can also use vagrant to automatically install and run Zydra (more information at the bottom of the page).

Usage

To get a list of all options and learn how to use this app, enter the following command:

$ python3 Zydra.py -h

alt text

Examples

1- Dictionary search to find the password for a zip file
In this example I use rockyou.txt dictionary

$ python3 Zydra.py –f file.zip –d rockyou.txt

alt text

2- Brute force search to find the password for the users in the shadow file
Minimum length of password is 4 and maximum length is 4 and we try to find passwords that are composed of numbers and symbols letters.

$ python3 Zydra.py –f shadow –b digits,symbols –m 4 –x 4

alt text

Vagrant

To run Zydra using vagrant use the following command (you have to be in the same folder as the repository):

vagrant up

and once it finishes inialisation, you can run:

vagrant ssh

to connect to the virtual machine.

To exit the virtual machine just type exit in the shell.

To destroy the virtual machine run vagrant destroy.

More information regarding vagrant usage can be found here

Note: By default the Vagrantfile uses the following settings:

    vb.cpus = 4
    vb.memory = 4096

Edit the Vagrantfile and change those values to improve the performance.

Author

  • Hamed Hosseini

A special thank to, Hamed Izadi

License

This project is licensed under the MIT License - see the LICENSE.md file for details

zydra's People

Contributors

butterflyx avatar hameda2 avatar trolologuy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zydra's Issues

please help

Traceback (most recent call last):
File "Zydra.py", line 680, in
cracker.main()
File "Zydra.py", line 638, in main
self.dict_guess_password(dictfile, file)
File "Zydra.py", line 314, in dict_guess_password
possible_words = self.count_word(dict_file)
File "Zydra.py", line 94, in count_word
for line in wordlist:
File "/usr/lib/python3.8/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 933: invalid continuation byte

min and max checks invalid due to parser.option values being stored as strings instead of int

> zydra.py -f <file> -b <char_type> -m <min_length> -x <max_length>

Ex:
% ./zydra.py -f file.pdf -b lowercase,digits -m 9 -x 10  

zydra.py: error:  Min and Max must be numbers and Min must be 
less than Max or be the same, Use --help for more info

A bug where "10" is getting picked up as less than "9"

The check here (https://github.com/hamedA2/Zydra/blob/master/Zydra.py#L652) is correct.

However, setting the parser options as string (should be "int") is the problem here: https://github.com/hamedA2/Zydra/blob/master/Zydra.py#L622-L623
Updated: https://github.com/hamedA2/Zydra/blob/master/Zydra.py#L626-L627

parser.add_option("-m", dest="minlength", type='string', help="Specifies minimum length of password")
parser.add_option("-x", dest="maxlength", type='string', help="Specifies maximum length of password")

Saving feature

Hello,

It could be interesting to have a save option to continue the job when it was left.

Not working

not decoding .rar file // gives wrong password
not decoding .zip file encoded with ubuntu compression /* gives no output even with dictionary containing the password*/
tried hotfix 17 and all other pull requests still no change

AttributeError: module 'term' has no attribute 'clear'

pls help me?

root@kali:/Tools/Zydra# pip3 install py-term
Requirement already satisfied: py-term in /usr/local/lib/python3.7/dist-packages (0.6)
root@kali:
/Tools/Zydra# python3 Zydra.py -h
Traceback (most recent call last):
File "Zydra.py", line 675, in
cracker = Zydra()
File "Zydra.py", line 26, in init
self.banner()
File "Zydra.py", line 581, in banner
term.clear()
AttributeError: module 'term' has no attribute 'clear'

Very slow tool

You should use Assembly or C language to write this tool. Python is very slow.

UnicodeDecodeError

when i run the zydra it will an Unicode error
Error : UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 923: invalid continuation byte

Screenshot from 2021-03-18 19-48-13

Thanks for reading this issue

High disk space consumption

I run Zydra by following command:

python3 Zydra/Zydra.py -f secret.rar -b digits,letters -m 10 -x 15

and after a few minutes I got error:

OSError: [Errno 28] No space left on device

When I check directory temp_directory/ I found out folder is 81 GB large. How much space on disk I need?

Is some way how run Zyndra without using temp_folder?

-x and -m comparison always fails

Providing minimum and maximum password lengths always fails comparison when validating values, because parameters are strings, and not recast as int when defined in the argument parser

Wrong input type

Zydra/Zydra.py

Line 626 in 791fabd

parser.add_option("-m", dest="minlength", type='string', help="Specifies minimum length of password")

I wasnt able to get different minimum values to work here. I had to change the input type to int rather than string in order to get passed the error message

problem

[*] Count of possible passwords: 41340
Progress : [########## ] 24.190 %Process Process-3:
Traceback (most recent call last):
File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/root/Zydra/Zydra.py", line 132, in search_zip_pass
temp_file = self.create_temporary_copy(compress_file, passwords_list[1])
File "/root/Zydra/Zydra.py", line 178, in create_temporary_copy
shutil.copy2(file, temp_file_path)
File "/usr/lib/python3.9/shutil.py", line 435, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'temp_directory/temp 456789\n.zip'

Pyfiglet.FontNotFound: epic and SyntaxWarning

This is on a clean install from Kali before and after using the script.sh.

image

And this keeps happening tried using another Python 3.7 but nothing as well

image

Awesome tool would like to get this working.

Thanks!

Tool Fails with Certain Scenarios

Hey HamedA2,

First off, thanks for making this tool.

Id like to point out some issues I found with it and I'm curious what your thoughts are.

First, when defining a wordlist file with too little entries (1 entry only) your tool fails with the following error. (zip file)

image

I know out in the wild, we wouldn't have a wordlist with a single entry, but for testing sake and learning with your tool, why does it fail? It reduces my confidence in the accuracy of this program.

Also, when I have a password on a ZIP file set to 12345 and I run the following command, your tool says password not found after it tries all possibilities. Why is that?

python3 zydra.py -f /media/sf_vm.shared/1.zip -m 5 -x 5 -b digits

I am creating a .zip file with 7zip that has aes256 encryption. Does your tool not support ANY files created by 7zip?

Thank you for your feedback.

rarfile unrar

add "pip install rarfile" to prerequisites
unrar
rarfile
is

module

ImportError: dlopen failed: How to solve

I was completely install all packages also step by step but is showing like
My phone didn't rooted
Redmi note 8
Please solve the problem and help me
$ python3 zydra.py
/data/data/com.termux/files/home/zydra.py:301: SyntaxWarning: "is" with a literal. Did you mean "=="?
if self.file_type is "rar":
Traceback (most recent call last):
File "/data/data/com.termux/files/home/zydra.py", line 9, in
import crypt
File "/data/data/com.termux/files/usr/lib/python3.11/crypt.py", line 6, in
import _crypt
ImportError: dlopen failed: cannot locate symbol "crypt" referenced by "/data/data/com.termux/files/usr/lib/python3.11/lib-dynload/_crypt.cpython-311.so"...

symbols brute force error

Hi.
I use of this tools and it is very nice tools but when I try to brute force by -b and use Symbols it occur a error.
I will attach error image.
Screenshot from 2023-03-01 02-58-40

Does not work

This code does not work with anything includes -d -m -x. All these unable for me to get the password for my zip file. Even I created a dictionary myself with the real password inside, it does not work.

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.