CTalkobt.Net




Programming Newsgroup Tips & Tricks CubeCart Stuff
Subject: Re: spammers abusing form
From: Ken Robinson
Date: Sun, 11 Sep 2005 18:48:48 GMT
Newsgroups: alt.comp.lang.php,alt.php
X-Mozilla-Status: 0011
X-Mozilla-Status2: 00000000
Path: bigbe1.bellsouth.net!bigfeed.bellsouth.net!news.bellsouth.net!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed-west.nntpserver.com!gnome.nntpserver.com.POSTED!teranews!not-for-mail
Newsgroups: alt.comp.lang.php,alt.php
References: <43240852$1@dnews.tpgi.com.au>
User-Agent: Xnews/5.04.25
Lines: 45
NNTP-Posting-Date: Sun, 11 Sep 2005 13:48:48 EST
Message-ID: <1126464528.c7aa02f46d48c6f4d73b48ea43b4a0c7@teranews>
X-Abuse-Report: http://www.usenetabuse.com
X-Abuse-Notes: Abuse reports must be submited via the usenetabuse.com portal listed above.
X-Abuse-Notes2: Reports sent via any other method will not be processed.
X-Abuse-Notes3: Any other abuse reporting headers in this article are fraudulent.
X-Orginal-Message-ID:
Xref: bigfeed.bellsouth.net alt.comp.lang.php:18980 alt.php:219753

"chris" <someone@here.com> wrote in news:43240852$1@dnews.tpgi.com.au:

I am currently having a problem with spammers
I have a form that sends the results using the PHP mail function to
send to an email address.
in the form HTML I have set the maxlength = to restrict the length of
the input thinking this would solve the problem.
but the spammers are still managing to put in something like this

These guys are not using your forms directly, they did a screen scrape 
and are trying different ways of getting your form to send spam.

Here's what I have been posting on other forums when people ask about the 
problem:

I use the following function


function checkit($name) {
     return(str_replace(array("\r", "\n", "%OA", "%oa", "%OD", "%od", 
"Content-Type:","BCC:","bcc:"), "", $name));
}


to render their attempts harmless.


I use the above function with:


$from = '"' . stripslashes(checkit($_POST['contactname'])) . '" <' . 
stripslashes(checkit($_POST['Email'])) . '>';
$to = "your@hardcoded.emailaddres.here";
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: " . stripslashes(checkit($_POST['Email'])) . "\r\n
\r\n";
@mail($to, "Subject goes here", $mail_body, $headers);


They are still trying, but they aren't succeeding to do anything 
malicious. One of the attempts even put their code in my message 
textarea, which wouldn't have done anything anyway since it was in 
the body of the mail message.

Ken