filter a string in perl

D

Dino

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

Jürgen Exner

Dino said:
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
 
M

Matt Garrish

Jürgen Exner said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top