Documentation
¶
Overview ¶
Package postgres implements PostgreSQL credential spray and query execution.
Index ¶
- func AuthenticateSingle(ctx context.Context, target, username, password, database, sslMode string, ...) (bool, string, error)
- func PerformAuthentication(ctx context.Context, target string, config *postgresfern.PentestPostgresConfig) (*postgresfern.AuthResult, error)
- func RunPentest(ctx context.Context, config *postgresfern.PentestPostgresConfig) (*postgresfern.PentestPostgresReport, error)
- func RunQuery(ctx context.Context, connConfig *pgx.ConnConfig, query string, ...) (*postgresfern.QueryResult, error)
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 ¶
func RunPentest(ctx context.Context, config *postgresfern.PentestPostgresConfig) (*postgresfern.PentestPostgresReport, error)
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.