[thelist] Getting information about a remote server

Garrett Coakley garrett at polytechnic.co.uk
Thu Dec 6 07:36:58 CST 2001


On Thu, 2001-12-06 at 13:22, Lauri Vain wrote:

> I'm writing a script that needs to know whether php, asp, cf, sql etc is
> installed on a remote server. How can I identify those? Is there any possibility
> at all to query information about what is installed on a remote web server? What
> does the "expose_php" line in PHP configuration file do anyway?

You can telnet to port 80 (the http port) on the web server and send a
manual GET command, which will result in the following:

[garrett at cincinnati ~]$ telnet cincinnati.home 80
Trying 10.0.0.2...
Connected to cincinnati.home.
Escape character is '^]'.
GET / HTTP/1.0  <--- type this then hit return twice

HTTP/1.1 200 OK
Date: Thu, 06 Dec 2001 13:33:27 GMT
Server: Apache/1.3.22 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.5
OpenSSL/0.9.6b DAV/1.0.2 PHP/4.0.6 mod_perl/1.24_01
[snip]


If you set 'expose_php' to off, then the PHP details won't be returned.

If you have the libwww perl library installed then you can just use the
'HEAD' command to achieve the same effect:

[garrett at cincinnati ~]$ HEAD cincinnati.home
200 OK
Connection: close
Date: Thu, 06 Dec 2001 13:36:46 GMT
Accept-Ranges: bytes
Server: Apache/1.3.22 (Unix)  (Red-Hat/Linux) mod_ssl/2.8.5
OpenSSL/0.9.6b DAV/1.0.2 PHP/4.0.6 mod_perl/1.24_01
[snip]


HTH

G.

-- 
----------------------------------------------------------------------------
WORK: http://spiked.co.uk/
PLAY: http://polytechnic.co.uk/





More information about the thelist mailing list