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

82 lines
4.6 KiB
Markdown
Raw Normal View History

2022-09-30 10:27:15 +00:00
# 49 - Pentesting TACACS+
<details>
2024-01-03 10:43:38 +00:00
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-09-30 10:27:15 +00:00
2024-01-03 10:43:38 +00:00
Other ways to support HackTricks:
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
2022-09-30 10:27:15 +00:00
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
2024-01-03 10:43:38 +00:00
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-02-09 07:14:36 +00:00
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
2024-01-03 10:43:38 +00:00
* **Share your 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-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
<details>
2024-01-03 10:43:38 +00:00
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-09-30 10:27:15 +00:00
2024-01-03 10:43:38 +00:00
Other ways to support HackTricks:
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
2022-09-30 10:27:15 +00:00
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
2024-01-03 10:43:38 +00:00
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
2024-02-09 07:14:36 +00:00
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
2024-01-03 10:43:38 +00:00
* **Share your 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>