#!/usr/bin/perl # Remember that CGI programs have to close out the HTTP header # (with a pair of newlines), after giving the Content-type: # and any other relevant or available header information. # This test program always reports success (200 OK), and # correctly uses SERVER_PROTOCOL and REQUEST_METHOD to decide # whether or not to send the headers and content. # Feb 3, 2000 -- updated to support POST, and avoid passing # Malicious HTML Tags as described in CERT's CA-2000-02 advisory. $now=`date`; chomp($now); if ($ENV{"SERVER_PROTOCOL"} ne "HTTP/0.9") { print "HTTP/1.0 200 OK\r\nDate: $now\r\n"; print "Connection: close\r\n"; print "Content-type: text/html; charset=ISO-8859-1\r\n\r\n"; } exit 0 if ($ENV{"REQUEST_METHOD"} eq "HEAD"); print "
\n\n
\n"; while () { s/&/&/g; s/</g; s/>/>/g; print "$_"; } print "
\n";
if ($ENV{"QUERY_STRING"}=~/ident/ && $ENV{"REMOTE_PORT"} ne "") {
# Uses idlookup-1.2 from Peter Eriksson \n$b
\n";
}
print "\nBoa http server\n";
print "\n";
exit 0;