Local Authority (picoCTF 22)

Challenge Author: LT ‘SYREAL’ JONES

Category: Web Exploitation

Difficulty: Easy

Description

Can you get the flag? Go to this website and see what you discover.

Process / Notes

  1. Open the website
  2. Looks like a log-in screen
  3. “Only letters and numbers allowed for username and password”
  4. Viewing source –> name = unsername… name = password
  5. Trying that first, but it might be an SQL injection?
  6. ’ | 1=1
  7. Detected the “illegal character”
  8. Checked the hint
  9. Checked the source code after the failed log in, there’s an if statement saying if usernameFilterPassed && passwordFilterPassed, then it will log you in
  10. Maybe try those as the passwords to try to get it to pass that as boolean? - Didn’t work
  11. But there’s also a check of the character code as a string being compared - and if that can happen, it will say you’ve passed the filter
  12. filterPassed is equal to true initially, maybe just entering nothing? - Didn’t work
  13. There’s an adminFormHas value, hex?, try that?
  14. It might be that it needs to be at least 48 characters long? - that didn’t work either
  15. Could have to do with what the characters are coded as?
  16. The charCodeAt() method returns the Unicode of the character at a specific index in a string (UTF-16)
  17. The decimal values for 0-9 are 48-57 in unicode, like the first set
  18. The upper case Latin alphabet are 65-90
  19. The lower case are 97-122
  20. Inputting a number, up, lower for both - Didn’t work either
  21. At 32:50 looking up what to do
  22. What I was looking at was the filter for which characters are allowed
  23. There’s a ‘secure.js’ script a little higher up = that contains the username and password
  24. Entering those credentials retrieves the flag

36 minutes 25 seconds to complete

Hints

  1. How is the password checked on this website?

Core Lessons

  1. Understand embedded JavaScript in HTML, and know how to examine it as a lead for desired content