Python 暴力破解UNIX密碼指令碼

2021-08-28 14:27:48 字數 821 閱讀 3259

# coding=utf-8

"""暴力破解unix的密碼,需要輸入字典檔案和unix的密碼檔案

遍歷整個字典,試圖用常用的鹽值來匹配破解雜湊密碼

"""import crypt

def testpass(cryptpass):

salt = cryptpass[0:2]

dictfile = open('dictionary.txt', 'r') # 開啟字典檔案

for word in dictfile.readlines():

word = word.strip('\n') # 保留原始字元,不去空格

cryptword = crypt.crypt(word, salt)

if cryptpass == cryptword:

print('found passed:', word)

return

print('password not found!')

return

def main():

passfile = open('passwor', 'r')

for line in passfile.readlines():

user = line.split(':')[0]

cryptpass = line.split(':')[1].strip(")

print("cracking password for:", user)

testpass(cryptpass)

if __name__ == '__main__':

main()

Python實戰 暴力破解zip檔案解壓密碼

首先測試檔案為test.txt 僅包含單行文字 壓縮後檔案為test.zip,壓縮密碼為2340,壓縮後刪除目錄下的txt檔案。上圖注意勾選傳統加密。指的是不用0開頭的數字密碼,0開頭見後面的字母組合。原理就是zipfile模組解壓壓縮檔案時,一旦密碼不正確,程式會終止,在try語句只有成功解壓的密...

Python 暴力破解wifi

思路 首先檢查是否擁有無限網絡卡 無線網絡卡是否連線到wifi 如果連線到wifi那麼需要斷開連線,因為一張網絡卡同一時間只能連線乙個wifi 搜尋附近的wifi確定連線的目標 使用字典開始嘗試自動連線 實列 首先安裝pywifi模組,這個模組專門用來處理wifi的資訊 pip install py...

Python暴力破解wifi

import pywifi from pywifi import const import time wifi pywifi.pywifi 抓取網絡卡介面 iface wifi.inte ces 0 抓取第乙個無線網絡卡 iface.disconnect 測試鏈結斷開所有鏈結 讀取密碼字典,進行匹配...