Post

HackTheBox Encryption Bot Writeup

Explore the basics of cybersecurity in the Encryption Bot Challenge on Hack The Box. This easy-level Challenge introduces encryption reversal and file handling concepts in a clear and accessible way, perfect for beginners.

https://app.hackthebox.com/challenges/453

Description

My friend send me a encrypted message by using encryption bot. This is a important message. Can you decrypt the message for me?

Exploitation

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

def decode(encoded):
    chars = "RSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQabcdefghijklmnopqrstuvwxyz"
    binary = ''
    for c in encoded:
        idx = chars.index(c)
        binary += format(idx, '06b')
    flag = ''
    for i in range(0, len(binary), 8):
        chunk = binary[i:i+8]
        if len(chunk) == 8:
            flag += chr(int(chunk, 2))
    return flag

encrypted = "9W8TLp4k7t0vJW7n3VvMCpWq9WzT3C8pZ9Wz"
print(f"Encrypted: {encrypted}")
print(f"Flag: {decode(encrypted)}")

Summary

The Encryption Bot Challenge on Hack The Box is an easy-level reverse engineering puzzle that introduces custom encoding and decoding techniques. Participants are tasked with decrypting a message encoded using a custom character set and binary conversion. By writing a Python script to reverse the encoding process, the hidden flag is revealed. This challenge demonstrates how to analyze and reverse custom encryption schemes, making it ideal for beginners. It provides hands-on experience with binary manipulation and decoding, offering a practical introduction to reverse engineering and data extraction in cybersecurity.

This post is licensed under CC BY 4.0 by the author.