hacktricks/network-services-pentesting/cassandra.md

3.9 KiB

9042/9160 - Pentesting Cassandra

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}

Basic Information

Apache Cassandra je visoko skalabilna, visokoperformantna distribuirana baza podataka dizajnirana da upravlja velikim količinama podataka na mnogim običnim serverima, pružajući visoku dostupnost bez jedne tačke kvara. To je tip NoSQL baze podataka.

U nekoliko slučajeva, možete primetiti da Cassandra prihvata bilo koje akreditive (pošto nisu konfigurisani) i to bi potencijalno moglo omogućiti napadaču da enumeriše bazu podataka.

Podrazumevani port: 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

Enumeration

Manual

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";

Automated

Нема много опција овде и nmap не добија много информација.

nmap -sV --script cassandra-info -p <PORT> <IP>

Brute force

Shodan

port:9160 Cluster
port:9042 "Nevažeća ili nepodržana verzija protokola"

{% hint style="success" %} Učite i vežbajte AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Učite i vežbajte GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Podržite HackTricks
{% endhint %}