Could someone help me with this task? I need some scripts that would help me to search for the type of servers a particular host is running. (One could use netcraft.com to find that out, but it would be rather time-consuming.) On the other hand, scripts which could automate this task would help me to collect the info and dump those in a file. How difficult would this task be? Do let me know... FN PS: If someone could give me cost estimate for writing the script, I'd be grateful...
On Mon, 26 Aug 2002, Frederick Noronha wrote:
Could someone help me with this task? I need some scripts that would help me to search for the type of servers a particular host is
http://httptype.sourceforge.net/
use it and submit your bug reports/feature requests.
<blatant publicity>
It does what you want, and can be used easily in a script. Accepts one host on the command line or many hosts through input file, also accepts urls, any port number, has options to display just the server type, or additional information as well (like mod_perl, php, etc.), can tell you the IP address and any aliases for the host as well. Also works through http proxies, with authentication (thanks to Binand). Has a timeout option so that you don't wait indefinitely for hosts that don't resolve.
I think this is what you want ;)
Oh, yeah, it's GNU GPL'ed and has been used for this kind of work before, at these two places:
Dennis Jenkins http://www.execpc.com/~denniswj/statewww/ Biznix http://www.biznix.org/surveys/
httptype started as a post on ilug-bom in December 1999.
</blatant publicity>
philip@konark.ncst.ernet.in (Philip S Tellis) [Monday, August 26, 2002 10:23 PM]:
Dennis Jenkins http://www.execpc.com/~denniswj/statewww/
This link is 404, fwiw
-srs
Try this command: WHATOS=gnu.org ; wget http://www.netcraft.com/whats/?host=$WHATOS ; cat ?host=$WHATOS |grep -A2 "- regular whatos text" > $WHATOS ; cat $WHATOS
Note: the above is one command. I didn't have html2text handy ... try a '; html2text' at the end. Hope this helps. Vinay Pawar Pune.
Frederick Noronha wrote:
Could someone help me with this task? I need some scripts that would help me to search for the type of servers a particular host is running. (One could use netcraft.com to find that out, but it would be rather time-consuming.) On the other hand, scripts which could automate this task would help me to collect the info and dump those in a file. How difficult would this task be? Do let me know... FN PS: If someone could give me cost estimate for writing the script, I'd be grateful...
"Fred" == Frederick Noronha fred@bytesforall.org writes:
Fred> Could someone help me with this task? I need some scripts Fred> that would help me to search for the type of servers a Fred> particular host is running. (One could use netcraft.com to Fred> find that out, but it would be rather time-consuming.) On Fred> the other hand, scripts which could automate this task would Fred> help me to collect the info and dump those in a file. How Fred> difficult would this task be? Do let me know... FN PS: If Fred> someone could give me cost estimate for writing the script, Fred> I'd be grateful...
You owe me a soda when I'm next in Goa :)
-- Raju
<snip> #!/usr/bin/perl -w # # Script to get HOST header from HTTP servers # # Raj Mathur, Tue Aug 27 07:10:14 IST 2002 # use strict ; use LWP::UserAgent ;
# Check command-line if ( $#ARGV == -1 ) { print STDERR "Nothing to do! Exiting.\n" ; exit ( 1 ) ; }
# Create a UserAgent. This needs to be done only once in the program. my $agent = new LWP::UserAgent ; $agent -> agent ( "OldMonks host header checket v1.0" ) ;
# Process each argument on the command line. foreach my $url ( @ARGV ) { # Create the request. my $request = new HTTP::Request ( HEAD => $url ) ;
# Get the user agent to handle the request and grab the response. my $response = $agent -> request ( $request ) ;
# Was the request successful? if ( !$response -> is_success () ) { print "*** $url: Error " , $response -> code () , "\n" ; next ; }
# Print out identification followed by headers. my $server = $response -> headers () -> {server} ; print "$url: $server\n" ; }
# Done exit 0 ; </snip>