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
Applying the rule duplicate not working as expected #3596
Comments
Confirmed as an issue, I can reproduce this behavior. |
@willcrozi Appears to be related to #3537, introduced at the same time but not fixed with the previous work. |
Looks good to me. Apologies for introducing this. Thanks @tabularasa007 for reporting and @Chick3nman for fixing. Tested as follows: inputs: $ cat testrule.rule
d
$ cat gen-test-words
#!/bin/bash
REPS="${1:-1}" # $1: per pwd repetition count, defaults to 1
PW_MAX=256 # hashcat pwd length limit
len=1
while true; do
for ch in {a..z}; do
pwd=$(printf "${ch}%.0s" $(seq $len))
# special case: script used as test input
if (( REPS == 1 )); then
printf "${pwd}%.0s" $(seq $REPS)
printf "\n"
else
# hashcat drops input pwds above PW_MAX length
if (( len > PW_MAX )); then exit 0; fi
if (( (len * REPS) < PW_MAX )); then
printf "${pwd}%.0s" $(seq $REPS)
printf "\n"
else
# replicate hashcat behaviour when mangled pwd is too large
printf "$pwd\n"
fi
fi
((len++))
done
done baseline:
broken:
fixed:
|
Thinking about it maybe it's a good idea to get rid of #define BUF_SZ (PW_MAX / sizeof(u32))
u32 plain_buf[BUF_SZ] = { 0 }; with just: u32 plain_buf[PW_MAX / 4] = { 0 }; It's only used once and the |
I considered going through and trying to reduce the variables but I don't think it really does anything to help clean up the code. Up to you if you think it's better. |
Fixes #3596: bug in --stdout w/ rules
I'm still experiencing an issue with duplicate (d) and --stdout. Is there a workaround? Below is how to replicate: ┌──(kali㉿kali)-[~/Desktop] ┌──(kali㉿kali)-[~/Desktop] ┌──(kali㉿kali)-[~/Desktop] ┌──(kali㉿kali)-[~/Desktop] ┌──(kali㉿kali)-[~~/Desktop] |
Hi, it seems @Chick3nman's fix above hasn't made it into a hashcat release yet. If you're running a hashcat release the workaround would be one of:
If you go with option 2 above and use v6.2.6 as baseline you'll need: 6d3cf36, c23ee33, and 0f697fd What output does |
Thank you for the follow-up and the options! My output: As for my use case and anyone in a similar situation: I went with a short python script, because I realized the "-d" wouldn't output iterative permutation for each word. [https://github.com/l3clelVl/HomeGrown/blob/main/Python/IterativelyPermutateEachWordIntoList.py]
|
Here's how to recreate the problem:
Now do:
hashcat.bin --stdout -a0 testdict.txt -r testrule.rule
The result looks rather strange:
The text was updated successfully, but these errors were encountered: