Visitor Count
Home MatchTheRegex
Post
Cancel

MatchTheRegex

MatchTheRegex

How about trying to match a regular expression The website is running here.

Solution

  1. First we access the challenge using the provided url.
  2. We then get a web page asking for a valid input with input being parsed through a text box. image
  3. Now, lets try random strings. image
  4. The next step would be checking the source code to understand how the input is parsed.
  5. Press ctrl+u to view page source.
  6. Navigate to the javascript where the logic is coded. image
  7. The code has a function send_request() which retrieves the value entered in the input field with the id “name”, it then sends it as a query parameter in a fetch request to the /flag endpoint, and displays the value of the “flag” property from the response in an alert box.
  8. As the title suggests, the input should match a particular regex to pop out the flag.
  9. Checking the code again, we get a javascript comment that shows the regex ^p.....F!? image
  10. The comment shows a regex of a string with 8 characters that starts with p and ends with F and the ! is optional.
  11. I then come up with a random string piqwerF that I use to pop out the flag. image

Eazy Peazy. Remember to stay vigilant in the digital wild west. Happy Hacking.

This post is licensed under CC BY 4.0 by the author.

SOAP

PcapPoisoning

Comments powered by Disqus.