filter a string in perl

Discussion in 'Perl Misc' started by Dino, Feb 6, 2004.

  1. Dino

    Dino Guest

    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
     
    Dino, Feb 6, 2004
    #1
    1. Advertising

  2. 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
     
    Jürgen Exner, Feb 6, 2004
    #2
    1. Advertising

  3. Dino

    Matt Garrish Guest

    "Jürgen Exner" <> wrote in message
    news:n6PUb.14359$...
    > 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
     
    Matt Garrish, Feb 7, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xah Lee
    Replies:
    11
    Views:
    526
    Tad McClellan
    Jan 18, 2005
  2. zax75
    Replies:
    1
    Views:
    1,109
  3. Michael Hill

    Perl Spam Filter

    Michael Hill, Jan 26, 2004, in forum: Perl Misc
    Replies:
    6
    Views:
    260
    Alan J. Flavell
    Jan 26, 2004
  4. Andrea Spitaleri

    filter in perl

    Andrea Spitaleri, May 24, 2004, in forum: Perl Misc
    Replies:
    6
    Views:
    106
    Michele Dondi
    May 28, 2004
  5. Xah Lee

    [perl-python] 20050117, filter, map

    Xah Lee, Jan 17, 2005, in forum: Perl Misc
    Replies:
    9
    Views:
    114
    Tad McClellan
    Jan 18, 2005
Loading...

Share This Page