---
# System prepended metadata

title: theBombe Writeup (NetOn CTF)

---

# theBombe Writeup (NetOn CTF)
Category: *Steganography*
Difficulty: *Easy*

1. Resources:

The necessary resources for this challenge are:
> 1939.png
> aaa.wav


2. Writeup:

If we make use of lsb-stego.py or any other lsb steganography tool we obtain the string that was embedded into "1939.png":

> python3 lsb-stego.py decode -i 1939.png -o whatever 

In this case, "whatever" file is representing the output of lsb-stego.py execution which is a password for the following step:

>blEtchlEykraP

Making use of steghide tool we can extract all files embedded in aaa.wav like this:

> steghide extract -sf aaa.wav
> Password: blEtchlEykraP

A zip cames as a result and afer the extraction of this zip ("VE.zip") we obtain the following files:

>configurations.txt
>end_of_war.txt
>EnigmaMachine (executable)
>theBombe (executable)
>VE.jpg

After taking a look to  all different resources, we notice that "configurations.txt" contains a lot of possible configurations for the "EnigmaMachine" but only one is correct ( that means that only one configuration will be able to decrypt the encripted text contained in "end_of_war.txt" ).
That's why we have "theBombe" to help us so we find the correct one. To make this checking process automatic, we can create an easy script like the following:
```bash
#!/bin/bash

while  read -r line
do
	output=$(./theBombe $line)
	if [ $output = "Success" ]
	then 
		echo $line
	fi
done
```
This little script takes "configurations.txt" as input and checks all possible combinations in "theBombe" until finding the correct one ("Success").

>Correct combination:     III_V_II_LDYPIQZYUPMMTAGQJTLOJMD

The next step is to execute "EnigmaMachine" taking as parameters the correct configuration we just obtained and the encrypted text ("end_of_war.txt"):

>./EnigmaMachine III_V_II_LDYPIQZYUPMMTAGQJTLOJMD $(cat end_of_war.txt)

>Output: MnNFcFRlTUJlcl8xOTQ1

This previous output is a base64 encoded string so we decode it:

>echo "MnNFcFRlTUJlcl8xOTQ1" | base64 -d
Output: 2sEpTeMBer_1945

Final step is to use this output as a password to obtain the embedded file inside "VE.jpg" using outguess tool:

>outguess -r -k 2sEpTeMBer_1945 VE.jpg output.txt

This output.txt contains the flag associated to  this challenge:

```NETON{Closing_down_for_ever._all_the_best._Goodbye}```
