summaryrefslogtreecommitdiff
path: root/support/phf_abuse_log.cgi.in
diff options
context:
space:
mode:
authorKen Coar <coar@apache.org>2001-03-11 23:40:47 +0000
committerKen Coar <coar@apache.org>2001-03-11 23:40:47 +0000
commit0108291673ab89bd2765828744f12cbccf361773 (patch)
treef294f4bb369b2430883f74c45fd08b827923a42e /support/phf_abuse_log.cgi.in
parente49204885521e1b6d2b6e77ab0260e6593f72b5e (diff)
downloadhttpd-0108291673ab89bd2765828744f12cbccf361773.tar.gz
Bring the other Perl scripts into the autoconf-edited
find-the-interpreter fold, like apxs and apachectl. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88495 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/phf_abuse_log.cgi.in')
-rw-r--r--support/phf_abuse_log.cgi.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/support/phf_abuse_log.cgi.in b/support/phf_abuse_log.cgi.in
new file mode 100644
index 0000000000..723f553bac
--- /dev/null
+++ b/support/phf_abuse_log.cgi.in
@@ -0,0 +1,22 @@
+#!@perlbin@
+
+# This script is used to detect people trying to abuse the security hole which
+# existed in A CGI script direstributed with Apache 1.0.3 and earlier versions.
+# You can redirect them to here using the "<Location /cgi-bin/phf*>" suggestion
+# in httpd.conf.
+#
+# The format logged to is
+# "[date] remote_addr remote_host [date] referrer user_agent".
+
+$LOG = "/var/log/phf_log";
+
+require "ctime.pl";
+$when = &ctime(time);
+$when =~ s/\n//go;
+$ENV{HTTP_USER_AGENT} .= " via $ENV{HTTP_VIA}" if($ENV{HTTP_VIA});
+
+open(LOG, ">>$LOG") || die "boo hoo, phf_log $!";
+print LOG "[$when] $ENV{REMOTE_ADDR} $ENV{REMOTE_HOST} $ENV{$HTTP_REFERER} $ENV{HTTP_USER_AGENT}\n";
+close(LOG);
+
+print "Content-type: text/html\r\n\r\n<BLINK>Smile, you're on Candid Camera.</BLINK>\n";