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.
Exploit database
Vulnerability
CVE-2007-3280
Vulnerability details
- Score
- 9.0
- Severity
- high
CVSS 2.0 · NVD
Vector string
AV:N/AC:L/Au:S/C:C/I:C/A:CDescription
The Database Link library (dblink) in PostgreSQL 8.1 implements functions via CREATE statements that map to arbitrary libraries based on the C programming language, which allows remote authenticated superusers to map and execute a function from any library, as demonstrated by using the system function in libc.so.6 to gain shell access.
CVE ProgramShowing saved CVE details. Refresh is temporarily unavailable.
Exploit source choices
1 sourcePostgreSQL for Linux Payload Execution
2007-06-05postgres_payload.rb