HackTricks
Search…
Pentesting
Powered By GitBook
9042/9160 - Pentesting Cassandra

Basic Information

Apache Cassandra is a highly scalable, high-performance distributed database designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. It is a type of NoSQL database. In several cases you will find cassandra accepting any credentials (as there aren't any configured) and you will be able to enumerate the database.
Default port: 9042,9160
1
PORT STATE SERVICE REASON
2
9042/tcp open cassandra-native Apache Cassandra 3.10 or later (native protocol versions 3/v3, 4/v4, 5/v5-beta)
3
9160/tcp open cassandra syn-ack
Copied!

Enumeration

Manual

1
pip install cqlsh
2
cqlsh <IP>
3
#Basic info enumeration
4
SELECT cluster_name, thrift_version, data_center, partitioner, native_protocol_version, rack, release_version from system.local;
5
#Keyspace enumeration
6
SELECT keyspace_name FROM system.schema_keyspaces;
7
desc <Keyspace_name> #Decribe that DB
8
desc system_auth #Describe the DB called system_auth
9
SELECT * from system_auth.roles; #Retreive that info, can contain credential hashes
10
SELECT * from logdb.user_auth; #Can contain credential hashes
11
SELECT * from logdb.user;
12
SELECT * from configuration."config";
Copied!

Automated

There aren't much options here and nmap doesn't obtain much info
1
nmap -sV --script cassandra-info -p <PORT> <IP>
Copied!

Shodan

port:9160 Cluster port:9042 "Invalid or unsupported protocol version"
Last modified 1yr ago