RCE with PostgreSQL Languages
Last updated
Last updated
Learn & practice AWS Hacking: Learn & practice GCP Hacking:
The PostgreSQL database you got access to may have different scripting languages installed that you could abuse to execute arbitrary code.
You can get them running:
Most of the scripting languages you can install in PostgreSQL have 2 flavours: the trusted and the untrusted. The untrusted will have a name ended in "u" and will be the version that will allow you to execute code and use other interesting functions. This are languages that if installed are interesting:
plpythonu
plpython3u
plperlu
pljavaU
plrubyu
... (any other programming language using an insecure version)
If you find that an interesting language is installed but untrusted by PostgreSQL (lanpltrusted
is false
) you can try to trust it with the following line so no restrictions will be applied by PostgreSQL:
If you don't see a language, you could try to load it with (you need to be superadmin):
Check the following page:
Check the following page:
Note that it's possible to compile the secure versions as "unsecure". Check for example. So it's always worth trying if you can execute code even if you only find installed the trusted one.
Learn & practice AWS Hacking: Learn & practice GCP Hacking:
Check the !
Join the 💬 or the or follow us on Twitter 🐦 .
Share hacking tricks by submitting PRs to the and github repos.