Using Cyberchef with magic we can see that this is a exe and download it.
Seeing some of the strings output lead me to believe that it is a C# application. We could verify that with Detect It Easy but dotpeek can quickly tell us also.
DotPeek
I used dotpeek to analyze the binary but ilspy and dnspy (my favorite) work just as well
Code Block
// Decompiled with JetBrains decompiler
// Type: Program
// Assembly: Trail, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E81CB84C-9A42-4961-A935-B08895D17769
// Assembly location: C:\Users\NSSte\Downloads\download.exe
#nullable enable
internal class Program
{
private static string data = "P@I|`7kcXur2oXa4q4uz";
private static string Trail()
{
char[] chArray = new char[Program.data.Length];
for (int index = 0; index < Program.data.Length; ++index)
chArray[index] = (char) ((uint) Program.data[index] ^ 7U);
return new string(chArray);
}
private static void Main()
{
}
}
Script to undo
def decrypt(data: str) -> str:
return ''.join(chr(ord(c) ^ 7) for c in data)
encrypted_data = "P@I|`7kcXur2oXa4q4uz"
decrypted_text = decrypt(encrypted_data)
print(f"Decrypted text: {decrypted_text}")
I am thinking that the badge must be able to decode the data. So to send my badge this data I edit the NVS data on my badge to my own mqtt server. (See extra on this) Then I run the following command to dump most of memory.
We choose this memory section based on esp32 docs. (S3 mem sections from @precurse) (After further reading of docs we miss some of the upper parts but as this command works I am not going to deal with the headaches and change it)
Running strings on the binary file yields no useful results so instead I run stringsSquared (Tool I made for this see extra)
python stringsSquared.py out.bin | grep WGN{
Which outputs the flag
Decode: WGN{h1gh_n00n_sh0wd0wn}
Flag 4
The LED in the button right can randomly flash
https://youtube.com/shorts/ijG1FVzJa5s
The hardest part with this seeing how many colors there, it turns out there are only 4 Blue, Red, Green and cyan the others are just the led transitioning.
In our reading, the colors (red, blue, cyan) are “carriers” of the dot/dash information while green isn’t part of the signal at all – it is used as a separator. Moreover, when a letter is repeated three times (e.g. “RRR”, “CCC”, “BBB”) that indicates a long pulse (a “dash”), while a lone letter (e.g. “R”, “B”, “C”) is a short pulse (a “dot”). Finally, a single green “G” between pulses means “don’t break the letter” while a triple green “GGG” marks the end of a letter.
Let’s illustrate this with the data you provided. (We ignore the “///” header.)
Step 1. Separate out pulses from the green separators
The non‐green lines (the pulses) are interleaved with green lines. The single “G” lines mark a pause between pulses within one Morse–encoded letter, while a “GGG” signals that one letter is finished. (That is why sometimes you see a “GGG” on its own.)
For example, the very first part is:
RRR G R G C G R GGG
Here the pulses are: • RRR – a long red pulse (→ “dash”) • R – a short red pulse (→ “dot”) • C – a short cyan pulse (→ “dot”) • R – a short red pulse (→ “dot”)
So the first Morse symbol is: dash dot dot dot
Step 2. Interpret the dot/dash pulses as Morse code
Recall that in Morse code: • dash dot dot dot is the letter B.
Now let’s briefly go through all the groups (each group being the pulses between “GGG” separators):
Group 1: Pulses: RRR (dash), R (dot), C (dot), R (dot) Morse: –··· → B
Group 2: Pulses: B (dot), CCC (dash), B (dot), B (dot) Morse: ·–·· → L
Group 3: Pulses: B (dot), RRR (dash) Morse: ·– → A
Group 4: Pulses: RRR (dash), BBB (dash), B (dot), C (dot) Morse: ––·· → Z
Group 5: Pulses: B (dot) Morse: · → E
Group 6: Pulses: CCC (dash) Morse: – → T
Group 7: Pulses: B (dot), C (dot), C (dot), B (dot) Morse: ···· → H
Group 8: Pulses: R (dot) Morse: · → E
Group 9: Pulses: BBB (dash) Morse: – → T
Group 10: Pulses: B (dot), CCC (dash), B (dot) Morse: ·–· → R
Group 11: Pulses: B (dot), BBB (dash) Morse: ·– → A
Group 12: Pulses: B (dot), R (dot) Morse: ·· → I
Group 13: Pulses: B (dot), CCC (dash), R (dot), B (dot) Morse: ·–·· → L
Step 3. Put it all together
Reading the letters in order gives:
B L A Z E T H E T R A I L
Flag 5+
The images on the site has some interesting metadata