ctfshow- web入门爆破21-28

web21

爆破什么的,都是基操

file

抓包

file

file

对账号密码进行了base64加密 使用burp的Custom iterator进行爆破 Custom iterator的使用

配置如下:

file

file

file

file

file

刚开始使用自己的字典一直爆破不出来 最后看wp才发现题目给了字典

file

file

flag{ddd0fc6c-3c3f-47e4-a812-ab235a8ec5ad}

web22

域名也可以爆破的,试试爆破这个ctfer.com 的子域名

http://flag.ctfer.com/index.php

flag{ctf_show_web}

web23

爆个🔨

<?php
/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-03 11:43:51
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-03 11:56:11
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/
error_reporting(0);

include('flag.php');
if(isset($_GET['token'])){
    $token = md5($_GET['token']);
    if(substr($token, 1,1)===substr($token, 14,1) && substr($token, 14,1) ===substr($token, 17,1)){
        if((intval(substr($token, 1,1))+intval(substr($token, 14,1))+substr($token, 17,1))/substr($token, 1,1)===intval(substr($token, 31,1))){
            echo $flag;
        }
    }
}else{
    highlight_file(__FILE__);

}
?>

传进去token之后md5加密 然后满足判断 写脚本跑出一个满足要求的

<?php

error_reporting(0);
$s="qwertyuioplkjhgfdsazxcvbnm1234567890";
for($i=0;$i<36;$i++){
    for($k=0;$k<36;$k++){
        $token=md5($s[$i].$s[$k]);
        if(substr($token, 1,1)===substr($token, 14,1) && substr($token, 14,1) ===substr($token, 17,1)){
            if((intval(substr($token, 1,1))+intval(substr($token, 14,1))+substr($token, 17,1))/substr($token, 1,1)===intval(substr($token, 31,1))){

                echo $s[$i].$s[$k];
            }
        }
    }
}
?>

file

flag{15181e74-eb61-40f8-bea4-e9d0f785a7a0}

web24

爆个🔨

<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-03 13:26:39
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-03 13:53:31
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/

error_reporting(0);
include("flag.php");
if(isset($_GET['r'])){
    $r = $_GET['r'];
    mt_srand(372619038);
    if(intval($r)===intval(mt_rand())){
        echo $flag;
    }
}else{
    highlight_file(__FILE__);
    echo system('cat /proc/version');
}

?>

file

看代码如果参数r等于生成的随机数就会输出flag

file

file

只需要让r=1155388967就可以

/?r=1155388967

flag{cb03da86-31ca-4a10-bc0b-fd8db611ce05}

web25

爆个🔨,不爆了

<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-03 13:56:57
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-03 15:47:33
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/

error_reporting(0);
include("flag.php");
if(isset($_GET['r'])){
    $r = $_GET['r'];
    mt_srand(hexdec(substr(md5($flag), 0,8)));
    $rand = intval($r)-intval(mt_rand());
    if((!$rand)){
        if($_COOKIE['token']==(mt_rand()+mt_rand())){
            echo $flag;
        }
    }else{
        echo $rand;
    }
}else{
    highlight_file(__FILE__);
    echo system('cat /proc/version');
}

file

我们只需要知道这三个数就可以构造payload

伪随机数一个漏洞就是如果知道种子的话 产生的随机数是一样的

传入一个参数r=0 我们可以知道第一个mt_rand()的值 根据这个值来使用下边的脚本破解种子 file

php_mt_seed(随机数破解脚本) 下载后使用 gcc php_mt_seed.c -o php_mt_seed编译

使用方法./php_mt_seed 第一个随机数 ./php_mt_seed 1414200849

file

file

现在知道每个mt_rand()的值

file

flag{7756b2de-5699-4983-b5af-82c0efbf1f01}

web26

爆破password file

flag{111eeedd-2510-4ed4-b998-8899f10fa729}

web27

file

file

下载到一些名字和身份证但是身份证没有日期 爆破一下

file

高先伊 621022199002015237

查询信息

file

登录

file

flag{c5edfcb9-f97d-477b-ace9-977646c32053}

web28

file

刚开始以为是有很多个目录需要遍历每个目录里的每个文件 结果是爆破这个0和1

file

file

/72/20/

flag{4089cc51-a476-4c90-b91f-b1961eb68865}


ctfshow- web入门爆破21-28
http://example.com/2021/01/13/OldBlog/ctf-show-web入门爆破21-28/
作者
Autumn
发布于
2021年1月13日
许可协议