24 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{#include ../../banners/hacktricks-training.md}}
### Linux中的凭证存储
Linux系统将凭证存储在三种类型的缓存中即**文件**(在`/tmp`目录中)、**内核密钥环**Linux内核中的一个特殊段和**进程内存**(用于单进程使用)。`/etc/krb5.conf`中的**default_ccache_name**变量揭示了正在使用的存储类型,如果未指定,则默认为`FILE:/tmp/krb5cc_%{uid}`
### 提取凭证
2017年的论文[**Kerberos Credential Thievery (GNU/Linux)**](https://www.delaat.net/rp/2016-2017/p97/report.pdf)概述了从密钥环和进程中提取凭证的方法强调了Linux内核的密钥环机制用于管理和存储密钥。
#### 密钥环提取概述
**keyctl系统调用**在内核版本2.6.10中引入允许用户空间应用程序与内核密钥环交互。密钥环中的凭证作为组件存储默认主体和凭证与文件ccache不同后者还包括一个头部。论文中的**hercules.sh脚本**演示了如何提取和重构这些组件为可用于凭证盗取的文件ccache。
#### 票据提取工具Tickey
基于**hercules.sh脚本**的原理,[**tickey**](https://github.com/TarlogicSecurity/tickey)工具专门设计用于从密钥环中提取票据,通过`/tmp/tickey -i`执行。
## 参考文献
- [**https://www.tarlogic.com/en/blog/how-to-attack-kerberos/**](https://www.tarlogic.com/en/blog/how-to-attack-kerberos/)
{{#include ../../banners/hacktricks-training.md}}