sulfericacid
Programmer
Does anyone know of a different method to spoofing the IP address? This works sorta but often times when used like this a webserver will use it's own information as the sender. I need help ensuring this is spoofed, any sugestions?
Code:
#!/usr/local/bin/perl
use strict;
# time to my all the good stuff in the script
my %form;
my $sendmail;
my $disclaimer;
my $spoof;
my $website;
# Ok, time to define everything
$sendmail = '/var/qmail/bin/qmail-inject';
$spoof = ' @ ';
$website = '[URL unfurl="true"]http://secretrealmofme.hypermart.net';[/URL]
( $disclaimer = <<"EOD" ) =~ s/^\s+//gm ;
This message was sent anonymously from our server. If you received a hate mail, threats, or any other illegal mailing please goto $website and contact us.
EOD
;
use CGI;
my $query = CGI->new;
print $query->header;
%form = %{$query->Vars};
if ($form{'sendername'} eq "") {
print "<font color=red>You need to enter your name before your message will be sent</font>\n";
exit;
}
if ($form{'sendermail'} eq "") {
print "<font color=red>Please hit back and fill out your email address!</font>\n";
exit;
}
if ($form{'recipient'} eq "") {
print "<font color=red>How do you plan on sending this without someone to send to??</font>\n";
exit;
}
if ($form{'subject'} eq "") {
print "<font color=red>You need to enter a subject, please hit back to continue</font>\n";
exit;
}
if ($form{'message'} eq "") {
print "<font color=red>Hey, enter a message to send, buddy!!</font>\n";
exit;
}
open (MAIL, '|-', "$sendmail -t") or die $!;
print MAIL "To: $form{'recipient'}\n";
print MAIL "From: $spoof\n";
print MAIL "Subject: $form{'subject'}\n\n";
print MAIL "$form{'message'}\n";
print MAIL "$disclaimer\n";
close (MAIL);
###### PRINT STUFF TO BROWSER
open(HEADER, "header.html") or die ("Cannot open $!\n");
while (<HEADER>) {
print "$_";
}
close(HEADER);
print <<'EOF'
EOF
;
open(FOOTER, "footer.html") or die ("Cannot open $!\n)";
while (<FOOTER>)
print "$_";
}
close(HEADER);