Professional Documents
Culture Documents
Linux - Crunch - D Option With Simple Aa Charset - Super User
Linux - Crunch - D Option With Simple Aa Charset - Super User
Home
crunch -d option with simple aA charset Ask Question
Questions
Asked 1 year, 4 months ago Active 1 year, 4 months ago Viewed 642 times
Tags
Users Sorry if this is simple, but I can't find any answer to what should be an easy question.
The Overflow Blog
I would expect crunch to generate strings with 3 characters while limiting the same number of lower Featured on Meta
Bycase
usingletter
our site, youaAA
to 1: acknowledge that, you
, AaA , AAa AAAhave read andmy
. However, understand our Cookie Policy, Privacy Policy, and our Terms of Service.
output is:
New Feature: Table Support
Crunch will now generate the following number of lines: 2 Swag is coming back!
aAa
AaA
I tried to set -d 1@ -d 3, to keep my upper case letters, but I get the same results. What am I
Linked
understanding wrong here?
0 Insert letter or number with crunch -t flag
Thanks a lot for your reply,
0 How to generate a Password Dictionary by
Regex?
linux bash kali-linux
Related
share improve this question follow asked Jul 29 '19 at 12:44
Léon André 16 Is there a US International keyboard layout
1
on Linux that mimics Windows' behavior?
crunch 3 3 aA -d 1@
specifies aA as "lower case characters" set. Yes, you did tell crunch that A was a "lower case
character". Now -d :
-d numbersymbol
Limits the number of duplicate characters. -d 2@ limits the lower case alphabet to output
like aab and aac . aaa would not be generated as that is 3 consecutive letters of a . The
format is number then symbol where number is the maximum number of consecutive
characters and symbol is the symbol of the the character set you want to limit i.e. @,%^
[…]
So you told crunch that any "lower case character" (from your set, i.e. a or A ) can appear at
most 1 time in a row. And indeed the output you got contains neither aa nor AA .
Sometimes it's useful to forget about "lower case characters" etc., to think in terms of "set N"
instead. The manual seems to be fixed on the premise that "lower case characters" should all be
lower case and so on. Still (at least in Ubuntu) there is a file /usr/share/crunch/charset.lst which
can be used with -f ; it defines various sets that mix the four basic sets or their fragments. This
strongly suggests any set acting as "lower case characters" (or "symbols", or …) is silently
supported.
So if you need to generate strings so the first character is a , 0 or ( and the second character is
a , 1 or ) , then this is the way to go:
Try it. Notice aa appears in the output, but it's neither " a from the first set twice", nor " a from the
second set twice". The pattern @, guarantees the first a is from the first set and the second a is
from the second set. However this distinction is not so strict when -d is involved. The command
crunch 3 3 aA a -d 1,
aAa
aAA
AaA
AAa
AAA
which is almost what you wanted. The mechanism seems to be like this:
You didn't anticipate aAa because you misinterpreted -d 1@ as "limiting the number of duplicates",
while it's "limiting the number of consecutive duplicates".
Finally note the answer is mostly based on observation rather than the documentation. In particular
the trick seems undocumented, it may be just an accidental result of how crunch works under the
hood. Future upgrades may make the tool behave differently in this matter without breaking
documented features.
add a comment
Your Answer
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Not the answer you're looking for? Browse other questions tagged linux bash kali-linux or ask your
own question.
SUPER USER COMPANY STACK EXCHANGE Blog Facebook Twitter LinkedIn Instagram
NETWORK
Tour Stack Overflow
Technology
Help For Teams
Life / Arts
Chat Advertise With Us
Culture / Recreation
Contact Hire a Developer
Science
Feedback Developer Jobs
Other
Mobile About
Disable Responsiveness Press
Legal
site design / logo © 2020 Stack Exchange Inc; user contributions licensed
Privacy Policy under cc by-sa. rev 2020.12.18.38240