mufeedvh / basecrack

Decode All Bases - Base Scheme Decoder
MIT License
538 stars 91 forks source link

Not detecting base32 encoded string #10

Closed Adamkadaban closed 3 years ago

Adamkadaban commented 3 years ago

I pulled the following string from a CTF:

wvcpRLNKBz2zqpFs9UcrvLAgXjgwyquv4GbW2FXC9Y7ZW4dzkcZk9t7t3vSnjdUDUwBCVDZdj6XZ5xoTr6UXxbag1PrytSVoU5ZzCinrYsMJ7Aac8A8S7cJTmnbSs9PZHgEmRCkMir2WWYygs7SwESfbTV

decoding from base32 and then running the magic flag on it works, but doesn't with the first base32 later. base32 -d doesn't work with it either, but cyberchef does. I assume its because of some issue with the specifics of identifying a base32 string, but not sure.

mufeedvh commented 3 years ago

Hey @Adamkadaban,

I found the CTF challenge and the Base32 decoding works just fine.

You know, the tears of one's enemies works lovely in tea. Turns out, there's tons of different bases for tea. In fact, I think I heard Delphine talk about this chef website she used for her tea base combinations...

Oh! Speaking of which, GIANt wants Delphine to make him tea... all he has is the tea leaves and the cup though. Maybe you can help Delphine, since she's really busy with cooking other things?

O53GG4CSJRHEWQT2GJ5HC4CGOM4VKY3SOZGECZ2YNJTXO6LROV3DIR3CK4ZEMWCDHFMTOWSXGRSHU23DLJVTS5BXOQZXMU3ONJSFKRCVO5BEGVSELJSGUNSYLI2XQ32UOI3FKWDYMJQWOMKQOJ4XIU2WN5KTKWT2INUW44SZONGUUN2BMFRTQQJYKM3WGSSUNVXGEU3THFIFUSDHIVWVEQ3LJVUXEMSXK5MXSZ3TG5JXORKTMZRFIVQ=

This was the challenge right? And yes the first encoding is Base32

I just gave it to basecrack and it detected and decoded it correctly:

$ python3 basecrack.py -b O53GG4CSJRHEWQT2GJ5HC4CGOM4VKY3SOZGECZ2YNJTXO6LROV3DIR3CK4ZEMWCDHFMTOWSXGRSHU23DLJVTS5BXOQZXMU3ONJSFKRCVO5BEGVSELJSGUNSYLI2XQ32UOI3FKWDYMJQWOMKQOJ4XIU2WN5KTKWT2INUW44SZONGUUN2BMFRTQQJYKM3WGSSUNVXGEU3THFIFUSDHIVWVEQ3LJVUXEMSXK5MXSZ3TG5JXORKTMZRFIVQ= --magic
[-] Encoded Base: O53GG4CSJRHEWQT2GJ5HC4CGOM4VKY3SOZGECZ2YNJTXO6LROV3DIR3CK4ZEMWCDHFMTOWSXGRSHU23DLJVTS5BXOQZXMU3ONJSFKRCVO5BEGVSELJSGUNSYLI2XQ32UOI3FKWDYMJQWOMKQOJ4XIU2WN5KTKWT2INUW44SZONGUUN2BMFRTQQJYKM3WGSSUNVXGEU3THFIFUSDHIVWVEQ3LJVUXEMSXK5MXSZ3TG5JXORKTMZRFIVQ=

[-] Iteration: 1

[-] Heuristic Found Encoding To Be: Base32

[-] Decoding as Base32: wvcpRLNKBz2zqpFs9UcrvLAgXjgwyquv4GbW2FXC9Y7ZW4dzkcZk9t7t3vSnjdUDUwBCVDZdj6XZ5xoTr6UXxbag1PrytSVoU5ZzCinrYsMJ7Aac8A8S7cJTmnbSs9PZHgEmRCkMir2WWYygs7SwESfbTV
[-] Total Iterations: 5

[-] Encoding Pattern: Base32 -> Base58 -> Base62 -> Base64 -> Ascii85

[-] Magic Decode Finished With Result: rtcp{th4t5_50m3_54lty_t34_1_bl4m3_4ll_th0s3_t34rs}

[-] Finished in 0.0079 seconds

Screenshot from 2021-02-08 23-24-06 Screenshot from 2021-02-08 23-24-18

And got the flag rtcp{th4t5_50m3_54lty_t34_1_bl4m3_4ll_th0s3_t34rs}.

Can you please uninstall the dependencies, reinstall them and try again? Also were you using Python2?

Thank you! :raised_hands::heart:

Adamkadaban commented 3 years ago

Ah, I think I just didn't copy the initial string correctly. Sorry about that

mufeedvh commented 3 years ago

No worries @Adamkadaban, thank you for using the tool! :raised_hands::heart: