def test_url_invalida(self): self.assertEqual(checkurl('abc://www.test.com'),False) self.assertEqual(checkurl('http:www.teste.com'),False) self.assertEqual(checkurl('httpwww.teste.com'),False) self.assertEqual(checkurl('http:/www.teste.com'),False) self.assertEqual(checkurl('http://.www.teste.com'),False) self.assertEqual(checkurl('http://'), False)
def execute(): time = strftime("%Y-%m-%d %H:%M:%S", gmtime()) output.insert(END, "\nBruteXSS started on "+time) status = "0" link = url.get() #Working for URL postchecked = postmethodchecked.get() getchecked = getmethodchecked.get() #print link #For Testing domainame = urlparse.urlparse(link) domainname = domainame.hostname #Checking for URL isavailable = checkurl(link, status) if isavailable == "1": output.insert(END, "\n\n[+] Site '"+domainname+"' is available, Good!") else: output.insert(END, "\n[!] Oops! URL not available") #Checking for params param = checkparams(link) #print param #For testing if param == "1": print("\nParam is there.") elif param == "0": output.insert(END, "\n[!] Oops! can't find any parameters!") output.insert(END, "\nPlease try again.") top.mainloop() #else: #output.insert(END, "\n Something went wrong.") #POST Data datafile = open("postdata.txt","w") content = postdata.get("1.0", "end-1c") datafile.write(content) datafile.close() #Working for path #print path #For testing #importword(path, payloads) #lop = str(len(payloads)) #output.insert(END, "\n[+] Loading payloads....") #output.insert(END, "\n[+] Loaded "+lop+" payloads.") #progress.start(1) #The bruteforce part if postchecked == '1': postmethod(link) else: getmethod(link)
def execute(): time = strftime("%Y-%m-%d %H:%M:%S", gmtime()) output.insert(END, "\nBruteXSS started on " + time) status = "0" link = url.get() #Working for URL postchecked = postmethodchecked.get() getchecked = getmethodchecked.get() #print link #For Testing domainame = urlparse.urlparse(link) domainname = domainame.hostname #Checking for URL isavailable = checkurl(link, status) if isavailable == "1": output.insert( END, "\n\n[+] Site '" + domainname + "' is available, Good!") else: output.insert(END, "\n[!] Oops! URL not available") #Checking for params param = checkparams(link) #print param #For testing if param == "1": print("\nParam is there.") elif param == "0": output.insert(END, "\n[!] Oops! can't find any parameters!") output.insert(END, "\nPlease try again.") top.mainloop() #else: #output.insert(END, "\n Something went wrong.") #POST Data datafile = open("postdata.txt", "w") content = postdata.get("1.0", "end-1c") datafile.write(content) datafile.close() #Working for path #print path #For testing #importword(path, payloads) #lop = str(len(payloads)) #output.insert(END, "\n[+] Loading payloads....") #output.insert(END, "\n[+] Loaded "+lop+" payloads.") #progress.start(1) #The bruteforce part if postchecked == '1': postmethod(link) else: getmethod(link)
for k, v in show_1616.iteritems(): if k == '游戏': error['游戏'] = [] #s = profile_time() sys.stdout.write( "\33[31m-----------------------------------------%s-------------------------------\33[0m\n" % ('游戏开始')) for one in v: sys.stdout.write( "检查 分类\33[32m'%s'\33[0m 中的 \33[32m'%s'\33[0m 网址 '%s'\n" % (k, one['Text'].encode('utf8'), one['Link'].encode('utf8'))) #print u"检查 分类 '%s' 中的 '%s' 网址 '%s'" % ( k.decode('utf-8'), one['Text'], one['Link']) #sys.stdout.write(u"检查 分类 '%s' 中的 '%s' 网址 '%s'" % ( k.decode('utf-8'), one['Text'], one['Link'])) #print url.conn(one['Link']) if checkurl.checkurl(one['Link']) == True: ''' error:'ascii' codec can't decode byte 0xe6 in position 9: ordinal not in range(128) http://www.cnblogs.com/fengmk2/archive/2008/08/01/1257771.html 分清encode和decode。str --> decode(c) --> unicode, unicode --> encode(c) --> str,其中编码类型c必须相同。 将unicode字符串写入文件前先使用特定编码对其进行编码(如unicodestr.encode('utf-8'))得到str, 保证写入文件的是str;从文件读取到str,然后对其进行解码(如encodestr.decode('utf-8'))得到unicode。 这是互逆的两个操作,编码类型一定要一致,否则会出现异常。 ''' #err = "catalog: %s, status:true, name: %s, url: %s, show: %s" % (k.decode('utf-8'), one['Text'], one['Link'], one['show']) #error['游戏'].append(err) else: err = "catalog: %s, status:false, name: %s, url: %s, show: %s" % ( k.decode('utf-8'), one['Text'], one['Link'], one['show'])
def test_url_valida(self): self.assertEqual(checkurl('http://10minutemail.com'),True) self.assertEqual(checkurl('http://google.com'),True) self.assertEqual(checkurl('https://fb.com'), True) self.assertEqual(checkurl('https://'))
tmp_show_1616['Text'] = row['name'] tmp_show_1616['Link'] = row['url'] show_1616['内页'].append(tmp_show_1616) cursor.close() conn.close() for k, v in show_1616.iteritems(): if k == '游戏': error['游戏'] = [] #s = profile_time() sys.stdout.write("\33[31m-----------------------------------------%s-------------------------------\33[0m\n" % ('游戏开始')) for one in v: sys.stdout.write("检查 分类\33[32m'%s'\33[0m 中的 \33[32m'%s'\33[0m 网址 '%s'\n" % ( k, one['Text'].encode('utf8'),one['Link'].encode('utf8'))) #print u"检查 分类 '%s' 中的 '%s' 网址 '%s'" % ( k.decode('utf-8'), one['Text'], one['Link']) #sys.stdout.write(u"检查 分类 '%s' 中的 '%s' 网址 '%s'" % ( k.decode('utf-8'), one['Text'], one['Link'])) #print url.conn(one['Link']) if checkurl.checkurl(one['Link']) == True: ''' error:'ascii' codec can't decode byte 0xe6 in position 9: ordinal not in range(128) http://www.cnblogs.com/fengmk2/archive/2008/08/01/1257771.html 分清encode和decode。str --> decode(c) --> unicode, unicode --> encode(c) --> str,其中编码类型c必须相同。 将unicode字符串写入文件前先使用特定编码对其进行编码(如unicodestr.encode('utf-8'))得到str, 保证写入文件的是str;从文件读取到str,然后对其进行解码(如encodestr.decode('utf-8'))得到unicode。 这是互逆的两个操作,编码类型一定要一致,否则会出现异常。 ''' #err = "catalog: %s, status:true, name: %s, url: %s, show: %s" % (k.decode('utf-8'), one['Text'], one['Link'], one['show']) #error['游戏'].append(err) else: err = "catalog: %s, status:false, name: %s, url: %s, show: %s" % (k.decode('utf-8'), one['Text'], one['Link'], one['show']) error['游戏'].append(err) if error['游戏']: