mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
48 lines
1.8 KiB
Markdown
48 lines
1.8 KiB
Markdown
# 9042/9160 - Pentesting Cassandra
|
|
|
|
{{#include ../banners/hacktricks-training.md}}
|
|
|
|
## Informations de base
|
|
|
|
**Apache Cassandra** est une base de données distribuée **hautement évolutive** et **haute performance** conçue pour gérer **de grandes quantités de données** sur de nombreux **serveurs standard**, offrant une **haute disponibilité** sans **point de défaillance unique**. C'est un type de **base de données NoSQL**.
|
|
|
|
Dans plusieurs cas, vous pouvez constater que Cassandra accepte **toutes les informations d'identification** (car aucune n'est configurée) et cela pourrait potentiellement permettre à un attaquant de **énumérer** la base de données.
|
|
|
|
**Port par défaut :** 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
|
|
```
|
|
## Énumération
|
|
|
|
### Manuel
|
|
```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";
|
|
```
|
|
### Automatisé
|
|
|
|
Il n'y a pas beaucoup d'options ici et nmap n'obtient pas beaucoup d'informations.
|
|
```bash
|
|
nmap -sV --script cassandra-info -p <PORT> <IP>
|
|
```
|
|
### [**Brute force**](../generic-hacking/brute-force.md#cassandra)
|
|
|
|
### **Shodan**
|
|
|
|
`port:9160 Cluster`\
|
|
`port:9042 "Version de protocole invalide ou non prise en charge"`
|
|
|
|
{{#include ../banners/hacktricks-training.md}}
|