Skip to content

Instantly share code, notes, and snippets.

@munsiwoo
Last active February 11, 2018 07:57
Show Gist options
  • Save munsiwoo/b3f5f24110bc83ef606efc6c3c0b8db9 to your computer and use it in GitHub Desktop.
Save munsiwoo/b3f5f24110bc83ef606efc6c3c0b8db9 to your computer and use it in GitHub Desktop.
dirt-Y
<?php
error_reporting(0);
require("flag.php");
# made by munsiwoo
$x = 1337;
$e = array();
$cookies = $_COOKIE;
extract($cookies);
$elements="apple|banana|strawberry".
"melon|lemon|mango|peach|tangerine".
"grapes|coconut|orange|kiwi|ʕ•ᴥ•ʔ";
$fruits = explode("|", $elements);
shuffle($fruits);
foreach($fruits as $fruit){
$e[$x++] = $fruit;
}
if(preg_match("/([0-9]|[a-z])/i", $a)) die("ʕ•ᴥ•ʔ");
if(preg_match("/([0-9]|[a-z])/i", $b)) die("ʕ•ᴥ•ʔ");
$p = strcmp($e[strlen($elements)^strlen($x)][9],chr(103));
if(strcmp($p, (int)"ʕ•ᴥ•ʔ") == "ʕ•ᴥ•ʔ"){
if((int)($a^$b) === strlen($x)){
show_flag();
}
}
show_source(__FILE__);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment