Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know of a different met

Status
Not open for further replies.

sulfericacid

Programmer
Aug 15, 2001
244
US
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 = <<&quot;EOD&quot; ) =~ 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 &quot;&quot;) {
print &quot;<font color=red>You need to enter your name before your message will be sent</font>\n&quot;;
exit;
}
if ($form{'sendermail'} eq &quot;&quot;) {
print &quot;<font color=red>Please hit back and fill out your email address!</font>\n&quot;;
exit;
}
if ($form{'recipient'} eq &quot;&quot;) {
print &quot;<font color=red>How do you plan on sending this without someone to send to??</font>\n&quot;;
exit;
}
if ($form{'subject'} eq &quot;&quot;) {
print &quot;<font color=red>You need to enter a subject, please hit back to continue</font>\n&quot;;
exit;
}
if ($form{'message'} eq &quot;&quot;) {
print &quot;<font color=red>Hey, enter a message to send, buddy!!</font>\n&quot;;
exit;
}

open (MAIL, '|-', &quot;$sendmail -t&quot;) or die $!;
	print MAIL &quot;To: $form{'recipient'}\n&quot;;
	print MAIL &quot;From: $spoof\n&quot;;
	print MAIL &quot;Subject: $form{'subject'}\n\n&quot;;
	print MAIL &quot;$form{'message'}\n&quot;;
	print MAIL &quot;$disclaimer\n&quot;;
close (MAIL);

###### PRINT STUFF TO BROWSER
open(HEADER, &quot;header.html&quot;) or die (&quot;Cannot open $!\n&quot;);
while (<HEADER>) {
print &quot;$_&quot;;
}
close(HEADER);

print <<'EOF'

EOF
;

open(FOOTER, &quot;footer.html&quot;) or die (&quot;Cannot open $!\n)&quot;;
while (<FOOTER>)
print &quot;$_&quot;;
}
close(HEADER);
 
I don't follow your script or your need to spoof the IP address. Your form obviously asks for a sendermail value but your not using it in the email form. What's the point? There's always a better way...
 
This is an anonymous emailer I designed a few months back. It does work as it does send an email and sometimes in the FROM location it says nothing, it shows up as blank, which is what I wanted. But when you view full headers it shows the server information (where the script is located) including IP.

I want it to be anonymous so the ip really needs to be spoofed. Any suggestions?

Thanks.

sulfericacid
 
Why do you want to spoof anything? Are you trying to give perl a bad name?
If you must &quot;hack&quot;, there are plenty of ready made anonymous mailer programs around. Please don't use perl for this purpose!!!
 
Please don't mind me for being blunt, peter, as you were when you were assuming i was doing this to 'hack'. It's so imature to base such assumptions like that without even having a clue on who I am or why this script will be designed, last thing perl needs is prejudice people like yourself.

This is a fun script, and i want to learn how to do it. I just make random scripts to see if I can do it, then I post them on . This wouldn't be 'hacking' anyone, sending anonymail isn't related to hacking.

sulfericacid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top