picoCTF General Skills Guide

here's how to solve Python Wrangling

Back to the General Skills Guides

Python Wrangling

Name: Python Wrangling
Description: Python scripts are invoked kind of like programs in the Terminal... Can you run this Python script using this password to get the flag?
Author: syreal
Tags: Easy, General Skills, picoCTF 2021
Challenge from: picoCTF 2021
Files: ende.py, pw.txt, flag.txt.en
Hints:
1. Get the Python script accessible in your shell by entering the following command in the Terminal prompt: $ wget https://mercury.picoctf.net/static/0bf545252b5120845e3b568b9ad0277e/ende.py
2. $ man python

Theory

According to the description, to get the flag we have to run a code that encodes and decodes Fernet, I don't know what that is, but it's like another one of those where you need a key to encrypt and decrypt it and all that stuff.

Solution

Let's run it, see how it works:

shukularuni-picoctf@webshell:~$ python ende.py
Usage: ende.py (-e/-d) [file]

I think how this will work is that we put the file we want to input with the -d option to decode the file, and then we'll use the password to decode it or something:

shukularuni-picoctf@webshell:~$ cat pw.txt
6008014f6008014f6008014f6008014f

shukularuni-picoctf@webshell:~$ python ende.py -d flag.txt.en
Please enter the password:6008014f6008014f6008014f6008014f
picoCTF{4p0110_1n_7h3_h0us3_6008014f}

There we go! That's the flag.

I rated this level as "good"! :3


https://play.picoctf.org/practice/challenge/166