cassandra

package
v1.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OP_OPTIONS   = 0x05
	OP_SUPPORTED = 0x06
)

CQL protocol opcodes

View Source
const (
	PROTOCOL_V4_REQUEST  = 0x04
	PROTOCOL_V4_RESPONSE = 0x84
	PROTOCOL_V5_REQUEST  = 0x05
	PROTOCOL_V5_RESPONSE = 0x85
	PROTOCOL_V6_REQUEST  = 0x06
	PROTOCOL_V6_RESPONSE = 0x86
)

Protocol version bytes

View Source
const CASSANDRA = "cassandra"

Variables

This section is empty.

Functions

func DetectCassandra

func DetectCassandra(conn net.Conn, timeout time.Duration) (cassandraMetadata, bool, error)

DetectCassandra performs Cassandra fingerprinting using CQL OPTIONS/SUPPORTED handshake.

Detection Strategy:

  1. DETECTION PHASE: Send OPTIONS, validate SUPPORTED response structure
  2. ENRICHMENT PHASE: Parse multimap, extract version markers, build CPE

Parameters:

  • conn: Network connection to Cassandra server
  • timeout: Timeout for network operations

Returns:

  • cassandraMetadata: Enriched metadata (version, product, CPE)
  • bool: true if Cassandra detected
  • error: Error details if detection failed

Types

type CassandraPlugin

type CassandraPlugin struct{}

func (*CassandraPlugin) Name

func (p *CassandraPlugin) Name() string

Name returns the protocol name.

func (*CassandraPlugin) PortPriority

func (p *CassandraPlugin) PortPriority(port uint16) bool

PortPriority returns true if the port is the default Cassandra CQL port (9042).

func (*CassandraPlugin) Priority

func (p *CassandraPlugin) Priority() int

Priority returns the plugin execution priority. 100 = standard priority (run after high-priority protocols like SSH, before HTTP)

func (*CassandraPlugin) Run

func (p *CassandraPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error)

Run implements the Plugin interface for Cassandra fingerprinting.

Returns:

  • *plugins.Service: Service metadata with CPE, or nil if not Cassandra
  • error: Error details, or nil

func (*CassandraPlugin) Type

func (p *CassandraPlugin) Type() plugins.Protocol

Type returns the protocol type (TCP).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL