Post

Undo: picoCTF

Undo: picoCTF

General Skills

Connect using the host and port shown by the challenge, then reverse each displayed transformation in order.

Step 1: Base64 decode

Screenshot The hint identifies Base64 encoding. Decode the input with:

1
base64 -d

Screenshot

Step 2: Reverse each line

Screenshot Use rev to reverse the characters in each input line:

1
rev

Screenshot

Step 3: Replace underscores

Screenshot Replace underscores with dashes:

1
tr '_' '-'

Screenshot

Step 4: Restore braces

Screenshot Replace parentheses with curly braces:

1
tr '()' '{}'

Step 5: Apply ROT13

Screenshot ROT13 shifts each English letter 13 positions. Because the alphabet has 26 letters, applying it twice restores the original text. tr can apply the substitution:

1
tr 'A-Za-z' 'N-ZA-Mn-za-m'

Screenshot

Recovered flag:

1
picoCTF{Revers1ng_t3xt_Tr4nsf0rm@t10ns_fa04039f}

Findings

I reversed five text changes to recover the challenge flag: I decoded Base64, reversed each line, changed the dashes and braces back, then used ROT13.

What I Learned

The trick that worked for me was undoing each change in the opposite order from how it was applied. GNU coreutils can decode Base64 and replace characters with tr. I used rev to reverse each line (rev guide). The challenge is on picoCTF.

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