🔑

John the Ripper

工具简介

John the Ripper是一个快速密码破解工具,支持多种加密格式。它可以用于测试密码强度、恢复丢失的密码,以及进行密码安全审计。

主要功能

密码破解

支持多种加密算法

字典攻击

使用预定义密码字典

暴力破解

尝试所有可能的组合

规则引擎

自定义密码生成规则

基本用法

# 基本密码破解
john password.txt

# 使用字典文件
john --wordlist=wordlist.txt password.txt

# 使用规则
john --rules password.txt

# 显示已破解的密码
john --show password.txt

# 使用特定格式
john --format=raw-md5 password.txt

常用参数

参数 说明
--wordlist 指定密码字典文件
--rules 启用密码规则
--format 指定密码格式
--show 显示已破解的密码
--incremental 使用增量模式

使用示例

示例1:破解Linux密码

# 提取密码哈希
unshadow /etc/passwd /etc/shadow > password.txt

# 使用字典破解
john --wordlist=/usr/share/wordlists/rockyou.txt password.txt

破解Linux系统用户密码

示例2:破解ZIP文件

# 提取ZIP哈希
zip2john file.zip > hash.txt

# 破解ZIP密码
john --wordlist=wordlist.txt hash.txt

破解加密的ZIP文件

安全提示

  • 仅用于授权的密码恢复
  • 不要用于非法用途
  • 注意保护密码文件安全
  • 遵守密码安全规范