1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-03 10:42:03 +03:00
apache/support/phf_abuse_log.cgi
Ryan Bloom 895b7b26ac Add a hook, create_request. This hook allows modules to modify
a request while it is being created.  This hook is called for all
request_rec's, main request, sub request, and internal redirect.
When this hook is called, the the r->main, r->prev, r->next
pointers have been set, so modules can determine what kind of
request this is.

Currently, this is only used by the core module, but protocol modules
are going to need to have the ability to affect the request while it is
being read.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88532 13f79535-47bb-0310-9956-ffa450edef68
2001-03-18 02:33:23 +00:00

23 lines
780 B
Perl

#!/usr/bin/perl
# 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";