note 66618 added to ref.mail
| From: | JustinHolton at osu1 dot php dot net | Date: | Thu, 25 May 2006 12:05:28 +0000 |
| Subject: | note 66618 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112139@lists.php.net to get a copy of this message | ||
mfp, the block ..
<?php
$ip = (empty($_SERVER['REMOTE_ADDR'])) ? 'empty' :
$_SERVER['REMOTE_ADDR'];
$rf = (empty($_SERVER['HTTP_REFERER'])) ? 'empty' :
$_SERVER['HTTP_REFERER'];
$ua = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'empty' :
$_SERVER['HTTP_USER_AGENT'];
$ru = (empty($_SERVER['REQUEST_URI'])) ? 'empty' :
$_SERVER['REQUEST_URI'];
$rm = (empty($_SERVER['REQUEST_METHOD'])) ? 'empty' :
$_SERVER['REQUEST_METHOD'];
?>
.. must go before the block ..
<?php
# admin about this suspicios request.
if(isset($report_to) && !empty($report_to)) {
@mail(
$report_to,
"[ABUSE] [SUSPECT] @ " . $_SERVER['HTTP_HOST'] . " by "
. $ip,
"Stopped possible mail-injection @ " .
$_SERVER['HTTP_HOST'] . " by " . $ip .
" (" . date('d/m/Y H:i:s') . ")\r\n\r\n" .
"*** IP/HOST\r\n" . $ip . "\r\n\r\n" .
"*** USER AGENT\r\n" . $ua . "\r\n\r\n" .
"*** REFERER\r\n" . $rf . "\r\n\r\n" .
"*** REQUEST URI\r\n" . $ru . "\r\n\r\n" .
"*** REQUEST METHOD\r\n" . $rm . "\r\n\r\n" .
"*** SUSPECT\r\n-----\r\n" . $value . "\r\n-----"
);
} # if report
?>
.. otherwise when the report to the admin is sent $ip, $rf, $ua, $ru, and $rm will all be null
values. I discovered this problem while trying to use your code.
Cheers,
Justin
----
Server IP: 66.163.161.117
Probable Submitter: 74.129.18.42
----
X-Spam-Status: No, hits=3.8 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
UPPERCASE_25_50 autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- http://master.php.net/note/edit/66618
Del: integrated -- http://master.php.net/note/delete/66618/integrated
Del: useless -- http://master.php.net/note/delete/66618/useless
Del: bad code -- http://master.php.net/note/delete/66618/bad+code
Del: spam -- http://master.php.net/note/delete/66618/spam
Del: non-english -- http://master.php.net/note/delete/66618/non-english
Del: in docs -- http://master.php.net/note/delete/66618/in+docs
Del: other reasons-- http://master.php.net/note/delete/66618
Reject -- http://master.php.net/note/reject/66618
Search -- http://master.php.net/manage/user-notes.php