Começando e definindo:
#! /usr/bin/perl
use IO::Socket;
if (!$ARGV[2]) { #este programa funciona com o mesmo mecanismo do de cima
print "Program intended to send mail anonymously\n";
print "Usage: perl anonsend.pl [server] [sender] [recepient]\n";
exit;
}
Supondo que meu servidor seja @hotmail.com, que eu vá enviar um email para c00l3r@hotmail.com, que o assunto seja "Trabalhando com emails" e que o programa esteja localizado em /home/dr4k3/sendanony.pl, nossa requisição ficaria assim:
cd /home/dr4k3
$ perl sendanony.pl @hotmail.com c00l3r@hotmail.com "Trabalhando com emails"
Variáveis:
#Aqui ele define as variáveis
$server = $ARGV[0];
$sender = $ARGV[1];
$recpt = $ARGV[2];
Mensagem:
print "Type message to send: ";
$message = <STDIN>; #aqui você digita sua mensagem, ela será armazenada na variável message
Abrindo conexão:
$remote = IO::Socket::INET->new( PeerAddr => "$server", Proto => "tcp", PeerPort => "25"); #aqui ele abre a conexão
Enviando:
#aqui ele usa os dados obtidos acima para enviar o email e da os "prints" do programa
print "Connecting...\n";
sleep(1);
print $remote "HELO computer\n";
sleep(1);
print "Sending E-Mail Header Information\n";
print $remote "MAIL FROM: $sender\r\n";
sleep(1);
print $remote "RCPT TO: $recpt\n";
sleep(1);
print $remote "DATA\n";
sleep(1);
print "Sending Message\n";
print $remote "$message\n";
sleep(1);
print $remote ".\n";
sleep(1);
print "Anonymous E-Mail Sent!\n";
exit; #fim do programa:
Código original:
#! /usr/bin/perl
# Program to connect to mail server
# and send mail to a specified user
# Pray to god this works
use IO::Socket; #tell perl to use IO *Input Output) Internet Socket
if (!$ARGV[2]) { #if nothign is entered, start this routine
print "Program intended to send mail anonymously\n"; #message to user
print "Usage: perl anonsend.pl [server] [sender] [recepient]\n"; #more message =)
exit; # finish this routine
} #end this routine
# Time to define some variables!
$server = $ARGV[0]; # what server to use to send the mail
$sender = $ARGV[1]; # who the e-mail is from
$recpt = $ARGV[2]; # who the e-mail is to
{ # start new routine
print"Type message to send: "; #asks user for message
$message = <STDIN>; # saves the input as string message
$remote = IO::Socket::INET->new( PeerAddr => "$server", Proto => "tcp", PeerPort => "25");
print "Connecting...\n"; # update user with status
sleep(1);# tells program to stop and wait
print $remote "HELO computer\n"; # telling mailserver hello
sleep(1);
print "Sending E-Mail Header Information\n"; # update user with status again
print $remote "MAIL FROM: $sender\r\n"; # Tells server who mail is spoofed from
sleep(1);
print $remote "RCPT TO: $recpt\n"; # Tells server who to send the email to
sleep(1);
print $remote "DATA\n"; # Tells server to start process off receiving our email message
sleep(1);
print "Sending Message\n"; # Update user of status again
print $remote "$message\n"; # Sends the string we entered earlier into the server
sleep(1);
print $remote ".\n"; # Tells SMTP server to stop receiving data, and send message
sleep(1);
print "Anonymous E-Mail Sent!\n"; # tells user program is finished
exit; # stop this subroutine
}
Agradecimentos
Web Dropz (Source)
Ninja Spy (Source)
C00L3R (pela ideia)
Bom, como foi meu primeiro artigo, espero que vocês entendam e gostem, desculpem pelos erros de português e obrigado pela oportunidade.