Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   filter a string in perl (http://www.velocityreviews.com/forums/t885042-filter-a-string-in-perl.html)

Dino 02-06-2004 04:00 PM

filter a string in perl
 
hi guys,

need some help with a perlscript.
i have a guestbook written in perl and it gets overfilled with spam.
but the spammers always use another IP, so i can't filter with that
option.
is there a possibility to check the entries and compare them with a
string?
lets say, if in the message body there is a string like:
"hi guys, i really liked your page!blablabla...Buy Viagra..blabla"
the message will not be moved to the guestbook.
something like:
if in message-body "blabla" then exit;

thanks for any help!
Dino

Jürgen Exner 02-06-2004 04:17 PM

Re: filter a string in perl
 
Dino wrote:
> need some help with a perlscript.


Which script? I don't see any.

> i have a guestbook written in perl and it gets overfilled with spam.
> but the spammers always use another IP, so i can't filter with that
> option.
> is there a possibility to check the entries and compare them with a
> string?
> lets say, if in the message body there is a string like:
> "hi guys, i really liked your page!blablabla...Buy Viagra..blabla"
> the message will not be moved to the guestbook.
> something like:
> if in message-body "blabla" then exit;


Yes.

But why do you want to reinvent the wheel instead of using one of the many
ready-made spam filters?

jue



Matt Garrish 02-07-2004 07:03 PM

Re: filter a string in perl
 

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:n6PUb.14359$9a7.6943@nwrddc02.gnilink.net...
> Dino wrote:
> > need some help with a perlscript.

>
> Which script? I don't see any.
>


Could easily be one of the ones from nms, but any widely used script would
be open to this kind of spam (as it's rare that the people implementing them
know enough to change the names of the scripts or the parameters used in the
form).

I pointed my brother to the nms scripts for his Web site, for instance, and
it wasn't long before he came back complaining about all the spam it was
generating in his guestbook (the same Viagra postings the OP mentions). It's
easy to make a script to search around for the scripts and auto-generate a
submission. A spam filter will only work on the email copy that gets sent to
you, you still have to go in each time and remove the offending entry from
the page.

To the OP, as you didn't say what script you were using, all I can suggest
are the two steps I took to shore up the nms script: 1) add a hidden
password field and then check that it matches before processing the form
(ensures that it isn't a script submitting pre-formatted form data, and at
the same time doesn't inconvenience your users); and 2) add a list of banned
words (viagra, hgh, etc.) and check the subject and body of the post to make
sure they aren't contained therein.

Matt




All times are GMT. The time now is 05:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.