Skip to content

Instantly share code, notes, and snippets.

@0xsan-z
Last active February 11, 2021 14:40
Show Gist options
  • Save 0xsan-z/c8230ed9a577305628b60f2e18bc8230 to your computer and use it in GitHub Desktop.
Save 0xsan-z/c8230ed9a577305628b60f2e18bc8230 to your computer and use it in GitHub Desktop.
Enpass room from TryHackMe
<?php
/*https://0xsanz.medium.com/en-pass-tryhackme-4b319526b634*/
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$title = $_POST["title"];
if (!preg_match('/[a-zA-Z0-9]/i' , $title ))
{
$val = explode(",",$title);
$sum = 0;
for($i = 0 ; $i < 9; $i++)
{
if ( (strlen($val[0]) == 2) and (strlen($val[8]) == 3 ))
{
if ( $val[5] !=$val[8] and $val[3]!=$val[7] )
$sum = $sum+ (bool)$val[$i]."<br>";
}
}
if ( ($sum) == 9 )
{
echo $result;//do not worry you'll get what you need.
echo " Congo You Got It !! Nice ";
}
else
{
echo " Try Try!!";
}
}
else
{
echo " Try Again!! ";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment