48 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 9042/9160 - Pentesting Cassandra
{{#include ../banners/hacktricks-training.md}}
## Основна інформація
**Apache Cassandra** є **високошвидкісною**, **високопродуктивною** розподіленою базою даних, розробленою для обробки **великої кількості даних** на багатьох **звичайних серверах**, забезпечуючи **високу доступність** без **однієї точки відмови**. Це тип **NoSQL бази даних**.
У кількох випадках ви можете виявити, що Cassandra приймає **будь-які облікові дані** (оскільки вони не налаштовані) і це може потенційно дозволити зловмиснику **перерахувати** базу даних.
**Порт за замовчуванням:** 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
```
## Перерахування
### Вручну
```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";
```
### Автоматизований
Тут не так багато варіантів, і nmap не отримує багато інформації.
```bash
nmap -sV --script cassandra-info -p <PORT> <IP>
```
### [**Брутфорс**](../generic-hacking/brute-force.md#cassandra)
### **Shodan**
`port:9160 Cluster`\
`port:9042 "Недійсна або непідтримувана версія протоколу"`
{{#include ../banners/hacktricks-training.md}}