2024-01-05 23:28:30 +00:00
# 9042/9160 - 对Cassandra进行渗透测试
2022-04-28 16:01:33 +00:00
< details >
2024-01-05 23:28:30 +00:00
< summary > < strong > 通过< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Red Team Expert)< / strong > < / a > < strong > 从零开始学习AWS黑客攻击! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-01-05 23:28:30 +00:00
支持HackTricks的其他方式:
2022-04-28 16:01:33 +00:00
2024-01-05 23:28:30 +00:00
* 如果您想在**HackTricks中看到您的公司广告**或**下载HackTricks的PDF版本**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方的PEASS & HackTricks商品**](https://peass.creator-spring.com)
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs系列**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群组** ](https://discord.gg/hRep4RUj7f ) 或 [**telegram群组** ](https://t.me/peass ) 或在 **Twitter** 🐦 上**关注**我 [**@carlospolopm** ](https://twitter.com/carlospolopm )**。**
* **通过向** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) 和 [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) github仓库提交PR来分享您的黑客技巧。
2022-04-28 16:01:33 +00:00
< / details >
2023-08-03 19:12:22 +00:00
## 基本信息
2020-07-15 15:43:14 +00:00
2024-01-05 23:28:30 +00:00
Apache Cassandra是一个高度可扩展的、高性能的分布式数据库, 旨在处理跨多个普通服务器的大量数据, 提供高可用性且没有单点故障。它是一种NoSQL数据库。\
在多个案例中,您会发现**cassandra接受任何凭据**(因为没有配置任何凭据),您将能够枚举数据库。
2020-07-15 15:43:14 +00:00
2023-08-03 19:12:22 +00:00
**默认端口:** 9042,9160
2021-10-18 11:21:18 +00:00
```
2020-07-15 15:43:14 +00:00
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
```
2023-08-03 19:12:22 +00:00
## 枚举
2024-01-05 23:28:30 +00:00
### 手动
2020-07-15 15:43:14 +00:00
```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";
```
2023-08-03 19:12:22 +00:00
### 自动化
2020-07-15 15:43:14 +00:00
2024-01-05 23:28:30 +00:00
这里的选项不多, nmap 也没有获取到太多信息
2020-07-15 15:43:14 +00:00
```bash
nmap -sV --script cassandra-info -p < PORT > < IP >
```
2023-08-03 19:12:22 +00:00
### [**暴力破解**](../generic-methodologies-and-resources/brute-force.md#cassandra)
2020-07-15 15:43:14 +00:00
2022-05-01 13:25:53 +00:00
### **Shodan**
2020-07-15 15:43:14 +00:00
2021-10-18 11:21:18 +00:00
`port:9160 Cluster` \
2022-04-05 22:24:52 +00:00
`port:9042 "Invalid or unsupported protocol version"`
2022-04-28 16:01:33 +00:00
< details >
2024-01-05 23:28:30 +00:00
< summary > < strong > 从零开始学习AWS黑客技术, 成为< / strong > < a href = "https://training.hacktricks.xyz/courses/arte" > < strong > htARTE (HackTricks AWS Red Team Expert)< / strong > < / a > < strong > ! < / strong > < / summary >
2022-04-28 16:01:33 +00:00
2024-01-05 23:28:30 +00:00
支持HackTricks的其他方式:
2022-04-28 16:01:33 +00:00
2024-01-05 23:28:30 +00:00
* 如果您希望在**HackTricks中看到您的公司广告**或**下载HackTricks的PDF版本**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方的PEASS & HackTricks商品**](https://peass.creator-spring.com)
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们独家的[**NFTs系列**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群组** ](https://discord.gg/hRep4RUj7f ) 或 [**telegram群组** ](https://t.me/peass ) 或在 **Twitter** 🐦 上**关注**我 [**@carlospolopm** ](https://twitter.com/carlospolopm )**。**
* **通过向** [**HackTricks** ](https://github.com/carlospolop/hacktricks ) 和 [**HackTricks Cloud** ](https://github.com/carlospolop/hacktricks-cloud ) github仓库提交PR来分享您的黑客技巧。
2022-04-28 16:01:33 +00:00
< / details >