PeehPee
Difficulty
Points
Description
Quick Analysis
from requests import get, post
url = 'https://blackhat4-1f84feb8cf11458ef1fb78a4cfea94f8-0.chals.bh.ctf.sa'<?php
//Show Page code source
if(isset($_GET["source"])){
highlight_file(__FILE__);
}
// Juicy PHP Part
$flag=getenv("FLAG");
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(isset($_POST["email"])&&isset($_POST["pass"])){
if($_POST["email"]==="[email protected]"){
$x=$_POST["test"];
$inp=preg_replace("/[^A-Za-z0-9$]/","",$_POST["pass"]);
if($inp==="SuperSecRetPassw0rd"){
die("Hacking Attempt detected");
}
else{
if(eval("return \$inp=\"$inp\";")==="SuperSecRetPassw0rd"){
echo $flag;
}
else{
die("Pretty Close maybe ?");
}
}
}
}
}
?>Exploitation
The Flag
Last updated