Intro
Welcome to the regex challenges. This is a set of basic regex challenges, designed to give you experience optimizing your hunting skills for maximum vulnerability detection across all WordPress plugins and themes.
Note that these challenges are designed for speed so we are aiming for compatability with RE2 which does not support fancy features such as look ahead or look behind.
For your first flag you must match i love regex with any number(>0) of spaces between the words
RXSS1
Write a basic pattern that looks for any use of the
echo function directly followed by a variable from the $_GET superglobal. This is a good starting point a pattern that can identify potential reflected XSS vulnerabilities.RXSS2
Using your previous answer as a starting point, modify your pattern so that looks for any use of the
echo function followed by a variable from the $_GET superglobal on the same line. This will massively increase the number of results we find as it will match more complex situations, however it will be more susceptible to false positives.RXSS3
Now modify your pattern so that it can search for any use of the
echo or print functions that outputs a variable directly from either the $_GET, $_POST, or $_REQUEST superglobals.RXSS4
Now modify your pattern so that it will also find instances where PHP shorttags (e.g.
<?= $variable; ?>) are used in place of the echo function.LFI
Shortcode attributes are often not sanitized properly, allowing for vulnerabilities such as XSS and LFI. Write a REGEX pattern that looks for instances of potential shortcode attributes that are insecurely used with include or require (and their
_once versions) that could lead to local file inclusion vulnerability (LFI). Note that shortcode attributes are often named $atts, $attrs or $attributes.