Ulli Weichert/ März 30, 2022/ IT-Security, Write-Ups/ 0Kommentare

basic-mod1

Description

We found this weird message being passed around on the servers, we think we have a working decrpytion scheme.
Download the message here.
Take each number mod 37 and map it to the following character set: 0-25 is the alphabet (uppercase), 26-35 are the decimal digits, and 36 is an underscore.
Wrap your decrypted message in the picoCTF flag format (i.e. picoCTF{decrypted_message})

Solving this challenge

  1. This challenge is an easy one, just some math.
  2. Taking the numbers from the downloaded messages.txt and modulo them with 37
  3. In the script solve.py we do the math and get the decoded message
#!/usr/bin/env python

## Defining the variables
charset = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","_"]
flag = "picoCTF{"
encfile = "message.txt"

print("Try to decrypt file " + encfile)

## Open message.txt and doing the math
with open(encfile, 'r', encoding='utf-8') as file:
    for line in file:
        numbers = line.split()
        for number in numbers:

             # Here we add the corresponding character to the calculated number
             flag = flag + (charset[int(number)%37])

print("If anything worked... this should be the flag...")

## Adding the closing quirly braces
print(flag + "}")

Output

./solve.py
Try to decrypt file message.txt
If anything worked... this should be the flag...
picoCTF{r0und_n_r0und_ce58a3a0}

Links

All challenges we worked on - github
picoCTF

Share this Post

Über Ulli Weichert

2004 fing Ulli bei der Bundeswehr als Ausbilder und IT-Spezialist an. 2011 hat Ulli eine Umschulung zum Fachinformatiker für Systemintegration absolviert und sich auf Linux spezialisiert. 2016 hat Ulli dann bei einem mittelständischem Unternehmen, welches Kunden in ganz Deutschland betreut, als Linuxadministrator angefangen und kümmert sich seither nebst, Netzwerk, Security, Firewall, Storage überwiegend um Linuxthemen aller Art. Seit kurzem hat auch Ihn das Thema Container und k8s erwischt.

Hinterlasse einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

*
*