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
Parse Any Text With Python

ParseAnyText A small package to parse strings. What is the work of it? Well It's a module to creates parser that helps to parse a text easily with les

Sayam Goswami 1 Jan 11, 2022
A minimal python script for generating multiple onetime use bip39 seed phrases

seed_signer_ontimes WARNING This project has mainly been used for local development, and creation should be ran on a air-gapped machine. A minimal pyt

CypherToad 4 Sep 12, 2022
a python package that lets you add custom colors and text formatting to your scripts in a very easy way!

colormate Python script text formatting package What is colormate? colormate is a python library that lets you add text formatting to your scripts, it

Rodrigo 2 Dec 14, 2022
Code Jam for creating a text-based adventure game engine and custom worlds

Text Based Adventure Jam Author: Devin McIntyre Our goal is two-fold: Create a text based adventure game engine that can parse a standard file format

HTTPChat 4 Dec 26, 2021
REST API for sentence tokenization and embedding using Multilingual Universal Sentence Encoder.

MUSE stands for Multilingual Universal Sentence Encoder - multilingual extension (supports 16 languages) of Universal Sentence Encoder (USE).

Dani El-Ayyass 47 Sep 05, 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
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
This repository contains scripts to control a RGB text fan attached to a Raspberry Pi.

RGB Text Fan Controller This repository contains scripts to control a RGB text fan attached to a Raspberry Pi. Setup The Raspberry Pi and RGB text fan

Luke Prior 1 Oct 01, 2021
The Levenshtein Python C extension module contains functions for fast computation of Levenshtein distance and string similarity

Contents Maintainer wanted Introduction Installation Documentation License History Source code Authors Maintainer wanted I am looking for a new mainta

Antti Haapala 1.2k Dec 16, 2022
The bot creates hashtags for user's texts in Russian and English.

telegram_bot_hashtags The bot creates hashtags for user's texts in Russian and English. It is a simple bot for creating hashtags. NOTE file config.py

Yana Davydovich 2 Feb 12, 2022
This project aims to test check if your RegExp are being matched by grep.

Bash RegExp This project aims to test check if your RegExp are being matched by grep. It's a local server that starts on the port 8080. It runs the se

Quatrecentquatre 1 Feb 28, 2022
Python Q&A for Network Engineers

Q & A I am often asked questions about how to solve this or that problem, and I decided to post these questions and solutions here, in case it is also

Natasha Samoylenko 30 Nov 15, 2022
A query extract python package

A query extract python package

Fayas Noushad 4 Nov 28, 2021
A simple Python module for parsing human names into their individual components

Name Parser A simple Python (3.2+ & 2.6+) module for parsing human names into their individual components. hn.title hn.first hn.middle hn.last hn.suff

Derek Gulbranson 574 Dec 20, 2022
🚩 A simple and clean python banner generator - Banners

🚩 A simple and clean python banner generator - Banners

Kumar Vicku 12 Oct 09, 2022
Find a Doc is a free online resource aimed at helping connect the foreign community in Japan with health services in their native language.

Find a Doc - Localization Find a Doc is a free online resource aimed at helping connect the foreign community in Japan with health services in their n

Our Japan Life 18 Dec 19, 2022
🍋 A Python package to process food

Pyfood is a simple Python package to process food, in different languages. Pyfood's ambition is to be the go-to library to deal with food, recipes, on

Local Seasonal 8 Apr 04, 2022
Paranoid text spacing in Python

pangu.py Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width charact

Vinta Chen 194 Nov 19, 2022
Wikipedia Reader for the GNOME Desktop

Wike Wike is a Wikipedia reader for the GNOME Desktop. Provides access to all the content of this online encyclopedia in a native application, with a

Hugo Olabera 126 Dec 24, 2022
A python tool to convert Bangla Bijoy text to Unicode text.

Unicode Converter A python tool to convert Bangla Bijoy text to Unicode text. Installation Unicode Converter can be installed via PyPi. Make sure pip

Shahad Mahmud 10 Sep 29, 2022