python暴力破解六位密碼(數字和大小寫字母)

2021-10-03 10:47:12 字數 2487 閱讀 5724

廢話不多說,給我上**!

key = input('請輸入六位數密碼:')  #填寫密碼用來破解

while len(key)!=6: #判斷密碼是否為六位,否則重新輸入

print('密碼不合法,請重新輸入!')

key = input('請輸入六位的密碼:')

print(key)

key = list(key)

print('設定的密碼為:',key)

my_str =

result = ['0','0','0','0','0','0']

#數字0-9的ascii碼為48-57

for j in range(48,58):

for i in my_str:

result[0] = i

for j in my_str:

result[1] = j

for k in my_str:

result[2] = k

for l in my_str:

result[3] = l

for m in my_str:

result[4] = m

for n in my_str:

result[5] = n

if result == key:

print('破解成功!密碼為:',result)

break

else:

print('失敗',result)

else:

continue

break

else:

continue

break

else:

continue

break

else:

continue

break

else:

continue

break

key = input('請輸入六位數密碼:')  #填寫密碼用來破解

while len(key)!=6:

print('密碼不合法,請重新輸入!')

key = input('請輸入六位的密碼:')

key = list(key)

print('設定的密碼為:',key)

my_str =

result = ['0','0','0','0','0','0']

#產生陣列進行比對 a = random.choice(my_str)

for j in range(48,123):

if j in [58,59,60,61,62,63,64,91,92,93,94,95,96]:

continue

# print(my_str)

for i in my_str:

result[0] = i

for j in my_str:

result[1] = j

for k in my_str:

result[2] = k

for l in my_str:

result[3] = l

for m in my_str:

result[4] = m

for n in my_str:

result[5] = n

if result == key:

print('破解成功!密碼為:',result)

break

else:

print('失敗',result)

else:

continue

break

else:

continue

break

else:

continue

break

else:

continue

break

else:

continue

break

1.使用以下方法實現了break跳出巢狀的for迴圈(多層for迴圈)
for i in range(1,5):

for j in range(5,10):

print(i,j)

if j==6:

break

else:

continue

break

2.數字和字母對應的ascii碼為
a-z     97-122

a-z 65-90

0-9 48-57

數字、字母轉ascii碼函式:ord()

ascii碼轉數字、字母函式:chr()

3.從列表中產生隨機數
my_str = ['h','e','l','i','o']

a = random.choice(my_str)

print(a)

暴力破解柵欄密碼(Python)

蘆花叢中一扁舟,俊傑俄從此地游。義士若能知此理,反躬難逃可無憂。水滸傳 usr bin env python3 e input 清輸入要解密的字串 n elen len e 計算字串長度 field for i in range 2 elen 做乙個迴圈,從2開始到數字elen 字串長度 if el...

暴力破解zip,rar密碼

在此只論數字密碼 zip檔案,python自帶包 zipfile import zipfile def extractfile zipfile,password try zipfile.extractall pwd bytes password,utf8 print 壓縮包密碼是 password ...

暴力破解WiFi密碼

你好!歡迎來到這裡,我學習的地方!要有乙個外接網絡卡 kali linux系統 這裡以ubuntu為實驗 虛擬機器除錯 除錯到外接網絡卡 開啟終端,按照順序敲 airmon ng start wlan0 airodump ng wlan0mon airodump ng cch bssidbssid ...