hacktricks/network-services-pentesting/49-pentesting-tacacs+.md

84 lines
4.6 KiB
Markdown
Raw Normal View History

2022-09-30 10:27:15 +00:00
# 49 - Pentesting TACACS+
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-09-30 10:27:15 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-09-30 10:27:15 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2024-01-03 10:43:38 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-09-30 10:27:15 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}
2022-09-30 10:27:15 +00:00
2024-03-14 23:01:13 +00:00
**Try Hard Security Group**
2024-03-26 14:56:40 +00:00
<figure><img src="/.gitbook/assets/telegram-cloud-document-1-5159108904864449420.jpg" alt=""><figcaption></figcaption></figure>
2024-03-14 23:01:13 +00:00
{% embed url="https://discord.gg/tryhardsecurity" %}
***
2022-09-30 10:27:15 +00:00
## Basic Information
2024-02-08 03:08:28 +00:00
The **Terminal Access Controller Access Control System (TACACS)** protocol is used to centrally validate users trying to access routers or Network Access Servers (NAS). Its upgraded version, **TACACS+**, separates the services into authentication, authorization, and accounting (AAA).
2022-09-30 10:27:15 +00:00
```
PORT STATE SERVICE
49/tcp open tacacs
```
**Default port:** 49
## Intercept Authentication Key
2024-02-03 16:02:14 +00:00
If the client and TACACS server communication is intercepted by an attacker, the **encrypted authentication key can be intercepted**. The attacker can then attempt a **local brute-force attack against the key without being detected in the logs**. If successful in brute-forcing the key, the attacker gains access to the network equipment and can decrypt the traffic using tools like Wireshark.
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
### Performing a MitM Attack
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
An **ARP spoofing attack can be utilized to perform a Man-in-the-Middle (MitM) attack**.
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
### Brute-forcing the Key
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
[Loki](https://c0decafe.de/svn/codename\_loki/trunk/) can be used to brute force the key:
2022-09-30 10:27:15 +00:00
```
sudo loki_gtk.py
```
2024-02-03 16:02:14 +00:00
If the key is successfully **bruteforced** (**usually in MD5 encrypted format)**, **we can access the equipment and decrypt the TACACS-encrypted traffic.**
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
### Decrypting Traffic
Once the key is successfully cracked, the next step is to **decrypt the TACACS-encrypted traffic**. Wireshark can handle encrypted TACACS traffic if the key is provided. By analyzing the decrypted traffic, information such as the **banner used and the username of the admin** user can be obtaine.
2022-09-30 10:27:15 +00:00
2024-02-03 16:02:14 +00:00
By gaining access to the control panel of network equipment using the obtained credentials, the attacker can exert control over the network. It's important to note that these actions are strictly for educational purposes and should not be used without proper authorization.
2022-09-30 10:27:15 +00:00
## References
2024-02-03 16:02:14 +00:00
* [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)
2024-03-14 23:01:13 +00:00
**Try Hard Security Group**
2024-03-26 14:56:40 +00:00
<figure><img src="/.gitbook/assets/telegram-cloud-document-1-5159108904864449420.jpg" alt=""><figcaption></figcaption></figure>
2024-03-14 23:01:13 +00:00
{% embed url="https://discord.gg/tryhardsecurity" %}
2022-09-30 10:27:15 +00:00
2024-07-18 23:16:27 +00:00
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-09-30 10:27:15 +00:00
2024-07-18 23:16:27 +00:00
<details>
2022-09-30 10:27:15 +00:00
2024-07-18 23:16:27 +00:00
<summary>Support HackTricks</summary>
2024-01-03 10:43:38 +00:00
2024-07-18 23:16:27 +00:00
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-09-30 10:27:15 +00:00
</details>
2024-07-18 23:16:27 +00:00
{% endhint %}