web21 hint:爆破什么的,都是基操
随便输入一下,直接抓包
解码后看到是 账户:密码 的形式
使用给的字典进行爆破
得到结果
web22 hint:域名也可以爆破的,试试爆破这个ctf.show的子域名
对域名进行爆破,先访问一下看看
访问到vip.ctf.show时,发现flag
web23 hint:还爆破?这么多代码,告辞!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 <?php 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__ ); } ?>
写脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 import hashlibdef check_token (token_md5 ): if len (token_md5) < 32 : return False first_char = token_md5[1 :2 ] fourteenth_char = token_md5[14 :15 ] seventeenth_char = token_md5[17 :18 ] thirty_first_char = token_md5[31 :32 ] if first_char == fourteenth_char and fourteenth_char == seventeenth_char: try : first_int = int (first_char, 16 ) if first_int == 0 : return False sum_value = first_int + int (fourteenth_char, 16 ) + int (seventeenth_char, 16 ) result = sum_value / first_int thirty_first_int = int (thirty_first_char, 16 ) return result == thirty_first_int except ValueError: return False return False for i in range (100000 ): token = str (i) token_md5 = hashlib.md5(token.encode()).hexdigest() if check_token(token_md5): print (f"可能的token值: {token} " )
结果如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 可能的token值: 422 可能的token值: 1202 可能的token值: 13702 可能的token值: 15456 可能的token值: 20770 可能的token值: 22877 可能的token值: 46617 可能的token值: 48969 可能的token值: 49255 可能的token值: 54388 可能的token值: 54674 可能的token值: 59384 可能的token值: 63281 可能的token值: 64413 可能的token值: 66039 可能的token值: 66478 可能的token值: 82614 可能的token值: 88310 可能的token值: 93326
输入得 flag
web24 hint:爆个🔨
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 <?php 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' ); } ?>
✨伪随机数
mt_srand(372619038) 已经用固定的种子初始化了
mt_rand() 在相同次数生成的随机数都是固定的
比如两台设备,使用同一个随机数种子初始化之后。他们相同次数产生的随机数是一致的,但是不同次数之间产生的随机数是不一致的。
1 2 3 <?php mt_srand (372619038 );echo intval (mt_rand ());
web25 hint:爆个🔨,不爆了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 <?php 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' ); } ?>
✨我们可以看到这次生成的随机数也是固定的,先传入 r=0,得到 mt_rand() 的值
✨看出 mt_rand()值为 47716040 , 传入 r= 47716040
使用 php_mt_seed 脚本爆破种子
可见,我们爆出了一堆种子,并且知道了版本,那么之后一个一个试
1 2 3 4 5 <?php mt_srand (2795750851 );echo mt_rand ().PHP_EOL;echo mt_rand ()+mt_rand ();
web26 hint:这个可以爆
抓包爆破
web27 hint:CTFshow菜鸡学院招生啦!
抓包爆破
使用集束爆破
爆破出是 19900201
解码一下
解码一下
结束
web28 hint:大海捞针
看 url 有 3 个位置可以爆破
✨通过多次测试,只要位置 3 存在,无论修改哪个位置,都会导致页面重定向,因此要删去位置 3,对 1 和 2 位置进行爆破
使用集束爆破
设定从 0 到 100
出结果了
查看响应