Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Weak Password Dictionary Generator

渗透测试弱口令字典生成器 — 支持目标定向生成,结合企业信息、人员信息、产品名称等多维度数据自动生成高命中率的密码候选字典。

功能特性

  • 17 条生成规则:按优先级执行,覆盖首字母缩写、键盘模式、日期后缀、leet 变换等常见弱口令模式
  • 多因子评分排序:规则贡献 + 目标特异性 + 样本泛化 + 常见后缀加分,高价值口令优先
  • 拼音自动转换:中文企业名 / 人名自动转为拼音,支持全拼、首字母缩写、模糊匹配
  • 样本学习:从已知泄露口令中学习命名规律和数字组合模式
  • 图形化界面:基于 PySide6 的桌面 GUI,分组输入 + 实时预览 + 统计分析图表
  • 权限安全:输出文件自动设为 0600(仅所有者可读写)

快速开始

环境要求

  • Python 3.10+
  • PySide6 >= 6.7
  • pypinyin >= 0.50

安装

git clone https://github.com/Lysander-9/weak_password_gen.git
cd weak_password_gen
pip install -e .

启动图形界面

python -m weak_password_gen.gui.launcher

或直接双击 weak_password_gen/gui/launch_gui.bat

作为 Python 库使用

from weak_password_gen.models import GenerationRequest, TargetInputs, GenerationOptions
from weak_password_gen.services.generator_service import generate_wordlist

request = GenerationRequest(
    target=TargetInputs(
        names=["examplecorp"],
        domains=["example.com"],
        products=["OA", "ERP"],
    ),
    options=GenerationOptions(max_count=5000),
    mode="generate",
    output_path="wordlist.txt",
)

result = generate_wordlist(request)
print(f"生成 {result.total_generated} 条,写入 {result.total_written} 条")

规则概述

规则 说明 示例
R1 关键字直接作为口令 gotion
R2 关键字 + 常见后缀(@123, #2024) gotion@123
R3 关键字 + 年份 / 特殊数字后缀 gotion2024
R4 员工姓名变体(全拼、首字母) zhangsan, zs
R5 邮箱前缀提取 admin
R6–R11 首字母缩写(大小写 / 大小写混合) GC, gcgk
R12–R13 键盘模式(横向 / 纵向) qwerty, 1qaz
R14 Leet 变换(a→@, e→3 等) g0t10n
R15 常见弱口令库 admin123, password
R16 重复字符 / 序列 111111, abc123
R17 样本学习(已知口令模式泛化)

项目结构

weak_password_gen/
├── gui/                      # PySide6 图形界面
│   ├── launcher.py           # GUI 启动入口
│   ├── main_window.py        # 主窗口(分组输入 + 结果展示)
│   ├── view_model.py         # ViewModel 层(状态持久化)
│   ├── worker.py             # 后台生成线程
│   ├── styles.py             # QSS 样式表
│   ├── launch_gui.bat        # Windows 双击启动脚本
│   └── assets/               # 应用图标
├── core/                     # 核心生成引擎
│   ├── rule_engine.py        # 17 条规则按优先级执行
│   ├── pattern_learner.py    # 样本学习与模式泛化
│   ├── ranking.py            # 多因子评分排序
│   ├── quality.py            # 口令质量检查
│   ├── input_normalizer.py   # 拼音转换与输入规范化
│   └── summary.py            # 生成统计摘要
├── services/                 # 服务层
│   └── generator_service.py  # 预览 + 生成服务
├── storage/                  # 持久化
│   ├── local_state.py        # 上次请求状态保存
│   └── file_policy.py        # 0600 文件权限
└── models.py                 # 数据模型定义

安全声明

  • 本工具仅用于授权的渗透测试和安全评估
  • 所有输出默认使用 0600 文件权限
  • 不包含任何网络通信或数据外传功能
  • 请遵守当地法律法规和目标系统的授权协议

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages