Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ventz opened this issue Jul 16, 2020 · 6 comments

Comments

@ventz
Copy link

ventz commented Jul 16, 2020

> 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")
@blackdiamond1982
Copy link

Same issue here. Any solutions @ventz ?

@ventz
Copy link
Author

ventz commented Jan 9, 2021

@blackdiamond1982 the solution is above ^^

@blackdiamond1982
Copy link

@ventz did you simply change int at L622-L623..? Doing that, It doesn't give me the error message anymore, but the number of pwd attemps doesn't change. I mean... doing -m 1 -x 10 is equal to doing -m 6 -x 10..the number of possible password is the same.. Is that normal? best regards

@ventz
Copy link
Author

ventz commented Jan 10, 2021

@blackdiamond1982 It looks like the developer updated/changed the code (and thus it shifted the lines), but didn't fix this bug...

It's now lines: https://github.com/hamedA2/Zydra/blob/master/Zydra.py#L626-L627

In case it shifts again, one needs to change FROM this:

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")

TO this:

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

@ventz
Copy link
Author

ventz commented Jan 10, 2021

@hamedA2 ^ ping -- there is a bug in the input for the min/max check - it's currently parsing a type string, and doing numeric comparisons on a string.

@blackdiamond1982
Copy link

blackdiamond1982 commented Jan 10, 2021

@hamedA2 @ventz if it can help i, for me it display the correct numbers of pwd only from:
example
-m 1 -x 10 (Count of possible passwords: 853058371866181866)
-m 1 -x 3 (Count of possible passwords: 242234)

But if I made:
-m 1 -x 10 (Count of possible passwords: 853058371866181866)
-m 8 -x 10 (Count of possible passwords: 853054792520188672)

It's correct or not?

Hope it can help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants