BaseCrack is a tool written in Python that can decode all alphanumeric base encoding schemes.

Overview

BaseCrack

Decoder For Base Encoding Schemes

version GitHub license

BaseCrack is a tool written in Python that can decode all alphanumeric base encoding schemes. This tool can accept single user input, multiple inputs from a file, input from argument, multi-encoded bases, bases in image EXIF data, bases on images with OCR and decode them incredibly fast.

For a basic demo, try the Web Interface that uses BaseCrack's API.

Fun Fact!
I initially made this after being fed up with lame CTF challenges with multi-encoded bases. Now some of them started doing that in Steganography challenges so I automated that too smh!

Table of Contents

Features

  • Decode multi-encoded bases of any pattern.
  • Decode bases in image EXIF data.
  • Decode bases on images with OCR detection.
  • Can decode multiple base encodings from a file.
  • Generate a wordlist/output with the decoded bases.
  • Predicts the type of encoding scheme.

Supported Encoding Schemes

  • Base16
  • Base32
  • Base36
  • Base58
  • Base62
  • Base64
  • Base64Url
  • Base85
  • Ascii85
  • Base91
  • Base92
  • Base100 (#14)

Installation

$ git clone https://github.com/mufeedvh/basecrack.git
$ cd basecrack
$ pip3 install -r requirements.txt
$ python3 basecrack.py -h

NOTE: Python3 is recommended to use!

Linux:

$ sudo apt-get update
$ sudo apt-get install tesseract-ocr libtesseract-dev

MacOS:

$ brew install tesseract

Windows:

OCR Detection is implemented with Tesseract and Windows requires installation of the Tesseract executable. Installing the dependencies from requirements.txt which includes pytesseract should install it. If in case it doesn't, here's how you can set it up:

  1. First check whether you have it installed or not in the Program Files/Program Files (x86) under the Tesseract-OCR directory.
  2. If there is, give that path in the config.json and you're all set! If you don't have it, install it from here and set the path in config.json.

Tesseract Docs: https://tesseract-ocr.github.io/

NOTE: I haven't completely tested this tool on Windows so if you stumble upon any issues, please open an issue.

Usage

Get a list of all the arguments:

python3 basecrack.py -h

To decode a single base encoding from user input:

python3 basecrack.py

To decode a single base encoding from argument (-b/--base):

python3 basecrack.py -b SGVsbG8gV29ybGQh

To decode multiple base encodings from a file (-f/--file):

python3 basecrack.py -f file.txt

Magic Mode: To decode multi-encoded base of any pattern (-m/--magic):

python3 basecrack.py --magic

To input an image for EXIF/OCR detection mode (-i/--image):

python3 basecrack.py -i image.jpg (--exif/--ocr)

EXIF Data: To decode bases in image EXIF data (-e/--exif):

python basecrack.py -i image.jpg --exif

OCR Base Detection: To decode bases on image with OCR detection (-c/--ocr):

python basecrack.py -i image.jpg --ocr

To generate a wordlist/output with the decoded bases (-o/--output):

python basecrack.py -f file.txt -o output-wordlist.txt

Magic Mode

Now you can decode multi-encoded bases of any pattern in a single shot.

Have you ever stumbled upon that one lame CTF challenge that gives you an encoded string which is just encoded over and over with Base64, Base91, Base85 and so on? Just give that to BaseCrack and you're done with it! ;)

Want to test it out? Just give it this input:

IX([email protected]<,*TFE]IT^zdINAb9EVbp,e
   
    <*[Nv+T8

   

and see for yourself! :)

BaseCrack API

BaseCrack can now be used as a library! Just import the BaseCrack() class and call the decode() function.

See API.

API

Want to use BaseCrack as a library? We got you covered!

Just put basecrack in your project's directory and you're ready to go!

Example:

# import the BaseCrack class from basecrack.py
from basecrack import BaseCrack

# calling the api function decode() with the encoded base
result = BaseCrack().decode('c3BhZ2hldHRp')

# printing the output
"""
result is tuple where:
result[0] = DECODED STRING
result[1] = ENCODING SCHEME
"""
print('Decoded String: {}'.format(result[0]))
print('Encoding Scheme: {}'.format(result[1]))

Output:

Decoded String: spaghetti
Encoding Scheme: Base64

Contribution

Ways to contribute

  • Suggest a feature
  • Report a bug
  • Fix something and open a pull request
  • Help me document the code
  • Spread the word

Before you open a PR, make sure everything's good by running the tests:

Unit Tests: (Thanks @FavasM)

python3 -m unittest discover -v -s tests

License

Licensed under the MIT License, see LICENSE for more information.

Liked the project?

Support the author by buying him a coffee!

Buy Me A Coffee


Comments
  • base62 decoding not working

    base62 decoding not working

    Hi,

    I think there is a bug in the base62 decoding attempt.

    Should not the line

    base62_decode = base62.encode(int(encoded_base)).decode('utf-8', 'replace')

    read something like

    base62_decode = str(base62.decode(encoded_base))

    ?

    For instance, with base-62 from pypi I get

    In [3]: base62.encode(999)
    Out[3]: 'g7'
    

    With the original basecrack.py:

    $ python3 basecrack.py -b 'g7
    [-] Encoded Base: g7
    
    [>] Decoding as Base91: 
    
    [>] Decoding as Base92: Â
    
    

    With my suggested modification:

    $ python3 basecrack.py -b 'g7
    [-] Encoded Base: g7
    
    [>] Decoding as Base62: 999
    
    [>] Decoding as Base91: 
    
    [>] Decoding as Base92: Â
    
    [-] The Encoding Scheme Is Base62
    

    Moreover, I find disagreeing results when I encode a integer with base-62 and with pybase62 (both taken from pypi).

    opened by beuguissime 4
  • Not a valid encoding

    Not a valid encoding

    hi i cannot seem to get it to work ... it keeps saying not valid encoding .

    [>] Enter Encoded Base: b6e6e5056e045a83e2828de658ccd5c1 [!] Not a valid encoding.

    opened by jepunband 4
  • 对一些有特殊字符的base编码无法解码

    对一些有特殊字符的base编码无法解码

    使用中发现,如果编码中存在特殊字符(#!@"":)时,即使是base85编码也无法解码。 比如: 1cI9M2)-sF1h8IP1bppJ1cR<H1G^jE2)-q!1h/?t1cI7%2.8@!1hJRU1bppI1h8F'1GUdG1h&:Q1G^jC1cI9L1GgsG1hJU1gr7!1h8I$1GUdD1hJRU1gr6s1cI7%2!KM1h&=&1gr7"1cI9H1GUgE2)@("2.8@#1cI9L1GgsG1h8IP1bppG1cI9L1G^mI1c$t"1gr7M1cI9L1GUdD1c[ER1gr7#1h8F#1GUdG1h&:Q2)I-F1cI9H1GgsG1hJU1gr7"1h8F#1G^jH1c[C(1bpps1cI7%2!NN1h&:R1gr7"1cI3I1GUgE2)@(#1G^jC1cI9I2)@H1c[C(2.8@"1h8I$1G^jH1c$t"1gr7M1cI:#2)@'G1h&:Q1gr7$1cR<H1GUdG1c[C(1bppK1cI7%2!KM1cI:#1bgds

    opened by tysmlq 3
  • Not detecting base32 encoded string

    Not detecting base32 encoded string

    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.

    question 
    opened by Adamkadaban 3
  • hi,I encountered

    hi,I encountered "!" when decoding base85

    If there is a "!" in the "shell" you will get this error image And to avoid this mistake is to give "!" with "", but then it will not be decoded properly image

    opened by Joackk 2
  • No module named 'colorama'

    No module named 'colorama'

    Traceback:
      File "/data/data/_(Hidden)_/files/home/basecrack/basecrack.py", line 16, in <module>
        from colorama import init
    ModuleNotFoundError: No module named 'colorama'
    
    opened by RedFurrFox 1
  • HC1:6BFOXN%TS3DHPVO13J /G-/2YRVA.Q/R85MJ2FC1J9M$DI9C6H9Y9R/-C:QU7JM:U…

    HC1:6BFOXN%TS3DHPVO13J /G-/2YRVA.Q/R85MJ2FC1J9M$DI9C6H9Y9R/-C:QU7JM:U…

    …CGPXS4MZKI CHFEC+GYHILIIX2MO.KPGGCCHAJK260O936J37A0$KLZOQL8RSCA KPLIO4KRK4WPE-L95B2%K:XF%83/Y4RT2./D0E8I2I02K-C175MA-7YF1VIOU2MLLO8G152IL48L-3N13P9IHBW1U0-3K5GGEQ1:8YBRR-S3D1PI0/7Q$M8UNAXOE4M9UL8BN9NI2FI2V:8KI1XI02PCZ.2PI0K07U/6-%CN$K QS7DS2N.SSTQHXFU I.ZJ T8UIS6$JDPIA KZU0I1-I0OC6H0/VM8OI6S99K6QJ2BMA:J0B-S-O/Y41FD$W4990O.F9KKSC96FFZ-A6LFCD9VVLA8LU8LG7K9JA639+JF0JEYI1DLNCKUCI5OI9YI:8DN:D+NDPN1.PHL01K.9I1RAGB/PD7XPH.D8EE%8WX9Q CE6VD1FD8$93NF54T5HC%/9V6H%O9H*NDVD32WS/C-DRCL21TL7Y51B7NDL7CF.N8%NE %GS20OO9Z0

    opened by jhonnydip 1
  • python basecrack.py

    python basecrack.py

    C:\python3.8\basecrack\basecrack>python basecrack.py Traceback (most recent call last): File "basecrack.py", line 18, in import base36 ModuleNotFoundError: No module named 'base36 ------------------------------------------------------------------翻译 最近一次调用(回溯):

    “文件”basecrack.py“,第18行,输入

    导入base36

    ModuleNotFoundError:没有名为“base36”的模块

    这里什么意思........没有base36的模块

    opened by N0o01 1
  • Add Dockerfile

    Add Dockerfile

    ❯ docker run --rm -it -v $(pwd):/data basecrack
    
    ██████╗  █████╗ ███████╗███████╗ ██████╗██████╗  █████╗  ██████╗██╗  ██╗
    ██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██║ ██╔╝
    ██████╔╝███████║███████╗█████╗  ██║     ██████╔╝███████║██║     █████╔╝
    ██╔══██╗██╔══██║╚════██║██╔══╝  ██║     ██╔══██╗██╔══██║██║     ██╔═██╗
    ██████╔╝██║  ██║███████║███████╗╚██████╗██║  ██║██║  ██║╚██████╗██║  ██╗
    ╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝ v3.0
    
    		python basecrack.py -h [FOR HELP]
    
    [>] Enter Encoded Base: Cn8eVZg
    
    [>] Decoding as Base58: hello
    
    [>] Decoding as Base92: `2%i
    
    [-] The Encoding Scheme Is Base58
    
    [-] The Encoding Scheme Is Base92
    
    opened by mgp25 0
  • Fix base62 error and add Ascii85

    Fix base62 error and add Ascii85

    This fixes https://github.com/mufeedvh/basecrack/issues/4#issue-700623958 by replacing base-62 with pybase62. Uninstalling the old dependency before installing the new dependency is required.

    It also adds support for Ascii85 encoding.

    opened by klassiker 0
  • not a valid encoding

    not a valid encoding

    that message i got when try decode that

    rTjf5liz8DDISJm4b0w1dQC1gi/MGnC15wG7EfsfoCdOllQQN5+hxg40T96qGK7EkL3lYKdkrABFjscchJmDQYdvjkZhHrCDJVZIJz2H40Z0p6GXwIlMmzE5x3i0FYlvVlGbIWx2YLspMD+3grY/3IbgyAN9ZYHUMeB9rBNcTh+TDw==

    opened by a-gamer 0
  • the big base.......

    the big base.......

    hi

    I have a TXT document,It's about 13mb,There are various base encrypted contents

    when i use the basecrack decode the txt,It stops halfway through the operation

    How can I send the document to you.......

    opened by kisspanda 2
Releases(v4.0)
Owner
Mufeed VH
organized chaos.
Mufeed VH
BaseCrack is a tool written in Python that can decode all alphanumeric base encoding schemes.

BaseCrack Decoder For Base Encoding Schemes BaseCrack is a tool written in Python that can decode all alphanumeric base encoding schemes. This tool ca

Mufeed VH 383 Dec 27, 2022
CowExcept - Spice up those exceptions with cowexcept!

CowExcept - Spice up those exceptions with cowexcept!

James Ansley 41 Jun 30, 2022
You can encode and decode base85, ascii85, base64, base32, and base16 with this tool.

You can encode and decode base85, ascii85, base64, base32, and base16 with this tool.

8 Dec 20, 2022
An extension to detect if the articles content match its title.

Clickbait Detector An extension to detect if the articles content match its title. This was developed in a period of 24-hours in a hackathon called 'H

Arvind Krishna 5 Jul 26, 2022
This repos is auto action which generating a wordcloud made by Twitter.

auto_tweet_wordcloud This repos is auto action which generating a wordcloud made by Twitter. Preconditions Install Python dependencies pip install -r

tubone(Yu Otsubo) 0 Apr 29, 2022
Maiden & Spell community player ranking based on tournament data.

MnSRank Maiden & Spell community player ranking based on tournament data. Why? 2021 just ended and this seemed like a cool idea. Elo doesn't work well

Jonathan Lee 1 Apr 20, 2022
ChirpText is a collection of text processing tools for Python 3.

ChirpText is a collection of text processing tools for Python 3. It is not meant to be a powerful tank like the popular NTLK but a small package which

Le Tuan Anh 5 Nov 30, 2022
Answer some questions and get your brawler csvs ready!

BRAWL-STARS-V11-BRAWLER-MAKER-TOOL Answer some questions and get your brawler csvs ready! HOW TO RUN on android: Install pydroid3 from playstore, and

9 Jan 07, 2023
Python library for creating PEG parsers

PyParsing -- A Python Parsing Module Introduction The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the t

Pyparsing 1.7k Dec 27, 2022
py-trans is a Free Python library for translate text into different languages.

Free Python library to translate text into different languages.

I'm Not A Bot #Left_TG 13 Aug 27, 2022
This is a text summarizing tool written in Python

Summarize Written by: Ling Li Ya This is a text summarizing tool written in Python. User Guide Some things to note: The application is accessible here

Marcus Lee 2 Feb 18, 2022
A program that looks through entered text and replaces certain commands with mathematical symbols

TextToSymbolConverter A program that looks through entered text and replaces certain commands with mathematical symbols Example: Syntax: Enter text in

1 Jan 02, 2022
A working (ish) python script to convert text to a gradient.

verticle-horiontal-gradient-script A working (ish) python script to convert text to a gradient. This script is poorly made with the well known python

prmze 1 Feb 20, 2022
RSS Reader application for the Emacs Application Framework.

EAF RSS Reader RSS Reader application for the Emacs Application Framework. Load application (add-to-list 'load-path "~/.emacs.d/site-lisp/eaf-rss-read

EAF 15 Dec 07, 2022
This script has been created in order to find what are the most common demanded technologies in Data Engineering field.

This is a Python script that given a whole corpus of job descriptions and a file with keywords it extracts the number of number of ocurrences of these keywords and write it to a file. This script it

Antonio Bri Pérez 0 Jul 17, 2022
Shows twitch pay for any streamer from Twitch leaked CSV files.

twitch_leak_csv_reader Shows twitch pay for any streamer from Twitch leaked CSV files. Requirements: You need python3 (you can install python 3 from o

5 Nov 11, 2022
Open-source linguistic ethnography tool for framing public opinion in mediatized groups.

Open-source linguistic ethnography tool for framing public opinion in mediatized groups. Table of Contents Installing Quickstart Links Installing Pyth

Qualichat 7 Jun 02, 2022
A python Tk GUI that creates, writes text and attaches images into a custom spreadsheet file

A python Tk GUI that creates, writes text and attaches images into a custom spreadsheet file

Mirko Simunovic 13 Dec 09, 2022
Export solved codewars kata challenges to a text file.

Codewars Kata Exporter Note:this is not totally my work.i've edited the project to make more easier and faster for me.you can find the original work h

Oussama Ben Sassi 4 Aug 13, 2021
Free & simple way to encipher text

VenSipher VenSipher is a free medium through which text can be enciphered. It can convert any text into an unrecognizable secret text that can only be

3 Jan 28, 2022