Contents

picoCTF - Reverse Engineering - patchme.py


Reverse Engineering - patchme.py - writeup

description

Can you get the flag?

Run this Python program in the same directory as this encrypted flag.

writeup

Let’s take a look at the encrypted flag…

1
2
3
4
5
cat flag.txt.enc

CR1@    UYX+
6UB
P\E

That does not help.

Let’s look at the python code…

Mh that is peculiar:

1
2
3
4
if( user_pw == "ak98" + \
                   "-=90" + \
                   "adfjhgj321" + \
                   "sleuth9000")

Let’s fire up bpython and input this code:

1
2
3
4
"ak98" + \
                   "-=90" + \
                   "adfjhgj321" + \
                   "sleuth9000"

This is the result:

1
'ak98-=90adfjhgj321sleuth9000'

Once I try to supply the aforementioned string as the password I get this output:

1
2
3
Please enter correct password for flag: ak98-=90adfjhgj321sleuth9000
Welcome back... your flag, user:
picoCTF{p47ch1ng_l1f3_h4ck_e40c120e}

so the flag is:

1
picoCTF{p47ch1ng_l1f3_h4ck_e40c120e}

This is probably not the way that was intended by the author to solve this challenge since the name of it is ‘patchme.py’. But I got the flag nevertheless.