fixme2.py (picoCTF 29)

Challenge Author: LT ‘SYREAL’ JONES

Category: General Skills

Difficulty: Easy

Description

Fix the syntax error in the Python script to print the flag

Process / Notes

  1. wget the script
  2. flag encoded in hex, could decode manually but there should be another way
  3. In the flag decoding function, the key is set to ’enkidu’ - but up avoce new_key it is ste to key, but key is never defined
  4. Going to try to set key = 'enkidu' below import and above the def str_xor()
  5. Realized that wasn’t necessary - tried running it in the wb-shell, and the error pointed me to the fact that the flag was flag = (flag_enc, 'enkidu') rather than == like it should have been
  6. Making the change and running it
  7. The flag is revealed

12 minutes 30 seconds to complete

Hints

  1. Are equality and assignment the same symbol?

Core Lessons

  1. Understand Python assignment vs equality syntax and when to apply each one
  2. Know how to run a Python script
  3. Understand the error messages Python gives you and what to do about them