def check_passwords(password1, password2): if password1 and not password2: raise forms.ValidationError(ugettext_lazy("Bitte das Passwort zur Bestätigung erneut eingeben.")) # print password1 if password1 != password2: raise forms.ValidationError(ugettext_lazy("Die beiden Passwörter stimmen nicht überein.")) pw2 = passwd.Password(password2) #password2 not empty string and valid if password2 and not pw2.is_valid(): errors = [] if not pw2.has_digit(): errors.append(forms.ValidationError(ugettext_lazy("Das Passwort muss mindestens 1 Ziffer beinhalten."))) if not pw2.has_lowercase_char(): errors.append( forms.ValidationError(ugettext_lazy("Das Passwort muss mindestens 1 Kleinbuchstaben beinhalten."))) if not pw2.has_uppercase_char(): errors.append( forms.ValidationError(ugettext_lazy("Das Passwort muss mindestens 1 Großbuchstaben beinhalten."))) if not pw2.has_symbol(): errors.append( forms.ValidationError(ugettext_lazy("Das Passwort muss mindestens 1 Sonderzeichen beinhalten."))) if not pw2.has_allowed_length(): errors.append(forms.ValidationError(ugettext_lazy("Das Passwort muss zwischen 8 und 63 Zeichen lang sein."))) if not pw2.has_only_allowed_chars(): errors.append(forms.ValidationError(ugettext_lazy( "Das Passwort darf lediglich die Sonderzeichen %s enthalten." % pw2.get_allowed_chars()))) raise forms.ValidationError(errors) return password2
def threadblase(): threadNum = self.thread_num_Entry.get() digitNum = self.passwd_digit_Entry.get() index = self.wifiList.curselection() try: wifiname = self.wifiList.get(index) except: messagebox.showwarning(title='警告', message='请选择一个WiFi!!!') else: try: threadnum = int(threadNum) digitnum = int(digitNum) except: messagebox.showerror(message='输入含有非数字内容') else: if threadnum > 4500 or threadnum < 1: messagebox.showwarning(message='线程数应该在(0-4500)之间') elif digitnum > 11 or digitnum < 1: messagebox.showwarning( message='请输入正确的密码位数\n目前支持最大密码11位') else: try: pswd = int(way.get()) iterPassword = passwd.Password().passwd_product( type=pswd, num=int(digitNum)) except: messagebox.showwarning(message='请选择密码类型!!!') else: request = messagebox.askokcancel( message='该过程可能会非常漫长并且可能会占用系统资源,确定是否继续?') if request: messagebox.showinfo(message='请等待...') try: result = wifi.WiFi().thread_connect( threadnum=threadNum, name=wifiname, password=iterPassword) except: pass finally: if result == None: messagebox.showinfo(message='爆破失败!!!') else: messagebox.showinfo( message='爆破成功 密码:' + str(result[0])) else: pass
def __init__(self, name, size): self.Generator = passwd.Password() self.size = size self.root = tkinter.Tk() self.root.title(name) self.winfo_screen = [ self.root.winfo_screenwidth() // 2, self.root.winfo_screenheight() // 2 ] self.root.geometry( f'{size[0]}x{size[1]}+{self.winfo_screen[0]-size[0]//2}+{self.winfo_screen[1]-size[1]//2}' ) self.root.minsize(size[0], size[1]) self.root.maxsize(size[0], size[1]) self.layout()
def fileblase(): loads = fileroad.get() index = self.wifiList.curselection() try: wifiname = self.wifiList.get(index) except: messagebox.showwarning(title='警告', message='请选择一个WiFi!!!') else: try: password = passwd.Password().passwd_read(file=loads) except: messagebox.showerror(message='请导入文件!!!') else: result = wifi.WiFi().blastconnect(name=wifiname, password=password) if result == -1: messagebox.showinfo(message='爆破失败') else: messagebox.showinfo(message='爆破成功 密码为:' + result)
def check_passwd(arg): pw = passwd.Password(arg) if not pw.is_valid(): if not pw.has_digit(): print 'the password must contain at least 1 digit' if not pw.has_lowercase_char(): print 'the password must contain at least 1 lowercase character' if not pw.has_uppercase_char(): print 'the password must contain at least 1 uppercase character' if not pw.has_symbol(): print 'the password must contain at least 1 special character' if not pw.has_allowed_length(): print 'the password must be between 8 to 63 characters long' if not pw.has_only_allowed_chars(): print 'the password must only contain following special characters: %s' % pw.get_allowed_chars() return False else: return True