Preface PHP is a powerful Web development language. High development efficiency, simple syntax, tailored for dynamic websites, and enhanced object-oriented (moving closer to C ++ and setting up edges with JAVA). sorry for the single thread (this is a weakness of life, PHP is written in C \ C ++.
Preface
PHP is a powerful Web development language. High development efficiency, simple syntax, tailored for dynamic websites, and enhanced object-oriented (moving closer to C and setting up edges with JAVA). sorry for the single thread (this is a weakness of life, it is said that PHP is written in C \ C .), It can also use the C, C, and JAVA development middle layers to call COM. it is difficult to protect servers and has fewer faults.
Since it is tailored for dynamic websites, it is doomed not to develop a super scanner such as X-scan, but if you want to achieve some simple functions, it is more than enough.
Port scanning is our most common method of stepping on. If you download a dedicated scanner in the Internet cafe, it is more troublesome. if you use the port scan provided by the existing Web service. That really saves a lot of trouble.
Let's take a look at the source code of the PHP port scanner I wrote:
// Codz by angel
// Welcome to My Website
// Http://www.4ngel.net
$ Youip = $ HTTP_SERVER_VARS ['remote _ ADDR ']; // Obtain the local IP address
$ Remoteip = $ HTTP_POST_VARS ['remoteip']; // obtain the IP address submitted in the form
?>
Security Angel-online Port detection
If (! Empty ($ remoteip )){
// Determine the IP address pattern if the form is not empty
Function err (){
Die ('Sorry, this IP address is invalid
Click here to return ');
}
// Defines the prompt message for an incorrect IP address submission.
$ Ips = explode ('.', $ remoteip );
// Use. to separate IP addresses
If (intval ($ ips [0]) <1 or intval ($ ips [0])> 255 or intval ($ ips [3]) <1 or intval ($ ips [3]> 255) err ();
// If the number of the first and last IP segments is smaller than 1 or greater than 255, an error is returned.
If (intval ($ ips [1]) <0 or intval ($ ips [1])> 255 or intval ($ ips [2]) <0 or intval ($ ips [2]> 255) err ();
// If the number of the second and third IP addresses is less than 0 or greater than 255, an error is returned.
$ Closed = 'this port is currently closed. ';
$ Opened = 'This port is currently open! ';
$ Close = 'closed ';
$ Open = 'open ';
$ Port = array (80,110,135,137,138,139,143,443,445,143, 3389 );
$ Msg = array (
'Ftp ',
'Telnet ',
'Smtp ',
'Finger ',
'Http ',
'Pop3 ',