Difficulty: easy

Category: rev

Author: xnull

Description:

### XOR Password Checker

This program checks a password that has been encrypted with XOR. Download the binary and figure out what the password is.

You'll need to find the XOR key and decrypt the password.

Solution

We’ll extract the XOR key from the binary using our disassembler:

004a4040  encrypted_flag:
004a4040  07 0c 06 0e 0f 39 3a 72 30 1d 73 31 1d 30 71 34 71 30 31 73 20 2e 71 1d 21 73 32 2a 71 30 1d 24  .....9:r0.s1.0q4q01s .q.!s2*q0.$
004a4060  76 23 70 3f                                                                                      v#p?

Then, we can just brute-force it:

chepy "070c060e0f393a72301d73311d30713471303173202e711d2173322a71301d247623703f"
>>> hex_to_bytes

9:r0s10q4q01s .q!s2*q0$v#p?
>>> xor_bruteforce --crib "END"
{'42': b'ENDLM{x0r_1s_r3v3rs1bl3_c1ph3r_f4a2}'}

Flag: ENDLM{x0r_1s_r3v3rs1bl3_c1ph3r_f4a2