# 9042/9160 - Pentesting Cassandra
{% hint style="success" %}
Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** ๐ฌ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** ๐ฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}
## Basic Information
**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
```
## Enumeration
### Manual
```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
```
### [**Brute force**](../generic-methodologies-and-resources/brute-force.md#cassandra)
### **Shodan**
`port:9160 Cluster`\
`port:9042 "Invalid or unsupported protocol version"`
{% hint style="success" %}
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
HackTricks ์ง์ํ๊ธฐ
* [**๊ตฌ๋
๊ณํ**](https://github.com/sponsors/carlospolop) ํ์ธํ๊ธฐ!
* **๐ฌ [**Discord ๊ทธ๋ฃน**](https://discord.gg/hRep4RUj7f) ๋๋ [**ํ
๋ ๊ทธ๋จ ๊ทธ๋ฃน**](https://t.me/peass)์ ์ฐธ์ฌํ๊ฑฐ๋ **Twitter** ๐ฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**๋ฅผ ํ๋ก์ฐํ์ธ์.**
* **[**HackTricks**](https://github.com/carlospolop/hacktricks) ๋ฐ [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํ์ ๊ณต์ ํ์ธ์.**
{% endhint %}