Security Forem

Hitanshu Gedam
Hitanshu Gedam

Posted on

picoCTF Match The Regex writeup

This is an easy web challenge.

pico challenge

This websites asks for an input from the user

input

I tried 'hello' and it alerted me with a 'wrong message' alert.

alert

Then I went to check the source code of the website by Right-click -> View Page Source, scrolled to the bottom and found the script that the website was running:

source code

We see the regex pattern ^p.....F!? in the comment.

The regex pattern ^p.....F!? matches strings that start with a lowercase "p", followed by exactly five characters of any kind, then an uppercase "F", and optionally ending with an exclamation mark.

The ^ asserts the start of the string, while the . wildcard matches any single character except newline.

The !? means that the exclamation mark at the end is optional — the string may or may not include it.

My immediate guess was trying to input picoCTF:

flag

... and that's how I got the flag to solve this challenge.

Top comments (0)