🏳️
Bag of Flags
  • Home
  • 2023
    • 🅿️picoCTF 2023
      • money-ware
      • repetitions
      • two-sum
      • ReadMyCert
      • rotation
      • hideme
      • PcapPoisoning
      • who is it
      • Reverse
      • timer
      • Safe Opener 2
      • findme
      • MatchTheRegex
      • SOAP
    • 🐦magpieCTF 2023
      • Space Plan
      • Space Exploration
      • So Meta
      • There is no flag
      • Momma says to play fair
      • Rubis
      • What is the password?
      • Eavesdropper
      • Shredded
      • Missing Flag
      • This outta be large enough right?
      • No Password Here
      • Chocolate Chips with Zero-G
      • Education Comes First
    • 🌴ISSessions CTF 2023
      • Basic Permissions
      • Crack Me
      • File Detective
      • Word Vomit
      • Fileception
      • Coding Time
      • Ghost File
      • CryptoTools1
      • CryptoTools2
      • 1337
      • ROT++
      • RunedMyDay
      • RSA_2
      • The Man Who Sold the World
      • VaultChallenge
      • Lost Media
      • Decontamination
      • Decade Capsule
      • Password in A Haystack
  • 2022
    • 🏁UW CTF S22
      • 0s and 1s
      • simple image
      • Helikopter
      • Meow
      • Google Form
      • Strings, literally
      • WASM
      • Audio
      • Pwn0
      • YATD
      • steg
      • Passwords
      • Vitalik
  • Practice
    • 🧠CryptoHack
      • Introduction
        • Finding Flags
        • Great Snakes
      • General
        • ASCII
        • Hex
        • Base64
        • Bytes and Big Integers
        • XOR Starter
        • XOR Properties
        • Favourite byte
        • You either know, XOR you don't
        • Greatest Common Divisor
Powered by GitBook
On this page
  • Description
  • No, Not Code :(
  • Flag
  1. 2023
  2. ISSessions CTF 2023

Coding Time

Description

This challenge will require you to code a line or two to get the flag.

No, Not Code :(

We are given a Python file passcracker.py

def main():
    password = "retroCTF{"
    passw0rd = "1br3j13dt7ro__Cp6T4F_53a5ytw4h07er5ydcg_45ck3r1v4gfc0ukqb33sr6n_lv6578axdorje2vrtso193e825"
    userInput = input("Enter the password: ")
    #DO NOT CHANGE THE CODE ABOVE THIS LINE
    
    #TODO: Write your code here
    

    #DO NOT CHANGE ANYTHING BELOW THIS LINE
    if userInput[:-1].__eq__(password):
        print("Correct password!")
    else:
        print("Wrong password!")

if __name__ == "__main__":
    main()


"""
NOTE:
1. The password is in the form of retroCTF{...}
2. You must implement code that can manipulate the string passw0rd... try to google some python functions that can help you
3. Once you figure out step 2, you must figure out a way to concatenate the string passw0rd to the string password
"""

As outlined by the NOTE, our goal is manipulate passw0rd to somehow to get the content in between the curly braces of the flag

Just from appearances, passw0rd looks too long to be the contents of the flag. It also doesn't look like a cipher or hash. The underscores seem to imply that some of these characters are the actual characters of the flag, so we can guess that we need to extract the characters for the flag

With Python, we can get every nth letter with [::n] at the end of the string. Testing some numbers, we find that we need every 3rd letter, which we can concatenate to make the flag

print(password + passw0rd[::3] + '}')

Flag

retroCTF{1337_p455w0rd_cr4ck3r_68djvs98}

PreviousFileceptionNextGhost File

Last updated 2 years ago

🌴