hacktricks/network-services-pentesting/cassandra.md

74 lines
3.9 KiB
Markdown
Raw Normal View History

2022-05-01 13:25:53 +00:00
# 9042/9160 - Pentesting Cassandra
2022-04-28 16:01:33 +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-04-28 16:01:33 +00:00
<details>
2022-04-28 16:01:33 +00:00
<summary>Support HackTricks</summary>
2022-04-28 16:01:33 +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-04-28 16:01:33 +00:00
</details>
{% endhint %}
2022-04-28 16:01:33 +00:00
## Grundinformationen
**Apache Cassandra** ist eine **hoch skalierbare**, **leistungsstarke** verteilte Datenbank, die entwickelt wurde, um **große Datenmengen** über viele **Standardserver** zu verwalten und **hohe Verfügbarkeit** ohne **einzelnen Ausfallpunkt** zu bieten. Es handelt sich um eine Art von **NoSQL-Datenbank**.
2024-02-08 22:36:15 +01:00
In mehreren Fällen kann es vorkommen, dass Cassandra **beliebige Anmeldeinformationen** akzeptiert (da keine konfiguriert sind), was einem Angreifer potenziell ermöglichen könnte, die Datenbank zu **enumerieren**.
**Standardport:** 9042,9160
```
PORT STATE SERVICE REASON
9042/tcp open cassandra-native Apache Cassandra 3.10 or later (native protocol versions 3/v3, 4/v4, 5/v5-beta)
9160/tcp open cassandra syn-ack
```
2022-05-01 13:25:53 +00:00
## Enumeration
2024-02-10 15:36:32 +00:00
### Manuell
```bash
pip install cqlsh
cqlsh <IP>
#Basic info enumeration
SELECT cluster_name, thrift_version, data_center, partitioner, native_protocol_version, rack, release_version from system.local;
#Keyspace enumeration
SELECT keyspace_name FROM system.schema_keyspaces;
desc <Keyspace_name> #Decribe that DB
desc system_auth #Describe the DB called system_auth
SELECT * from system_auth.roles; #Retreive that info, can contain credential hashes
SELECT * from logdb.user_auth; #Can contain credential hashes
SELECT * from logdb.user;
SELECT * from configuration."config";
```
2024-02-10 15:36:32 +00:00
### Automatisiert
Es gibt hier nicht viele Optionen und nmap erhält nicht viele Informationen.
```bash
nmap -sV --script cassandra-info -p <PORT> <IP>
```
### [**Brute force**](../generic-methodologies-and-resources/brute-force.md#cassandra)
2022-05-01 13:25:53 +00:00
### **Shodan**
`port:9160 Cluster`\
2024-02-10 15:36:32 +00:00
`port:9042 "Ungültige oder nicht unterstützte Protokollversion"`
2022-04-28 16:01:33 +00:00
{% hint style="success" %}
Lernen & üben Sie 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">\
Lernen & üben Sie 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-04-28 16:01:33 +00:00
<details>
2022-04-28 16:01:33 +00:00
<summary>Unterstützen Sie HackTricks</summary>
2022-04-28 16:01:33 +00:00
* Überprüfen Sie die [**Abonnementpläne**](https://github.com/sponsors/carlospolop)!
* **Treten Sie der** 💬 [**Discord-Gruppe**](https://discord.gg/hRep4RUj7f) oder der [**Telegram-Gruppe**](https://t.me/peass) bei oder **folgen** Sie uns auf **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Teilen Sie Hacking-Tricks, indem Sie PRs an die** [**HackTricks**](https://github.com/carlospolop/hacktricks) und [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) GitHub-Repos senden.
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}