#!/usr/bin/perl ################################################################################ # # BlindMail v1.00 # # This script is among the easiest to configure. Upload it to your 'nix # server, then chmod it to 755. If you are interested, set the script's # password option to "yes" and specify a password. (I recommend you password # protect this so that you don't allow another person to find this script on # your server and start abusing it, which could put you in trouble with your # ISP and your own conscience.) Then make sure the path to sendmail is correct # for your server, and you're in business. # ##################################### faker@faketp.com # set your path to the sendmail program on your server $sendmail = "/usr/sbin/sendmail"; ############### OPTIONAL CONFIGURATION #################### # If you want to set a default address for emails, do so here. Enter addresses # using a format like "user\@inter.net" for user@inter.net. You must use "\@" # or perl will get compliation errors. # Default recipient address (e.g. "me\@inter.net") $def_to="me\@inter.net"; # Default sender address (e.g. "you\@inter.net") $def_from="you\@inter.net"; # To use simple password protection of your admin page, make $protect = "yes" $protect = "yes"; # If using simple password protection, set your password here $password = "password"; # Can this script check whether you have a stylesheet named "style.css" in this # directory and if one is not there, create it? $styler = "yes"; # If you want to specify the location of your own stylesheet, do so here: $style_loc = ""; ######################################################### # # THAT'S IT. POWERUSERS ONLY BELOW THIS POINT # ######################################################### &parse; &vars; if ($protect eq "yes") { &auth; } &head; if ($action eq 'w') {&w} elsif ($action eq 'send_message') {&send_message} elsif ($action eq 'fmake') {&fmake} else {&w} &foot; ############################## sub head { # Write the header used on each admin page print "Content-type: text/html\n\n"; print <$prog | $prog_desc \n \n \n \n \n \n
\n $prog\n

\n\n EOF } ############################## sub foot { # Write the footer used on each admin page print <
\n This fine stuff from faketp.com.\n
\n EOF exit; } ############################### sub w { print <
Mail format:
To:
From:
Subject:
    Should a copy be sent to the "from" address? Yes No
TOEOF } ############################## sub vars { # Set standard variables $prog = "BlindMail v 1.00"; $prog_desc = "A Very Unrestrictive Way of Sending E-mail | by FakeTP.com"; if ($styler eq "yes") {&fmake} if ($style_loc eq "") { $style_loc = "style.css" } $action=$formdata{'action'}; &Dates; sub Dates { # ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); $y2k = $year + 1900; @days = qw(Sunday Monday Tuesday Wednesday Thursday Friday Saturday); @months = qw(January February March April May June July August September October November December); @moXX = qw(1 2 3 4 5 6 7 8 9 10 11 12); $date = $mday; $date = "$mday $months[$mon] $y2k" || &ezerror("sub DefineVars"); } } ############################### sub auth { # see whether user is trying to submit password if ($formdata{'auth'}) { print "Set-Cookie:auth=$formdata{'auth'}\n"; print "Content-type: text/html\n\n"; print "\n"; &foot;exit; } # see whether user has a password cookie and assign its variable if ($ENV{'HTTP_COOKIE'}) { @cookies = split (/;/, $ENV{'HTTP_COOKIE'}); foreach $cookie (@cookies) { ($name, $value) = split (/=/, $cookie); $crumbs{$name} = $value; } $passedout = "$crumbs{'auth'}"; } # if there's no password cookie, ask for password unless ($passedout) { &head;&ask;&foot;exit } # if the password is wrong, ask again unless ($passedout eq $password) { &head;print "Your password is incorrect.\n";&ask;&foot;exit; } # here's the subroutine for asking for password sub ask { print < Enter your password here:*

 

* Have you already entered your password? Then refresh this page. If you're having no luck, then your browser is not storing the required cookie. EOF } } ############################### sub parse { if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); if ($ENV{'QUERY_STRING'}) { @getpairs =split(/&/, $ENV{'QUERY_STRING'}); push(@pairs,@getpairs); } } else { print "Content-type: text/html\n\n"; print "

Use Post or Get"; } foreach $pair (@pairs) { ($key, $value) = split (/=/, $pair); $key =~ tr/+/ /; $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s///g; if ($formdata{$key}) { $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } } ############################## sub send_message { $mto=$formdata{'mto'}; $mfrom=$formdata{'mfrom'}; $subject=$formdata{'subject'}; $body=$formdata{'body'}; $mail_type=$formdata{'mail_type'}; $bcc=$formdata{'bcc'}; open (MAIL,"|$sendmail -t") || &ezerror("Can't open sendmail"); if ($bcc eq "yes") { print MAIL "bcc: $mfrom\n"; } print MAIL < alert("Your message has been sent to $mto.") window.location='?' OUT } ############################## sub fmake { $fcheck = "./style.css"; $fdef = "\n \n p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} \n .copy { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; text-align:center} \n td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} \n pre { font-family: \"Courier New\", Courier, mono; font-size: 10pt} \n .subhead2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt} \n h2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold } \n code { font-family: \"Courier New\", Courier, mono; font-size: 10pt} \n th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt ; font-weight: bold} \n sup { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt} \n .bodyItalic { font-family: Verdana, Arial, Helvetica, sans-serif; font-style: italic; font-size: 10pt} \n h1 { font: bold normal 24pt Verdana, Arial, Helvetica, sans-serif} \n h3 { font: bold normal 14pt Verdana, Arial, Helvetica, sans-serif} \n h4 { font: bold normal 12pt Verdana, Arial, Helvetica, sans-serif} \n li { font: 10pt Verdana, Arial, Helvetica, sans-serif} \n ul { font: 10pt Verdana, Arial, Helvetica, sans-serif} \n .buttons { font: bold normal 9pt Verdana, Arial, Helvetica, sans-serif} \n h5 { font: bold normal 10pt Verdana, Arial, Helvetica, sans-serif} \n h6 { font: bold normal 9pt Verdana, Arial, Helvetica, sans-serif} \n body { background-color: #FFFFFF} \n a:link {color:#0000ff} \n a:visited {color: #004080} \n a:active {color:#} \n a:hover {color:#808080; text-decoration: none} \n \n "; &fmake_it; sub fmake_it { unless (-e "$fcheck") { open (FILE, ">$fcheck") || &ezerror("k65"); print FILE "$fdef" || &ezerror("ne33"); close (FILE); } } } ############################## sub ezerror { print "Content-type: text/html\n\n"; print "An error occurred: $_[0]\n"; exit; }