> For the complete documentation index, see [llms.txt](https://hacktricks.xsx.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktricks.xsx.tw/network-services-pentesting/49-pentesting-tacacs+.md).

# 49 - Pentesting TACACS+

<details>

<summary><strong>从零开始学习 AWS 黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks 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/hacktricks_live)\*\* 上关注\*\*我们。
* 通过向 [**HackTricks**](https://github.com/carlospolop/hacktricks) 和 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github 仓库提交 PR 来分享您的黑客技巧。

</details>

**Try Hard Security Group**

<figure><img src="/files/Kw46fTSYxPIOMyKySfL5" alt=""><figcaption></figcaption></figure>

{% embed url="<https://discord.gg/tryhardsecurity>" %}

***

## 基本信息

\*\*终端访问控制器访问控制系统（TACACS）\*\*协议用于集中验证试图访问路由器或网络访问服务器（NAS）的用户。其升级版本 **TACACS+** 将服务分为认证、授权和记账（AAA）三个部分。

```
PORT   STATE  SERVICE
49/tcp open   tacacs
```

**默认端口：** 49

## 拦截认证密钥

如果客户端和TACACS服务器的通信被攻击者拦截，**加密的认证密钥可以被截取**。攻击者可以尝试**对密钥进行本地暴力破解攻击，而不会在日志中被检测到**。如果成功破解密钥，攻击者将获得对网络设备的访问权限，并可以使用诸如Wireshark之类的工具解密流量。

### 执行中间人攻击

**ARP欺骗攻击可用于执行中间人攻击**。

### 暴力破解密钥

[Loki](https://c0decafe.de/svn/codename_loki/trunk/)可用于暴力破解密钥：

```
sudo loki_gtk.py
```

如果密钥成功被**暴力破解**（**通常以MD5加密格式**），**我们可以访问设备并解密TACACS加密流量。**

### 解密流量

一旦密钥成功破解，下一步是**解密TACACS加密流量**。如果提供了密钥，Wireshark可以处理加密的TACACS流量。通过分析解密后的流量，可以获取诸如**使用的横幅和管理员用户的用户名**等信息。

通过使用获取的凭据访问网络设备的控制面板，攻击者可以对网络进行控制。需要注意的是，这些操作严格用于教育目的，不应在未经适当授权的情况下使用。

## 参考资料

* <https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9>

**Try Hard Security Group**

<figure><img src="/files/Kw46fTSYxPIOMyKySfL5" alt=""><figcaption></figcaption></figure>

{% embed url="<https://discord.gg/tryhardsecurity>" %}

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS Red Team Expert）</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/hacktricks_live)**上关注**我们。
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>
