Skip to main content
  1. CTF Writeups/

Serpentine - picoGym

·132 words·1 min
picoGym General Skills Python
Miles Handelman
Author
Miles Handelman

Link to challenge

This challenge gives us a Python script and instructs us to find the flag in it. Upon execution, the script opens a prompt window with three options: print encouragement, print flag, and quit.

PythonScript

When choosing option b to print the flag, the message “Oops! I must have misplaced the print_flag function! Check my source code!” is displayed. Upon checking the source code, I found two code snippets which jumped out at me:

def print_flag():
  flag = str_xor(flag_enc, 'enkidu')
  print(flag)

and

 elif choice == 'b':
      print('\nOops! I must have misplaced the print_flag function! Check my source code!\n\n')

which meant that the print_flag() function was being unused. By replacing the print statement under chioce B with an execution of print_flag() and then running the script again, the flag is displayed: picoCTF{7h3_r04d_l355_7r4v3l3d_ae0b80bd}

SerpentineFlag

Related

Based - picoGym
·127 words·1 min
picoGym General Skills Python ChatGPT
PcapPoisoning - picoGym
·115 words·1 min
picoGym General Skills Wireshark
Eavesdrop - picoGym
·182 words·1 min
picoGym Forensics Wireshark
Matryoshka Doll - picoGym
·106 words·1 min
picoGym Forensics Steganography
St3g0 - picoGym
·73 words·1 min
picoGym Forensics Steganography
hideme - picoGym
·94 words·1 min
picoGym Forensics Steganography