# 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 #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 #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 ``` ### [**브루트 포스**](../generic-hacking/brute-force.md#cassandra) ### **쇼단** `port:9160 Cluster`\ `port:9042 "유효하지 않거나 지원되지 않는 프로토콜 버전"` {{#include ../banners/hacktricks-training.md}}