Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DeveloperTutorials.com:
Port Scanning and Service Status Checking in PHP
Apr 08, 2009 @ 13:49:21

On the DeveloperTutorials.com site today there's a new tutorial showing the creation of a port scanner with PHP - a tool that, given some of the familiar ports that services (like web or email servers) run on, can check to see if they're responding.

While building web applications, it's often important to keep an eye on the other services running on your server. Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

Their example makes a socket connection to the remote port to see if there's a valid hookup. The wrap this inside a loop for ports 1 through 1000 to see what ports are open and responding on your local machine (doing this on a remote machine is just asking for trouble).

Their full example defines some of the common ports in an array and loops to check on their status. It sets out a base you can build on top of with things like their suggestions - logging scan results, repoting downtime and running a service-specific task.

tagged: port scan fsockopen socket http ftp pop3 check connection

Link:

Developer Tutorials Blog:
Port Scanning and Service Status Checking in PHP
Jun 10, 2008 @ 13:46:08

The Developer Tutorials blog has posted a new tutorial covering how to scan ports and checking a remote service's status with PHP.

Having access to the current status of public servers can empower your applications to make decisions and respond to problems automatically. Acknowledging a service is offline can also save endless support emails. In this tutorial, I'll show you how to keep track of your server status by scanning ports on your server with PHP.

They show how to check a remote instance (a socket open with a timeout) and how to run through a list of ports, looping from one to one-thousand and running an fsockopen on each. They make a sample script to show these two combined - a simple page that loops through the common protocols (HTTP, FTP, SSH, etc) and checks to see if the remote machine is running something on that port.

tagged: port scan service status check fsockopen http ftp ssh

Link:

AnyExamples.com:
PHP Whois Client Function
Sep 19, 2007 @ 13:43:00

On the AnyExamples.com website, there's a new little how to on making a whois client in PHP (without just using an exec or similar call to the filesystem).

This article contains PHP implementation of whois client (as a function ae_whois), which may be used to request domain information from specified whois servers.

Their method uses the socket functionality (fsockopen, fwrite, fclose) to make a connection to the remote server for the specified domain's information.

tagged: whois client function socket fsockopen fwrite fclose whois client function socket fsockopen fwrite fclose

Link:

AnyExamples.com:
PHP Whois Client Function
Sep 19, 2007 @ 13:43:00

On the AnyExamples.com website, there's a new little how to on making a whois client in PHP (without just using an exec or similar call to the filesystem).

This article contains PHP implementation of whois client (as a function ae_whois), which may be used to request domain information from specified whois servers.

Their method uses the socket functionality (fsockopen, fwrite, fclose) to make a connection to the remote server for the specified domain's information.

tagged: whois client function socket fsockopen fwrite fclose whois client function socket fsockopen fwrite fclose

Link:


Trending Topics: