0x01 john工具安裝:
kali系統自帶的有,也可以自己安裝在其他linux和windows系統上,關於安裝步驟網上都有可自行百度。
0x02 john常用選項
具體的其他選項可通過john --help查看,這列舉常用的幾個:
1. --single 簡單破解模式,也是默認的執行模式,就是根據用戶和家目錄名進行一些簡單的變形猜解
2.--incremental 逐個遍歷模式[其實跟hashcat的increment模式是一樣的],直到嘗試完所有可能的組合
3.--wordlist 純字典模式,后面跟上字典的路徑即可
4.--show 顯示已經破解出來的hash及所對應的明文密碼
5.--users 只破解指定用戶的hash,可以是用戶名或者對應的uid
6.--groups 只破解指定用戶組的hash,可以是組名或者對應的gid
7.--shells 只破解指定shell的hash,可以用逗號分隔多個shell程序
0x03 准備工作
以下是以破解linux用戶密碼為例,在此之前我們需要將用戶/組及密碼配置文件合並成一個另一個文件,我是保存在了桌面下
*1.unshadow /etc/passwd /etc/shadow > hash.txt
*2.unshadow /etc/group /etc/gshadow >> gshash.txt
0x04 默認模式
#實際破解中推薦的爆破順序,為了盡量節省爆破時間,可以自行嘗試:
#single模式 -> wordlist模式 -> incremental模式 -> 默認模式
默認模式是先嘗試single然后是incremental,直到所有的規則都結束
命令:john --user=ww passwd_shadow
指定了破解的用戶名,默認破解所有用戶密碼
0x05 粗暴簡單的爆破模式——single
#john --single --user=ww passwd_shadow
0x06基於純字典的爆破模式——wordlist
# 需要提前建立一個字典文件pass.txt
#john --wordlist=pass.txt --user=ww passwd_shadow
0x07逐個遍歷的爆破模式——incremental
破解模式的具體方法
破解模式的具體方法 破解的密碼長度 所包含的字符
Incremental:all 0-8 All 95 printable ASCII characters
Incremental:all15 0-5 All 95 printable ASCII characters
Incremental:all6 6 All 95 printable ASCII characters
Incremental:all7 7 All 95 printable ASCII characters
Incremental:all8 8 All 95 printable ASCII characters
Incremental:alpha 1-8 A-Z 純大寫字母
Incremental:digits 1-8 0-9 純數字
Incremental:lanman 0-7 A-Z, 0-9, and some special characters 大寫字母,數字加
一些特殊字符
#以數字類型舉例:
#john --incremental:digits --users=ww passwd_shadow
0x08總結
john的三種模式作為入門使用基本可以了,他還有其他功能,例如破解壓縮包數據庫密碼等,