Hi folks,
Despite using mod_security to try and stop the onslaught of spam being sent from contact forms, we are still getting lots of this happening. I know this threrad isnt specifically a cpanel issue but I think its relevent to the community here.
We are using this....
SecFilterSelective ARGS_VALUES "\n[[:space:]]*(to|bcc|cc)[[:space:]]*:.*@"
But this has had no effect - I have an example of a form that was manipulated to send spam below - can anyone tell me how they sent spam using it and how we could defend against this ?
PHP Code:<?
// This is the begiinning of the PHP code
#####################################################################
# #
# Contact Form Generator #
# by Robert Packer #
# rob_packer@yahoo.com #
# Don't forget to vote at hotscripts.com #
# http://www.hotscripts.com/Detailed/30983.html #
# I also subcontract larger projects #
# #
#####################################################################
$name = $_POST['name'];
$address = $_POST['address'];
$state = $_POST['state'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$fax = $_POST['fax'];
$error_msg = "";
$msg = "";
if($name){
$msg .= "Name: \t $name \n";
}
if($city){
$msg .= "City: \t $city \n";
}
if($country){
$msg .= "Country: \t $country \n";
}
if(!$email){
$error_msg .= "Your email \n";
}
if($email){
if(!eregi("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\._\-]+\.[a-zA-Z]{2,4}", $email)){
echo "\n<br>That is not a valid email address. Please <a href=\"javascript:history.back()\">return</a> to the previous page and try again.\n<br>";
exit;
}
$msg .= "Email: \t $email \n";
}
if($comments){
$msg .= "Comments: \t $comments \n";
}
$sender_email="";
if(!isset($name)){
if($name == ""){
$sender_name="Web Customer";
}
}else{
$sender_name=$name;
}
if(!isset($email)){
if($email == ""){
$sender_email="Customer@website.com";
}
}else{
$sender_email=$email;
}
if($error_msg != ""){
echo "You didn't fill in these required fields:<br>"
.nl2br($error_msg) .'<br>Please <a href="javascript:history.back()">return</a> to the previous page and try again.';
exit;
}
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders .= "From: $sender_name <$sender_email>\r\n";
$mailheaders .= "Reply-To: $sender_email <$sender_email>\r\n";
mail("admin@highlandcathedral.org","Contact Form Email from Scottish Communists",stripslashes($msg), $mailheaders);
mail("galloway_s@hotmail.com","Contact Form Email from Scottish Communists",stripslashes($msg), $mailheaders);
echo "<html>\n<head>\n<title>Thanks For Your Submission</title>\n</head>\n<body>\n<h2>Thank you for your feedback $name</h2>\n";echo '<b>This is the information you submitted</b>'."<br>\n";
echo nl2br(stripslashes($msg));
echo '<br><br><a href="/">Back to Home page</a></body></html>';
//This is the end of the PHP code
?>



LinkBack URL
About LinkBacks
Reply With Quote




