ctfshow爆破刷题记录


Web21

题目提示是爆破,而且给了个zip压缩包

解压缩以后发现是一个爆破字典

登陆一下抓包

image-20211001161432009

Basic后面有个base64的加密,解密一下看看

image-20211001161524776

得到了密码的格式

放到攻击模块,选择Sniper模式
在刚才的位置添加美元号

image-20211001162353338

接下来构造payload
payload type选择Custom iterator

Payload options 中的
postion 1中添加admin
postion 2中添加:
postion 3中添加刚才的字典库

payload processing使用Base64-encode

image-20211001163100960

开始重放爆破,拿到flag

Web22

域名也可以爆破的,试试爆破这个ctf.show的子域名

直接开始爆破,发现有个flag.ctf.show

进去查看,得到flag

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']))&#123;
    $token = md5($_GET['token']);
    if(substr($token, 1,1)===substr($token, 14,1) && substr($token, 14,1) ===substr($token, 17,1))&#123;
        if((intval(substr($token, 1,1))+intval(substr($token, 14,1))+substr($token, 17,1))/substr($token, 1,1)===intval(substr($token, 31,1)))&#123;
            echo $flag;
        &#125;
    &#125;
&#125;else&#123;
    highlight_file(__FILE__);

&#125;
?>

读源码可知需要传递正确的参数才能拿到flag,那直接上php爆破吧,脚本如下,参考dota_st大佬的文章

<?php
header("content-type:text/html;charset=utf-8");
$dict = "0123456789qwertyuiopasdfghjklzxcvbnm";
for ($i = 0; $i < 36; $i++)&#123;
    for ($j = 0; $j < 36; $j++)&#123;
        $token = md5($dict[$i].$dict[$j]);
        if(substr($token, 1,1)===substr($token, 14,1) && substr($token, 14,1) ===substr($token, 17,1))&#123;
        if((intval(substr($token, 1,1))+intval(substr($token, 14,1))+substr($token, 17,1))/substr($token, 1,1)===intval(substr($token, 31,1)))&#123;
            echo ("加密后的md5值为:".$token)."\n";
            echo ("加密前的值为:".$dict[$i].$dict[$j]);
        &#125;
    &#125;

    &#125;
&#125;
?>

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']))&#123;
    $r = $_GET['r'];
    mt_srand(372619038);
    if(intval($r)===intval(mt_rand()))&#123;
        echo $flag;
    &#125;
&#125;else&#123;
    highlight_file(__FILE__);
    echo system('cat /proc/version');
&#125;

?>

查看这个题,需要保证r和mt_rand()相同就行,用php写一下,当然这个地方需要注意一下,需要保证php的版本和题中所用的php版本不同,不然伪随机函数的结果不同。。。

image-20211002113713450

<?php
header("content-type:text/html;charset=utf-8");
mt_srand(372619038);
echo mt_rand();
?>

得到值,直接传值即可

payload:

r = 1155388967

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']))&#123;
    $r = $_GET['r'];
    mt_srand(hexdec(substr(md5($flag), 0,8)));
    $rand = intval($r)-intval(mt_rand());
    if((!$rand))&#123;
        if($_COOKIE['token']==(mt_rand()+mt_rand()))&#123;
            echo $flag;
        &#125;
    &#125;else&#123;
        echo $rand;
    &#125;
&#125;else&#123;
    highlight_file(__FILE__);
    echo system('cat /proc/version');
&#125;

这次种子没有给出,但发现一个关键地方,就是我们可以把传入的r设置为0,即?r=0,可以输出$rand的值,此时$rand=mt_rand()的值,也就是随机数的值

image-20211002163022345

直接上逆推工具尝试逆推出种子

工具地址;https://github.com/Al1ex/php_mt_seed

下载后命令行输入make然后回车编译出php_mt_seed文件

image-20211002170424176

用这个3290049913编写自己的php脚本

从题目的要求发现,需要通过get给一个r,然后当rangd=0的时候绕过第一层,cookie中的token值为mt_rand()+mt_rand()的时候绕过第二层拿得到flag,根据这两点得到写出我们的脚本

<?php
mt_srand(3290049913);
echo mt_rand()."\n";
$result = mt_rand()+mt_rand();
echo $result;

抓包传递r和token,直接得到flag

image-20211002171355644

Web26

image-20211002173652662

右键查看源码

image-20211002173713833

看到有个checkdb.php

通过post函数传递一个值

&a=&p=&d=&u=&pass=

image-20211002173919512

得到flag

image-20211002173939671

Web27

打开以后发现是个教学管理系统

image-20211002175655432

发现有个录取名单外加一个学生学籍信息查询系统

先把录取名单下载下来,信息查询系统可以靠姓名和身份证号查询信息

image-20211002175814961

然后一看学籍信息,啥也别说了,上爆破吧

image-20211002180759822

image-20211002180810368

image-20211002180946992

进行unicode解码

image-20211002181032898

二话不说,直接进系统,flag到手

image-20211002181120093

Web28

得,看这架势让爆破url

image-20211002181245528

老规矩,上burp开抓包,干爆破

这个具体参考大佬博客吧,因为http和https协议的问题一直有问题,就不进行赘述了,贴上大佬的文章地址

https://www.wlhhlc.top/posts/14827/#web28


文章作者: ShadowCui
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 ShadowCui !