Local Authority (Easy)

  • Challenge Link: https://play.picoctf.org/practice/challenge/278?category=1&difficulty=1&page=1
  • Challenge Description: Can you get the flag?

Solution

The login page requires a user and a password. Using the inspect element/DevTools, we do not see anything of importance.

Front Page w/ Inspect:

inspect

Nothing important is here.

nothing

Let us type a random username and password, then use the inspect element again to see if anything changed. The login failed but as you can see there's a JavaScript file called secure.js secure.js files usually handles some form of security-related functionality, such as verifying passwords, managing sessions, or handling authentication logic. In our case, this is a function called checkPassword(username, password), which checks if a user is logged in with the correct credentials (username being "admin" and password being "strongPassword098765").

secure.js

Going back to the login page, if we use these credentials, we should get our flag.

admin
strongPassword098765

Sources