1.2 PSQL Large Object Shell- Windows
Goal
Steps
- Create a DLL file that will contain our malicious code
- Inject a query that creates a large object from an arbitrary remote file on disk
- Inject a query that updates page 0 of the newly created large object with the first 2KB of our DLL
- Inject queries that insert additional pages into the pg_largeobject table to contain the remainder of our DLL
- Inject a query that exports our large object (DLL) onto the remote server file system
- Inject a query that creates a PostgreSQL User Defined Function (UDF) based on our exported DLL
- Inject a query that executes our newly created UDF