Eevee Jail - 4

This time we are given a PHP jail. I wasn't familiar with this stuff lmaooo

<?php

echo "========================\n";
echo "=    Eevee's Jail 4    =\n";
echo "========================\n";

echo "[+] > ";
$var = trim(fgets(STDIN));

if($var == null) die("[?] Input needed to escape this prison\n");

function filter($var) {
        if(preg_match('/(`|include|read|flag|open|exec|pass|system|\$)/i', $var)) {
                return false;
        }
        return true;
}
if(filter($var)) {
        eval($var);
} else {
        echo "[!] Restricted characters has been used";
}
echo "\n";
?>

Again we have some blacklisted strings:

later on our input, $var gets passed to eval()

I found a writeup from a similar challenge:

It uses the highlight_file function that is not blacklisted. It uses glob to search for the file and highlights it

Flag: bbct{hmm.. so unpopular php function i guess?}

Last updated