Yo.

I've got this script:
#! /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");
Attached to this form:
<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!

In reply to Some Loser is trying to spam MY script!?! What do I do? by BubbaMonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.