module

PostgreSQL for Linux Payload Execution

Disclosed
2007-06-05
Created
2018-05-30

Description

On some default Linux installations of PostgreSQL, the
postgres service account may write to the /tmp directory, and
may source UDF Shared Libraries from there as well, allowing
execution of arbitrary code.

This module compiles a Linux shared object file, uploads it to
the target host via the UPDATE pg_largeobject method of binary
injection, and creates a UDF (user defined function) from that
shared object. Because the payload is run as the shared object's
constructor, it does not need to conform to specific Postgres
API versions.

Authors

midnitesnake
egypt egypt@metasploit.com
todb todb@metasploit.com
lucipher

Platform

Linux

Module Options

To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:


msf > use exploit/linux/postgres/postgres_payload
msf exploit(postgres_payload) > show targets
...targets...
msf exploit(postgres_payload) > set TARGET < target-id >
msf exploit(postgres_payload) > show options
...show and set options...
msf exploit(postgres_payload) > exploit

Title
NEW

Explore Exposure Command

Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.