DEV Community

Mudacumura Brunoblaise
Mudacumura Brunoblaise

Posted on

1 1 1 1 1

MatchTheRegex

MatchTheRegex

100 points

AUTHOR: SUNDAY JACOB NWANYIM

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

Note: This challenge launches an instance on demand.


Looking inside the script tag we can see:

<script>
    function send_request() {
        let val = document.getElementById("name").value;
        // ^p.....F!?
        fetch(`/flag?input=${val}`)
            .then(res => res.text())
            .then(res => {
                const res_json = JSON.parse(res);
                alert(res_json.flag)
                return false;
            })
        return false;
    }

</script>
Enter fullscreen mode Exit fullscreen mode

The regex is supposed to be ^p.....F!?, literally the first and only guess was picoCTF, when I entered it gave the flag:

picoCTF{your flag}

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay