Rapid7 Vulnerability & Exploit Database

PostgreSQL CREATE LANGUAGE Execution

Back to Search

PostgreSQL CREATE LANGUAGE Execution

Disclosed
01/01/2016
Created
05/30/2018

Description

Some installations of Postgres 8 and 9 are configured to allow loading external scripting languages. Most commonly this is Perl and Python. When enabled, command execution is possible on the host. To execute system commands, loading the "untrusted" version of the language is necessary. This requires a superuser. This is usually postgres. The execution should be platform-agnostic, and has been tested on OS X, Windows, and Linux. This module attempts to load Perl or Python to execute system commands. As this dynamically loads a scripting language to execute commands, it is not necessary to drop a file on the filesystem. Only Postgres 8 and up are supported.

Author(s)

  • Micheal Cottingham
  • midnitesnake
  • Nixawk

Platform

Linux,OSX,Unix,Windows

Architectures

cmd

Development

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/multi/postgres/postgres_createlang
msf exploit(postgres_createlang) > show targets
    ...targets...
msf exploit(postgres_createlang) > set TARGET < target-id >
msf exploit(postgres_createlang) > show options
    ...show and set options...
msf exploit(postgres_createlang) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;