0

How can I get all the different values of x where all the values are in this format

x=326F4333-54F1-4B2A-550C-FBFD3145C59F

So there is no specific sequence for the numbers or the letters. But the pattern is fixed as per the following:

  • 8 letters and numbers
  • -
  • 4 letters and numbers
  • -
  • 4 letters and numbers
  • -
  • 4 letters and numbers
  • -
  • 12letters and numbers

I am using Linux.

AdminBee
  • 21,637
  • 21
  • 47
  • 71
  • 1
    You want to generate _all_ possible permutations of this pattern? Won't that be 32³⁶= 1.532495541×10⁵⁴ strings? And you want to do this in bash? If you want to crack software, you might want to at least use a faster language. – terdon Sep 12 '21 at 10:47
  • 1
    Wouldn’t that be 36^32 instead (36 possibilities, repeated 32 times)? Or even 16^32 if it’s only hex values. Not that shell is any more appropriate... – Stephen Kitt Sep 12 '21 at 11:11
  • @StephenKitt probably. I never remember if I need to raise the length to the number of options or the number of options to the length. Either way, a pretty large job for anything, let alone the shell! – terdon Sep 12 '21 at 11:20
  • @terdon A good way to pick the right formula is to consider 2 options and the length of 1. The answer is obviously 2, so… – Kamil Maciorowski Sep 12 '21 at 11:23
  • So I was also going to ask in which way you want to "get" them? Do you want to find such find strings or lines matching the pattern from a file? Or to generate such strings? Randomly, I guess? Also, those look a lot like UUIDs, and they're usually formatted in hex, so the alphabet would be `0-9A-F`, not `0-9A-Z`. (Still 128 bits, so impossible to enumerate.) – ilkkachu Sep 12 '21 at 11:48

1 Answers1

1

In principle crunch can do this, I think.

crunch 36 36 \
  ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 \
  -t @@@@@@@@-@@@@-@@@@-@@@@-@@@@@@@@@@@@

Don't expect to get the result in reasonable time or size. E.g. the following command:

crunch 36 36 \
  ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 \
  -t @@@@@@@@-@@@@-@@@@-@@@@-@@@@@@@@@@@@ \
  -s 00000000-0000-0000-0000-000000000000 \
  -e 00000000-0000-0000-0000-100000000000

will try to generate a tiny subset of the whole set you want, still my crunch predicts it will yield 4325 PB.

Kamil Maciorowski
  • 19,242
  • 1
  • 50
  • 94
  • Nice! I tried the first command on my Arch, and it claimed it would generate 0 bytes and 0 lines for some reason. It then proceeded to spew out several gigs of data in a few seconds, all in the right format, so it seems to be working just fine. Is this just too much for its internal calculator to report? – terdon Sep 12 '21 at 11:24
  • @terdon Possibly. `crunch` 3.6 in by Debian also prints zeros and my thoughts were like yours. That's why in my answer I mentioned the prediction from the second command, but not from the first. – Kamil Maciorowski Sep 12 '21 at 11:27