{"id":"MSF-linux--postgres--postgres_payload","name":"PostgreSQL for Linux Payload Execution","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.","cves":["CVE-2007-3280"],"author":"midnitesnake, egypt, todb, lucipher","published":"2007-06-05","platform":"Linux","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/linux/postgres/postgres_payload.rb","path":"modules/exploits/linux/postgres/postgres_payload.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"postgres_payload.rb","vulnerabilities":[{"id":"CVE-2007-3280","state":"PUBLISHED","title":null,"titleSource":null,"description":"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.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2007-3280","cvss":{"version":"2.0","baseScore":9,"severity":"high","vectorString":"AV:N/AC:L/Au:S/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2007-3280"},"updatedAt":"2024-08-07T14:14:11.897Z","retrievedAt":"2026-11-26T12:19:17.076Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-linux--postgres--postgres_payload.png?v=2","url":"https://exploitbin.com/exploits/MSF-linux--postgres--postgres_payload","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--postgres--postgres_payload/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-linux--postgres--postgres_payload/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}