Kasra Kasra - 4 months ago 16
Linux Question

my command is rejected in crunch tool in kali linux

I've read the man page of crunch,but I still don't know why it does not accept this input:

crunch 5 5 -t P@S$@ -l a@a@a


would you mind helping me?

this is the error that i get:

the maximum and minimum length should be the same size as the pattern you specified.

min = 5 max = 5 strlen(P@S)=3

Answer

$@ has meaning to the shell, and will be replaced with the current shell's argument list (after being string-split, glob-expanded, and combined with the first character in the IFS variable) when used unquoted. Since an interactive shell typically has no argument list, this means the $@ simply disappears. Put it in single quotes to prevent this from happening:

crunch 5 5 -t 'P@S$@' -l a@a@a

(By the way -- when using $@ intentionally, to refer to your current script or shell function's arguments, be sure to put it in double quotes to prevent the string-splitting and glob-expansion steps from taking place; thus, "$@").