Skip to content

Latest commit

 

History

History
35 lines (33 loc) · 619 Bytes

challenge-37.md

File metadata and controls

35 lines (33 loc) · 619 Bytes

Challenge

<?php 
error_reporting(0); 
require_once("flag.php"); 
if(!$passwd) 
{ 
  $passwd=$_POST["passwd"]; 
} 
if(!$lockedtxt) 
{ 
  $lockedtxt=$_POST["lockedtxt"]; 
} 
function flag($var) 
{ 
  echo $var; 
} 
if($key) 
{ 
  $unlockedtxt=preg_replace($passwd,$key,$lockedtxt); 
} 
if($unlockedtxt===$flag) 
{ 
  flag("The Correct: "); 
  flag($flag); 
} 
show_source("index.php"); 
// key=flag(\\1) 
 ?>

Solution

Refference