def xlsx_In(): #stupに最安値を格納 stup = web() p = price_row e = 0 print(str(stup) + 'stupの中身です') for i in range(max_Row): print(i) print(str(stup[i])) st = sheet[price_column + str(p)].value #セルに価がなく、最安値がある if st == None and stup[i] != '': sheet[price_column + str(p)].value = stup[i] logging.info( 'sheet[price_column + str(p)].value = ({})「エクセルファイルに取得した最安値の入力に成功しました」' .format(sheet[price_column + str(p)].value)) p += 1 i += 1 #セルに価がなく、最安値がない elif st == None and stup[i] == '': logging.error( 'stup[i] = ({})「最安値を取得していないのでエクセルファイルに入力出来ません」'.format( stup[i])) e += 1 p += 1 i += 1 #セルに価があり、最安値がある elif st != None and stup[i] != '': logging.error( 'p = ({}),i = ({})「最安値は取得できましたが、エクセルファイルの最安値の列に既に値が入っているので上書きできません」' .format(p, i)) e += 1 p += 1 i += 1 #セルに価があり、最安値がない else: logging.error( 'p = ({}),i = ({})「最安値は取得できず、エクセルファイルの最安値の列に既に値が入っているので上書きできません」' .format(p, i)) e += 1 p += 1 i += 1 if e == 0: wb.save(name) print('エクセルに値を登録しました') logging.info('「最安値の入力、保存に成功しました」') sys.exit() elif e > 0: wb.save(name) print(str(i) + '件中' + str(e) + '件がエクセルファイルへの入力に失敗しました') logging.error('i = ({})件中e = ({})件がエクセルファイルへの入力に失敗しました」'.format(i, e)) sys.exit() else: logging.error('「入力予定のエクセルファイルが開かれています。閉じてから再度実行してください」'.format()) sys.exit()
def tritymain(): while True: try: main = raw_input('' + G + '' + color.BOLD + color.UNDERLINE + 'Tri>' + color.END) if main in swear: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Watch your language!" + color.END) elif main in spell: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Do you know how to spell?!" + color.END) elif main == "joke": joke() elif main == "info": info() elif main == "help": print "" + W + "+----------------------------+" print "" + C + "help " + W + "- displays this help message" print "" + C + "clear " + W + "- clears the screen" print "" + C + "exit " + W + "- exits tool" print "" + C + "tool " + W + "- displays info about the tool" print "" + C + "info " + W + "- displays computer and network info" print "" + C + "cd " + W + "- change working directories" print "" + W + "+----------------------------+" print "" + P + "speak " + W + "- text to speech" print "" + P + "ping " + W + "- ping a host" print "" + P + "banner " + W + "- print a new banner" print "" + P + "joke " + W + "- tell a joke" print "" + P + "quote " + W + "- print a quote" print "" + P + "contact " + W + "- contact me" print "" + W + "+----------------------------+" print "" + R + "website " + W + "- enter a website and get its ip" print "" + R + "clone" + W + " - clone a websites source " print "" + R + "whois" + W + " - whois a website" print "" + R + "web" + W + " - extract info from a website" print "" + R + "siteexists" + W + " - check if a site exists" print "" + R + "google" + W + " - find google results for a query" print "" + W + "+----------------------------+" print "" + G + "ip " + W + "- geolocate an ip" print "" + W + "+----------------------------+" print "" + O + "xss " + W + "- simple check for a xss vulnerability" print "" + O + "sql " + W + "- basic check for a sql vulnerability" print "" + O + "admin " + W + "- scan a website for its admin panel" print "" + W + "+----------------------------+" print "" + T + "email " + W + "- bomb an email address" print "" + T + "spoof email " + W + "- spoof an email address" print "" + T + "anonymous " + W + "- send an anonymous email" print "" + T + "sms" + W + " - spam text messages " print "" + T + "twitter" + W + " - check the details of a twitter account" print "" + W + "+----------------------------+" print color.CYAN + "craft" + W + " - generate useful scripts " print color.CYAN + "qr" + W + " - generate a qr code" print color.CYAN + "zip" + W + " - crack a password-protected zip file" print "" + W + "+----------------------------+" print color.BLUE + "encode base64" + W + " - text to base64" print color.BLUE + "decode base64" + W + " - base64 to text" print color.BLUE + "encode hex" + W + " - text to hex" print color.BLUE + "decode hex" + W + " - hex to text" print "" + W + "+----------------------------+" elif main == "sms": sms() elif main == "xss": xss() elif main == "sql": sql() elif main == "anonymous": anon() elif main == "encode base64": encode() elif main == "decode base64": decode() elif main == "email": smtp() elif main == "quote": quote() elif main == "spoof email": spoofemail() elif main == "zip": zipfile() elif main == "decode hex": decode1() elif main == "encode hex": encode1() elif main == "google": googleSearch() elif main == "web": web() elif main == "siteexists": siteexists() elif main == "qr": gen_qrcode() elif main == "twitter": twitter() elif main == "anonymous": anon() elif main == "contact": print('' + T + '' + color.UNDERLINE + 'Skype:' + W + '' + color.BOLD + ' [email protected]' + color.END) print('' + T + '' + color.UNDERLINE + 'Instagram:' + W + '' + color.BOLD + ' @_t0x1c - www.instagram.com/_t0x1c' + color.END) print('' + T + '' + color.UNDERLINE + 'Email me:' + W + '' + color.BOLD + ' [email protected]' + color.END) print('' + T + '' + color.UNDERLINE + 'XMPP:' + W + '' + color.BOLD + ' [email protected]' + color.END) print('' + T + '' + color.UNDERLINE + 'Twitter:' + W + '' + color.BOLD + ' @toxicnull' + color.END) elif main == "ping": while True: hostname = raw_input('' + T + '' + color.UNDERLINE + 'Host>' + color.END) os.system("ping " + hostname) elif main == "craft": while True: table() elif main == "whois": whoisweb() elif main == "admin": admin() elif main == "banner": os.system('clear') banner() banner1() elif main == "speak": while True: speak = raw_input('' + T + '' + color.UNDERLINE + 'What to say>' + color.END) os.system('espeak "' + speak + '"') elif main == "clone": clone() elif main == "cd": try: path = raw_input('' + T + '' + color.UNDERLINE + 'Directory>' + color.END) os.chdir(path) except OSError: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "That is not a directory!" + color.END) elif main == "tool": print(color.UNDERLINE + '' + C + 'Version: ' + (VersionNum) + color.END) print(color.UNDERLINE + '' + C + '34 options to choose from!' + color.END) print(color.UNDERLINE + '' + C + 'Time spent on it: 76 hours - 14 minutes' + color.END) print(color.UNDERLINE + '' + C + 'toxic is a sp00ky h4ck3r' + color.END) elif main == "website": while True: a = raw_input('' + T + '' + color.UNDERLINE + 'Website>' + color.END) try: print socket.gethostbyname(a) except socket.gaierror: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Apparently host is unknown! :/" + color.END) elif main == "ip": ip = raw_input('' + T + '' + color.UNDERLINE + 'IP>' + color.END) if ip is None or ip == "": sys.exit("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Please enter an IP!" + color.END) reversed_dns = socket.getfqdn(ip) geoip = urllib.urlopen( 'http://api.hackertarget.com/geoip/?q=' + ip).read().rstrip() print("" + G + "[*] " + color.UNDERLINE + "\033[91m" + "IP Info" + color.END) print geoip elif main == "clear": os.system('clear') elif main == "exit": print("" + G + "[*] " + color.UNDERLINE + "\033[91m" + "Exiting..." + color.END) print("" + G + "[*] " + color.UNDERLINE + "\033[92m" + "GoodBye!" + color.END) time.sleep(0.2) sys.exit() elif main == "": print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Please enter an option!" + color.END) else: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "That is not an option!" + color.END) except KeyboardInterrupt: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "\nCtrl-C Pressed! Use 'exit' to close the tool!" + color.END) tritymain()
def tritymain(): while True: try: main = raw_input('' + G + '' + color.BOLD + color.UNDERLINE + 'Tri>' + color.END) if main in swear: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Watch your language!" + color.END) elif main in spell: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Do you know how to spell?!" + color.END) elif main == "joke": joke() elif main == "info": info() elif main == "help": print "" + W + "+----------------------------+" print "" + C + "help " + W + "- displays this help message" print "" + C + "clear " + W + "- clears the screen" print "" + C + "exit " + W + "- exits tool" print "" + C + "tool " + W + "- displays info about the tool" print "" + C + "info " + W + "- displays computer and network info" print "" + C + "cd " + W + "- change working directories" print "" + C + "ls " + W + "- see files in working directory" print "" + W + "+----------------------------+" print "" + P + "echo " + W + "- echo given words" print "" + P + "speak " + W + "- text to speech" print "" + P + "ping " + W + "- ping a host" print "" + P + "banner " + W + "- print a new banner" print "" + P + "joke " + W + "- tell a joke" print "" + P + "quote " + W + "- print a quote" print "" + P + "contact " + W + "- contact me" print "" + W + "+----------------------------+" print "" + R + "website " + W + "- enter a website and get its ip" print "" + R + "clone" + W + " - clone a websites source " print "" + R + "whois" + W + " - whois a website" print "" + R + "web" + W + " - extract info from a website" print "" + R + "siteexists" + W + " - check if a site exists" print "" + R + "google" + W + " - find google results for a query" print "" + R + "clickjacking" + W + " - test websites for clickjacking vulnerability" print "" + W + "+----------------------------+" print "" + G + "ip " + W + "- geolocate an ip" print "" + W + "+----------------------------+" print "" + O + "spoof mac" + W + " - spoof mac address" print "" + W + "+----------------------------+" print "" + T + "email " + W + "- bomb an email address" print "" + T + "spoof email " + W + "- spoof an email address" print "" + T + "sms" + W + " - spam text messages " print "" + T + "crack" + W + " - bruteforce an email" print "" + T + "anonymous" + W + " - send an anonymous email" print "" + T + "facebook" + W + " - bruteforce a facebook account" print "" + T + "twitter" + W + " - check the details of a twitter account" print "" + W + "+----------------------------+" print color.CYAN + "craft" + W + " - generate useful scripts " print color.CYAN + "qr" + W + " - generate a qr code" print color.CYAN + "zip" + W + " - crack a password-protected zip file" print "" + W + "+----------------------------+" print color.BLUE + "encode base64" + W + " - text to base64" print color.BLUE + "decode base64" + W + " - base64 to text" print color.BLUE + "encode hex" + W + " - text to hex" print color.BLUE + "decode hex" + W + " - hex to text" print "" + W + "+----------------------------+" elif main == "spoof mac": print "" + C + "1 - Random MAC address" print "" + C + "2 - Set MAC address" print "" + C + "3 - See available addresses" while True: spoofmac = raw_input('' + G + '' + color.UNDERLINE + 'Tri>Spoof>' + color.END) if spoofmac == "1": try: inter = raw_input('' + T + '' + color.UNDERLINE + 'Interface>' + color.END) os.system('spoof-mac.py randomize ' + inter) print "" + G + "[*] Done! " + C + "To change you MAC Address back to your original, restart your computer\n or set your MAC address to your original" except: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Oops.... Something went wrong!" + color.END) elif spoofmac == "2": try: inter = raw_input('' + T + '' + color.UNDERLINE + 'Interface>' + color.END) setmac = raw_input('' + T + '' + color.UNDERLINE + 'New MAC>' + color.END) os.system('spoof-mac.py set ' + setmac + ' ' + inter) print "" + C + "Keep in mind you won't have internet during the time of your spoofed MAC!" print "" + G + "[*] Done!" + C + " To change you MAC Address back to your original, restart your computer\n or set your MAC address to your original" except: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Oops... Something went wrong!" + color.END) elif spoofmac == "3": os.system('spoof-mac.py list') else: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "That is not an option!" + color.END) elif main == "sms": sms() elif main == "encode base64": encode() elif main == "decode base64": decode() elif main == "email": smtp() elif main == "quote": quote() elif main == "spoof email": spoofemail() elif main == "zip": zipfile() elif main == "decode hex": decode1() elif main == "encode hex": encode1() elif main == "google": googleSearch() elif main == "web": web() elif main == "clickjacking": clickjacking() elif main == "siteexists": siteexists() elif main == "qr": gen_qrcode() elif main == "twitter": twitter() elif main == "crack": gmail() elif main == "anonymous": anon() elif main == "contact": print('' + T + '' + color.UNDERLINE + 'Skype:' + W + '' + color.BOLD + ' infamouzgaming' + color.END) print('' + T + '' + color.UNDERLINE + 'Instagram:' + W + '' + color.BOLD + ' @_t0x1c - www.instagram.com/_t0x1c' + color.END) print('' + T + '' + color.UNDERLINE + 'Email me:' + W + '' + color.BOLD + ' [email protected]' + color.END) print('' + T + '' + color.UNDERLINE + 'XMPP:' + W + '' + color.BOLD + ' [email protected]' + color.END) elif main == "ping": while True: hostname = raw_input('' + T + '' + color.UNDERLINE + 'Host>' + color.END) os.system("ping " + hostname) elif main == "craft": while True: table() elif main == "facebook": facebook() elif main == "whois": whoisweb() elif main == "admin": admin() elif main == "banner": os.system('clear') banner() banner1() elif main == "speak": while True: speak = raw_input('' + T + '' + color.UNDERLINE + 'What to say>' + color.END) os.system('espeak "' + speak + '"') elif main == "echo": while True: echo = raw_input('' + T + '' + color.UNDERLINE + 'What to echo>' + color.END) os.system('echo ' + echo) elif main == "clone": clone() elif main == "cd": try: path = raw_input('' + T + '' + color.UNDERLINE + 'Directory>' + color.END) os.chdir(path) except OSError: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "That is not a directory!" + color.END) elif main == "ls": os.system('ls') elif main == "tool": print(color.UNDERLINE + '' + C + 'Version: 3.0.1' + color.END) print(color.UNDERLINE + '' + C + 'Time spent on it: 74 hours - 21 minutes' + color.END) print(color.UNDERLINE + '' + C + 'toxic is a sp00ky h4ck3r' + color.END) elif main == "website": while True: a = raw_input('' + T + '' + color.UNDERLINE + 'Website>' + color.END) try: print socket.gethostbyname(a) except socket.gaierror: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Apparently host is unknown! :/" + color.END) elif main == "ip": ip = raw_input('' + T + '' + color.UNDERLINE + 'IP>' + color.END) if ip is None or ip == "": sys.exit("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Please enter an IP!" + color.END) reversed_dns = socket.getfqdn(ip) geoip = urllib.urlopen( 'http://api.hackertarget.com/geoip/?q=' + ip).read().rstrip() print("" + G + "[*] " + color.UNDERLINE + "\033[91m" + "IP Info" + color.END) print geoip elif main == "clear": os.system('clear') elif main == "exit": print("" + G + "[*] " + color.UNDERLINE + "\033[91m" + "Exiting..." + color.END) print("" + G + "[*] " + color.UNDERLINE + "\033[92m" + "GoodBye!" + color.END) time.sleep(0.2) sys.exit() elif main == "": print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "Please enter an option!" + color.END) else: print("" + R + "[!] " + color.UNDERLINE + "\033[91m" + "That is not an option!" + color.END) except KeyboardInterrupt: print "\n" tritymain()
print("Essas são as Opções disponíveis: ") lin() print("Criar Evento diga (Criar)") lin() print("Consultar compromissos diga (consulta)") lin() print("Sugestão de Filmes diga (filme)") lin() print("Finalizar diga (Sair)") lin() text = reconhecimento().lower() print(text.lower().capitalize()) if text == 'sair': sair = True elif text == 'criar': criar(SERVICE) elif text == 'filme': web() elif text == 'consulta': print("Qual data deseja consultar ?") text = reconhecimento().lower() SERVICE = autenticacao_google() print(text) lin() eventos(day(text), SERVICE) lin() elif inicio == 'sair': sair = True print("Fechando o Sistema") else: print("Comando não reconhecido")
def tritymain(): while True: try: main = raw_input(''+G+'' + color.BOLD + color.UNDERLINE + 'Tri>' + color.END) if main in swear: print(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Watch your language!" + color.END) elif main in spell: print(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Do you know how to spell?!" + color.END) elif main == "joke": joke() elif main == "info": info() elif main == "help": print ""+W+"+----------------------------+" print ""+C+"help "+W+"- displays this help message" print ""+C+"clear "+W+"- clears the screen" print ""+C+"exit "+W+"- exits tool" print ""+C+"tool "+W+"- displays info about the tool" print ""+C+"info "+W+"- displays computer and network info" print ""+C+"cd "+W+"- change working directories" print ""+C+"ls "+W+"- see files in working directory" print ""+W+"+----------------------------+" print ""+P+"speak "+W+"- text to speech" print ""+P+"ping "+W+"- ping a host" print ""+P+"banner "+W+"- print a new banner" print ""+P+"joke "+W+"- tell a joke" print ""+P+"quote "+W+"- print a quote" print ""+P+"contact "+W+"- contact me" print ""+W+"+----------------------------+" print ""+R+"website "+W+"- enter a website and get its ip" print ""+R+"clone"+W+" - clone a websites source " print ""+R+"whois"+W+" - whois a website" print ""+R+"web"+W+" - extract info from a website" print ""+R+"siteexists"+W+" - check if a site exists" print ""+R+"google"+W+" - find google results for a query" print ""+R+"clickjacking"+W+" - test websites for clickjacking vulnerability" print ""+W+"+----------------------------+" print ""+G+"ip "+W+"- geolocate an ip" print ""+W+"+----------------------------+" print ""+T+"email "+W+"- bomb an email address" print ""+T+"spoof email "+W+"- spoof an email address" print ""+T+"sms"+W+" - spam text messages " print ""+T+"crack"+W+" - bruteforce an email" print ""+T+"anonymous"+W+" - send an anonymous email" print ""+T+"facebook"+W+" - bruteforce a facebook account" print ""+T+"twitter"+W+" - check the details of a twitter account" print ""+W+"+----------------------------+" print color.CYAN + "craft"+W+" - generate useful scripts " print color.CYAN + "qr"+W+" - generate a qr code" print color.CYAN + "zip"+W+" - crack a password-protected zip file" print ""+W+"+----------------------------+" print color.BLUE + "encode base64"+W+" - text to base64" print color.BLUE + "decode base64"+W+" - base64 to text" print color.BLUE + "encode hex"+W+" - text to hex" print color.BLUE + "decode hex"+W+" - hex to text" print ""+W+"+----------------------------+" elif main == "sms": sms() elif main == "encode base64": encode() elif main == "decode base64": decode() elif main == "email": smtp() elif main == "quote": quote() elif main == "spoof email": os.system("python emaill.py") elif main == "zip": zipfile() elif main == "decode hex": decode1() elif main == "encode hex": encode1() elif main == "google": googleSearch() elif main == "web": web() elif main == "clickjacking": clickjacking() elif main == "siteexists": siteexists() elif main == "qr": gen_qrcode() elif main == "twitter": twitter() elif main == "crack": gmail() elif main == "anonymous": anon() elif main == "contact": print(''+T+'' + color.UNDERLINE + 'Facebook:'+W+'' + color.BOLD + ' https://www.facebook.com/Cyber.S3C.Professional' + color.END) print(''+T+'' + color.UNDERLINE + 'GitHub:'+W+'' + color.BOLD + ' https://CybernetiX-S3C.github.io/' + color.END) elif main == "ping": while True: hostname = raw_input(''+T+'' + color.UNDERLINE + 'Host>' + color.END) os.system("ping " + hostname) elif main == "craft": while True: table() elif main == "facebook": facebook() elif main == "whois": whoisweb() elif main == "admin": admin() elif main == "banner": os.system('clear') banner() banner1() elif main == "speak": while True: speak = raw_input(''+T+'' + color.UNDERLINE + 'What to say>' + color.END) os.system('espeak "' + speak + '"') elif main == "echo": while True: echo = raw_input(''+T+'' + color.UNDERLINE + 'What to echo>' + color.END) os.system('echo ' + echo) elif main == "clone": clone() elif main == "cd": try: path = raw_input(''+T+'' + color.UNDERLINE + 'Directory>' + color.END) os.chdir(path) except OSError: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "That is not a directory!" + color.END) elif main == "ls": os.system('ls') elif main == "tool": print(color.UNDERLINE + ''+C+'Version: 4.2.1' + color.END) print(color.UNDERLINE + ''+C+'Time spent on it: 98 hours - 54 minutes' + color.END) print(color.UNDERLINE + ''+C+'John Modica @ CybernetiX S3C' + color.END) elif main == "website": while True: a = raw_input(''+T+'' + color.UNDERLINE + 'Website>' + color.END) try: print socket.gethostbyname(a) except socket.gaierror: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Apparently host is unknown! :/" + color.END) elif main == "ip": ip = raw_input(''+T+'' + color.UNDERLINE + 'IP>' + color.END) if ip is None or ip == "": sys.exit(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Please enter an IP!" + color.END) reversed_dns = socket.getfqdn(ip) geoip = urllib.urlopen('api.hackertarget.com/geoip/?q=' + ip).read().rstrip() print (""+G+"[*] " + color.UNDERLINE + "\033[91m" + "IP Info" + color.END) print geoip elif main == "clear": os.system('clear') elif main == "exit": print (""+G+"[*] " + color.UNDERLINE + "\033[91m" + "Exiting..." + color.END) print (""+G+"[*] " + color.UNDERLINE + "\033[92m" + "GoodBye!" + color.END) time.sleep(0.2) sys.exit() elif main == "": print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Please enter an option!" + color.END) else: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "That is not an option!" + color.END) except KeyboardInterrupt: print "\n" tritymain()
if b_ret == True and Web_filter.check_max_count_web_each_domain != None: b_ret = count_web_each_domain < Web_filter.check_max_count_web_each_domain if b_ret == True and Web_filter.start_time != None and Web_filter.finish_time != None: b_ret = (web_x.get_date_obj() > Web_filter.start_time and web_x.get_date_obj() < Web_filter.finish_time) except Exception, e: print("[Exception - check filter]" + str(e)) b_ret = False return b_ret # set_last_time = staticmethod(set_last_time) # set_max_count_web_each_sublabel = staticmethod(set_max_count_web_each_sublabel) # set_max_count_web_each_domain = staticmethod(set_max_count_web_each_domain) # remove_all_check = staticmethod(remove_all_check) # check = staticmethod(check) # # # # # # if __name__ == '__main__': Web_filter.set_max_count_web_each_domain(100) hy = web("", "", "", "", "", "") print hy.get_json() print Web_filter.check(hy)
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Basándonos en lo aprendido en los puntos anteriores, añadamos a nuestra web (de la práctica 3) algún cuadro en donde se muestren los últimos feeds de alguna fuente web que nos interese (periódico o web). Sería conveniente, por no abusar del proveedor del RSS, no consultarlo con demasiada frecuencia (por ejemplo como máximo cada 10 minutos). Para ello podemos hacer algún tipo de caché en nuestra base de datos (o en disco) de los RSS que vayamos a mostrar. ''' import web from web import form from web.contrib.template import render_mako import time import DataBase import urllib import feedparser import datetime urls = ( '/web1','web1', '/web2','web2', '/web3','web3', '/web4','web4', '/salir','logout', '/modificar','modificar', '/', 'index' )
def get_list_web(self, max_len=1000000): list_web = [] # ds cac doi tuong web tra ve try: labels = self.get_titles() # ds title cua 1 trang bao # Chia deu so bai viet (max_len) cho cac chu de co so luong ~ nhau count_title = labels.__len__( ) # dung de tinh ti le gioi han sl bai count_max_web = 0 # gia tri so web toi da cho title hien tai i_current_title = 0 # chi so cua title hien tai b_next_title = False for sub_label in labels: # cai dat cac bien gioi han so luong bai viet b_next_title = False i_current_title += 1 count_max_web = (i_current_title * 1.0 / count_title) * max_len print(list_web.__len__(), '/', count_max_web) # lay thong tin bai viet url_title = 'http://' + self.current_domain + '/' + sub_label print('[Crawling] ' + url_title) # lay danh sach bai viet moi tren trang nhat content = get_content(url_title) if content is None: return list_web soup = BeautifulSoup(content, 'html.parser') if self.current_domain == "dantri.com.vn": #Lay cac the bai biet div_tags = [] div_tags.extend( soup.find_all("div", {'data-boxtype': 'zonenewsposition'})) div_tags.extend( soup.find_all("div", {'data-boxtype': 'timelineposition'})) # Lay tin bai dac biet for div_tag in div_tags: try: #Kiem tra thong tin a_tag = div_tag.a if ((not a_tag.has_attr('title')) or (not a_tag.has_attr('href')) or (a_tag.img == None)): continue if not a_tag.img.has_attr('src'): continue #Lay thong tin title = a_tag["title"] url1 = "http://" + self.current_domain + a_tag[ "href"] image_url = a_tag.img["src"] content_paper = get_content_paper(url1) # tai va boc tach noi dung bai viet except Exception, e: print '[Exception - get info in item rss] ' + url1 print '[Exception - get info in item rss] ' + str( e) continue # Kiem tra gioi han so luong web if list_web.__len__() > count_max_web: b_next_title = True break #Tao doi tuong if (content_paper['content_text'] != None and content_paper['labels'] != None): # xu ly truong hop ko loc dc title bai viet if content_paper['labels'] == "dantri": content_paper['labels'] = "dantri/" + sub_label element = web(url1, image_url, title, content_paper['content_text'], content_paper['labels']) list_web.append(element) elif (self.current_domain == "kenh14.vn" or self.current_domain == "vtv.vn"): #Lay cac the bai biet contain_tags = [] list_url_crawled = [] if self.current_domain == "kenh14.vn": contain_tags.extend( soup.find_all( "div", {'data-marked-zoneid': "kenh14-detail-d1"})) contain_tags.extend( soup.find_all( "div", {'data-marked-zoneid': "kenh14-detail-d2"})) contain_tags.extend( soup.find_all( "div", {'data-marked-zoneid': "kenh14-detail-d3"})) # contain_tags.extend(soup.find_all("div", 'slimScrollDiv')) # contain_tags.extend(soup.find_all("div", 'kcnwtn-hot-news')) # contain_tags.extend(soup.find_all("div", 'kcnw-list-news-wrapper')) elif self.current_domain == "vtv.vn": contain_tags.extend(soup.find_all("div", "noibat1")) contain_tags.extend(soup.find_all("div", 'noibat2')) contain_tags.extend(soup.find_all( "div", 'cate_right1')) contain_tags.extend(soup.find_all( "div", 'cate_right2')) contain_tags.extend(soup.find_all("div", 'list_cate')) # Lay tin bai dac biet for div_tag in contain_tags: if b_next_title == True: break for a_tag in div_tag.find_all('a', href=True): try: #Kiem tra thong tin if ((not a_tag.has_attr('title')) or (not a_tag.has_attr('href'))): continue #Lay thong tin title = a_tag["title"] url1 = "http://" + self.current_domain + a_tag[ "href"] image_url = "" if (a_tag.img != None): if a_tag.img.has_attr('src'): image_url = a_tag.img["src"] # Kiem tra trang nay xem da crawl hay chua if url1 not in list_url_crawled: content_paper = get_content_paper(url1) # tai va boc tach noi dung bai viet list_url_crawled.append(url1) # Kiem tra gioi han so luong web if list_web.__len__() > count_max_web: b_next_title = True break #Luu tru doi tuong if (content_paper['content_text'] != None and content_paper['labels'] != None): #xu ly truong hop ko loc dc label bai viet if content_paper['labels'] == "kenh14": content_paper[ 'labels'] = "kenh14/" + sub_label[: -4] elif content_paper['labels'] == "vtv": content_paper[ 'labels'] = "vtv/" + sub_label elif content_paper[ 'labels'] == "dantri": content_paper[ 'labels'] = "dantri/" + sub_label # tao doi tuong element = web( url1, image_url, title, content_paper['content_text'], content_paper['labels']) list_web.append(element) except Exception, e: print '[Exception - list web ] ' + url1 print '[Exception - list web ] ' + str(e)
def tritymain(): while True: try: main = raw_input(''+G+'' + color.BOLD + color.UNDERLINE + 'Tri>' + color.END) if main in swear: print(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Watch your language!" + color.END) elif main in spell: print(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Do you know how to spell?!" + color.END) elif main == "joke": joke() elif main == "info": info() elif main == "help": print ""+W+"+----------------------------+" print ""+C+"help "+W+"- displays this help message" print ""+C+"clear "+W+"- clears the screen" print ""+C+"exit "+W+"- exits tool" print ""+C+"tool "+W+"- displays info about the tool" print ""+C+"info "+W+"- displays computer and network info" print ""+C+"cd "+W+"- change working directories" print ""+W+"+----------------------------+" print ""+P+"speak "+W+"- text to speech" print ""+P+"ping "+W+"- ping a host" print ""+P+"banner "+W+"- print a new banner" print ""+P+"joke "+W+"- tell a joke" print ""+P+"quote "+W+"- print a quote" print ""+P+"contact "+W+"- contact me" print ""+W+"+----------------------------+" print ""+R+"website "+W+"- enter a website and get its ip" print ""+R+"clone"+W+" - clone a websites source " print ""+R+"whois"+W+" - whois a website" print ""+R+"web"+W+" - extract info from a website" print ""+R+"siteexists"+W+" - check if a site exists" print ""+R+"google"+W+" - find google results for a query" print ""+W+"+----------------------------+" print ""+G+"ip "+W+"- geolocate an ip" print ""+W+"+----------------------------+" print ""+O+"xss "+W+"- simple check for a xss vulnerability" print ""+O+"sql "+W+"- basic check for a sql vulnerability" print ""+O+"admin "+W+"- scan a website for its admin panel" print ""+W+"+----------------------------+" print ""+T+"email "+W+"- bomb an email address" print ""+T+"spoof email "+W+"- spoof an email address" print ""+T+"anonymous "+W+"- send an anonymous email" print ""+T+"sms"+W+" - spam text messages " print ""+T+"twitter"+W+" - check the details of a twitter account" print ""+W+"+----------------------------+" print color.CYAN + "craft"+W+" - generate useful scripts " print color.CYAN + "qr"+W+" - generate a qr code" print color.CYAN + "zip"+W+" - crack a password-protected zip file" print ""+W+"+----------------------------+" print color.BLUE + "encode base64"+W+" - text to base64" print color.BLUE + "decode base64"+W+" - base64 to text" print color.BLUE + "encode hex"+W+" - text to hex" print color.BLUE + "decode hex"+W+" - hex to text" print ""+W+"+----------------------------+" elif main == "sms": sms() elif main == "xss": xss() elif main == "sql": sql() elif main == "anonymous": anon() elif main == "encode base64": encode() elif main == "decode base64": decode() elif main == "email": smtp() elif main == "quote": quote() elif main == "spoof email": spoofemail() elif main == "zip": zipfile() elif main == "decode hex": decode1() elif main == "encode hex": encode1() elif main == "google": googleSearch() elif main == "web": web() elif main == "siteexists": siteexists() elif main == "qr": gen_qrcode() elif main == "twitter": twitter() elif main == "anonymous": anon() elif main == "contact": print(''+T+'' + color.UNDERLINE + 'Skype:'+W+'' + color.BOLD + ' [email protected]' + color.END) print(''+T+'' + color.UNDERLINE + 'Instagram:'+W+'' + color.BOLD + ' @_t0x1c - www.instagram.com/_t0x1c' + color.END) print(''+T+'' + color.UNDERLINE + 'Email me:'+W+'' + color.BOLD + ' [email protected]' + color.END) print(''+T+'' + color.UNDERLINE + 'XMPP:'+W+'' + color.BOLD + ' [email protected]' + color.END) print(''+T+'' + color.UNDERLINE + 'Twitter:'+W+'' + color.BOLD + ' @toxicnull' + color.END) elif main == "ping": while True: hostname = raw_input(''+T+'' + color.UNDERLINE + 'Host>' + color.END) os.system("ping " + hostname) elif main == "craft": while True: table() elif main == "whois": whoisweb() elif main == "admin": admin() elif main == "banner": os.system('clear') banner() banner1() elif main == "speak": while True: speak = raw_input(''+T+'' + color.UNDERLINE + 'What to say>' + color.END) os.system('espeak "' + speak + '"') elif main == "clone": clone() elif main == "cd": try: path = raw_input(''+T+'' + color.UNDERLINE + 'Directory>' + color.END) os.chdir(path) except OSError: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "That is not a directory!" + color.END) elif main == "tool": print(color.UNDERLINE + ''+C+'Version: ' + (VersionNum) + color.END) print(color.UNDERLINE + ''+C+'34 options to choose from!' + color.END) print(color.UNDERLINE + ''+C+'Time spent on it: 76 hours - 14 minutes' + color.END) print(color.UNDERLINE + ''+C+'hackingurwifi is a hacker' + color.END) elif main == "website": while True: a = raw_input(''+T+'' + color.UNDERLINE + 'Website>' + color.END) try: print socket.gethostbyname(a) except socket.gaierror: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Apparently host is unknown! :/" + color.END) elif main == "ip": ip = raw_input(''+T+'' + color.UNDERLINE + 'IP>' + color.END) if ip is None or ip == "": sys.exit(""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Please enter an IP!" + color.END) reversed_dns = socket.getfqdn(ip) geoip = urllib.urlopen('http://api.hackertarget.com/geoip/?q=' + ip).read().rstrip() print (""+G+"[*] " + color.UNDERLINE + "\033[91m" + "IP Info" + color.END) print geoip elif main == "clear": os.system('clear') elif main == "exit": print (""+G+"[*] " + color.UNDERLINE + "\033[91m" + "Exiting..." + color.END) print (""+G+"[*] " + color.UNDERLINE + "\033[92m" + "GoodBye!" + color.END) time.sleep(0.2) sys.exit() elif main == "": print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "Please enter an option!" + color.END) else: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "That is not an option!" + color.END) except KeyboardInterrupt: print (""+R+"[!] " + color.UNDERLINE + "\033[91m" + "\nCtrl-C Pressed! Use 'exit' to close the tool!" + color.END) wyattmain()
def get_list_web(self, max_len =1000000): try: list_webs = [] # Chia deu so bai viet (max_len) cho cac chu de co so luong ~ nhau count_label = self.get_links_rss().__len__() # dung de tinh ti le gioi han sl bai count_max_web = 0 # gia tri so web toi da cho title hien tai i_current_title = 0 # chi so cua title hien tai b_next_title = False # lay cac link rss for url in self.get_links_rss(): # cai dat cac bien gioi han so luong bai viet b_next_title = False i_current_title += 1 count_max_web = (i_current_title*1.0 / count_label)*max_len count_web_curent_label = 0 print (list_webs.__len__(), ' - ', count_max_web) print ('[Crawling] '+url) content = get_content(url) if content is None: return list_webs soup = BeautifulSoup(content, 'html.parser' ) if soup == None: continue if (url.find("vnexpress.net") != -1 or url.find("vietbao.vn") != -1 or url.find("dantri.com.vn") != -1 or url.find("vtv.vn") != -1 or url.find("techtalk.vn") != -1): # Lay tin bai dac biet for item in soup.find_all('item'): try: #Lay thong tin url1 = item.link.text title = item.title.text date = item.pubdate.text CData = BeautifulSoup(item.description.text, 'html.parser') if(CData.img!=None): image_url = CData.img['src'] else : image_url = "" # Kiem tra gioi han bai viet - ko mat cong crawl cac trang khong can thiet web_test = web(url1, "", "", "", "", date) if (Web_filter.check(web_test, count_web_curent_label, list_webs.__len__()) == False): continue # tai va boc tach noi dung bai viet content_paper = get_content_paper(url1); if( url.find("techtalk.vn") != -1) : # trang techtalk - content nam trong rss content_paper = {} content_paper["labels"] = "techtalk/Cong nghe" content_paper["content_text"]="" CDataEncode = BeautifulSoup(item.text, 'html.parser') for p_element in CDataEncode.find_all('p'): content_paper["content_text"] += p_element.text if(content_paper["content_text"]==""): content_paper["content_text"] = None except Exception, e: print '[Exception - get info in item rss] '+url1 print '[Exception - get info in item rss] '+str(e) continue #Kiem tra gioi han so luong bai bao if list_webs.__len__() >= count_max_web: b_next_title = True break #Tao doi tuong if(url1 != None and title != None and content_paper['content_text']!=None and content_paper['labels']!= None) : element = web(url1, image_url, title, content_paper['content_text'], content_paper['labels'], date) count_web_curent_label +=1 # bien dem so luong web 1 label, vd: label = dantri/Kinhte list_webs.append(element) return list_webs
print("2. Docker") print("3. Hadoop") print("4. Partition") print("5. AWS Cloud") print("6. LVM") print("7. Exit/Close program\n") text("7") while True: os.system("" + "clear") instructions(ssh) x = input("Tell me what I can do for you: ").lower() if (("web" in x) or ("httpd" in x) or ("1" in x)): web(ssh) y = input("Tell me what I can do for you: ").lower() if (("configure" in y) and (("yum" in y) or ("repo" in y)) or ("1" in y)): web_1(ssh, r_ip) elif (("configure" in y) and (("httpd" in y) or ("web" in y)) or ("2" in y)): # Apache Webserver web_2(ssh) elif (("start" in y) and (("httpd" in y) or ("web" in y) or ("service" in y)) or ("3" in y)): web_3(ssh) elif (("stop" in y) and (("httpd" in y) or ("web" in y) or ("service" in y)) or ("4" in y)): web_4(ssh) elif (("enable" in y) and (("httpd" in y) or ("web" in y) or