postgres

package
v0.0.180 Latest Latest
Warning

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

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

Documentation

Overview

Package postgres implements PostgreSQL credential spray and query execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateSingle

func AuthenticateSingle(ctx context.Context, target, username, password, database, sslMode string, timeoutMs int) (bool, string, error)

AuthenticateSingle attempts a single PostgreSQL authentication. Returns (success, message, error). Used by the unified spray framework.

func PerformAuthentication

func PerformAuthentication(ctx context.Context, target string, config *postgresfern.PentestPostgresConfig) (*postgresfern.AuthResult, error)

PerformAuthentication performs credential-spray authentication attempts against a PostgreSQL service. It iterates over all username x password combinations defined in config. Returns an AuthResult containing all attempts and any errors encountered.

func RunPentest

RunPentest performs PostgreSQL pentest operations for multiple targets.

func RunQuery

func RunQuery(ctx context.Context, connConfig *pgx.ConnConfig, query string, allowMutations bool, timeoutMs int) (*postgresfern.QueryResult, error)

RunQuery executes a single SQL query against a live connection. If allowMutations is false, DML/DDL statements are rejected before execution, and the query is run inside a PostgreSQL READ ONLY transaction to enforce this server-side. Returns a QueryResult containing column names, rows, and row count. timeoutMs controls the connection-establishment timeout; if ≤0 a 30-second default is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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