BubbaMonk has asked for the wisdom of the Perl Monks concerning the following question:
Yo.
I've got this script:
and some loser has been hitting it repeatedly with data like:
How can I protect myself?
Thanks!
I've got this script:
Attached to this form:#! /usr/bin/perl -T use warnings; use strict; use CGI qw/:standard :cgi-lib/; my $q = CGI -> new(); my %user_data = $q -> Vars; unless (open( OUT, '>>comments.txt' )) { print $q->header( 'text/plain' ); print $q->p( "Error opening file: $!\n"); die $!; } foreach (sort keys %user_data) { print OUT substr($_, 1, 200),"\n"; print OUT "$user_data{$_}\n" } print OUT "========================================\n"; close OUT; print $q -> redirect ("http://www.kingdomadventures.org/form_thanks.ht +ml");
<form action="./cgi-bin/take_comments.cgi" method="post" name="W +riteUsForm"> Your Name:<br /><input name="1-From" type="text" size="35" /><br + /> Your E-Mail Address:<br /><input name="2-Sender's Email" type="t +ext" size="35" /><br /> Subject:<br /><input name="3-Subject" type="text" size="35" /><b +r /> Your message:<br /><textarea name="4-Message" cols="35" rows="7" +></textarea> <br> <input type="submit" value="Contact Us!" /> </form>
and some loser has been hitting it repeatedly with data like:
-From as5924@mysite.org -Sender as5924@mysite.org -Subject r Content-Type: multipart/alternative; boundary=56a225acf2431df137c24b08 +86bd3883 MIME-Version: 1.0 Subject: able bodied, two hundhred an tin pound, forty bcc: punk65@PunkAss.com This is a multi-part message in MIME format. --56a225acf2431df137c24b0886bd3883 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit of t. ames s finding themselves accidentally re assembled in --56a225acf2431df137c24b0886bd3883-- . -Message as5924@mysite.org
How can I protect myself?
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Some Loser is trying to spam MY script!?! What do I do?
by samtregar (Abbot) on May 01, 2006 at 17:47 UTC | |
Re: Some Loser is trying to spam MY script!?! What do I do?
by ruzam (Curate) on May 01, 2006 at 19:01 UTC | |
by fraktalisman (Hermit) on May 08, 2006 at 17:23 UTC | |
Re: Some Loser is trying to spam MY script!?! What do I do?
by polettix (Vicar) on May 02, 2006 at 08:40 UTC | |
Re: Some Loser is trying to spam MY script!?! What do I do?
by leocharre (Priest) on May 04, 2006 at 15:39 UTC | |
Re: Some Loser is trying to spam MY script!?! What do I do?
by bytex64 (Novice) on May 04, 2006 at 19:11 UTC |
Back to
Seekers of Perl Wisdom