🏳️
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
  • Come Out
  • Flag
  1. 2022
  2. UW CTF S22

Passwords

PreviousstegNextVitalik

Last updated 2 years ago

Description

Charlie the C programmer forgot his password that will make the program print his flag! He also accidentally deleted his original source file, and may have made a mistake writing it in the first place...

Bonus chall: figure out what the mistake Charlie made was :)

Come Out

We're giving nothing more than an executable. Let's get some information about it

So it's an executable. As expected. Let's try running it

It wants a password, as stated in the description, but we do not know it

Here, let's try running it through a debugger such as GDB with gdb ./a.out

We can see all of the functions. Let's put a breakpoint on main with b main. Then we can run the program with command run until it hits the breakpoint

The flag has to be stored somewhere, so let's try dumping out the assembler code with disas/s and get some juicy information.

What's really interesting is the call the strcmp followed by tons of putchar calls

It's likely the code here is calling strcmp to compare the user input to the password, and if the password is correct it puts, or prints out, the flag. These hex values that are being moved with mov look like ASCII characters.

This is the fun part.

We painstakingly copy each of these hex values and convert them to text.

For the curious, this is the whole concatenated hex string:

75776374667b786b6364676f6f647061737377645f343637366434373539306234383736657d

That being said, I'm not sure what the mistake Charlie made was...

Flag

uwctf{xkcdgoodpasswd_4676d47590b4876e}

🏁
a.out
GDB Command Reference - disassemble commandSysprogs
It never stops running...
info functions
Logo