postgres

package
v0.0.182 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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