mongodb

package
v0.0.173 Latest Latest
Warning

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

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

Documentation

Overview

Package mongodb provides MongoDB penetration testing functionality

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerformAuth

func PerformAuth(ctx context.Context, target string, config *mongodbfern.PentestMongodbConfig) (*pentestfern.AuthResult, error)

PerformAuth tests each username+password combination against MongoDB and returns an AuthResult. On the first successful authentication (when StopFirstSuccess is set), it stops early.

func PerformProbe

func PerformProbe(ctx context.Context, target string, config *mongodbfern.PentestMongodbConfig) (*mongodbfern.ProbeResult, error)

PerformProbe connects anonymously to a MongoDB server, retrieves build information, and checks whether unauthenticated access to databases is permitted.

func PerformQuery

func PerformQuery(ctx context.Context, target string, client *mongo.Client, config *mongodbfern.PentestMongodbConfig) (*mongodbfern.QueryResult, error)

PerformQuery executes find() queries on each database/collection accessible via the provided client. Only read operations are supported. Documents are serialized as JSON strings.

func RunPentest

RunPentest performs MongoDB pentest operations using a phased approach: PROBE (always) -> AUTH -> QUERY based on requested actions.

Types

type Target

type Target struct {
	Host string
	Port int
}

Target represents a MongoDB server target

func ParseTarget

func ParseTarget(s string) (*Target, error)

ParseTarget parses a target string into a Target struct. Supports "host:port" and "host" formats. Defaults to port 27017.

Jump to

Keyboard shortcuts

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