#! /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. # Unlike CGI programs running under Apache, CGI programs under Boa # should understand some simple HTTP options. The header (and the # double-newline) should not be printed if the incoming request was # in HTTP/0.9. Also, we should stop after the header if # REQUEST_METHOD == "HEAD". Under Apache, nph- programs also have # to worry about such stuff. # Feb 3, 2000 -- updated to support POST, and avoid passing # Malicious HTML Tags as described in CERT's CA-2000-02 advisory. if ($ENV{"SERVER_PROTOCOL"} ne "HTTP/0.9") { print "Content-type: text/html; charset=ISO-8859-1\r\n\r\n"; } exit 0 if ($ENV{"REQUEST_METHOD"} eq "HEAD"); print "
\n"; print "Method: $ENV{\"REQUEST_METHOD\"}\n"; print "
\n"; print "
Basic GET Form: "; print " "; print " | ";
print "Basic POST Form: "; print ""; print " | ";
print "
Sample ISINDEX form: \n"; print "$ENV{\"SCRIPT_NAME\"}?param1+param2+param3\n"; print " |
Query String: $ENV{\"QUERY_STRING\"}\n"; # arguments list print "
\nArguments:\n
\nEnvironment:\n
\n"; while () { s/&/&/g; s/</g; s/>/>/g; print "$_"; } print "
"; } print "id: ", `id`, "\n
\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;