2024能源线上赛

1.IP找不到了-A

wireshark过滤http,然后导出文件

image-20240430093752658

在这里获得第二个网卡的地址

image-20240430093838306

flag{172.16.129.0}

2.Web_ssrf-A

访问首页获得JS文件路径

image-20240430093859516

爆破/static/js/目录,发现dist 301

image-20240430093910418

发现index.js文件

image-20240430093918660

发现index.js.map文件

image-20240430093930719

发现接口/dev/pdf_file/pdf.php

img

通过fuzz构造payload

1
2
3
4
5
6
7
8
9
10
11
POST /dev/pdf_file/pdf.php HTTP/1.1
Host: 101.230.70.253:24026
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
Content-Length: 22

url=file:///etc/passwd

image-20240430094001986

1
2
通过fuzz发现flag在/etc/flag,获得flag
flag{BiNWVCK2h6FDgmv1xdGOy4XtJqAE8pso}

image-20240430094014712

3.gooooose-A

wireshark中筛选出最后包长度为204、205、206的请求包

按照ID排列

image-20240430094302345

取每个数据包最后一位

image-20240430094311831

1
2
3
4
拼接得秘文
TVpXR0NaMzNNTlJHS05KVEc0NERNTUpWTU1ZREdOWlRHSjZRPT09PQ==
解一次base64 解一次base32
flag{cbe5378615c03732}

4.结构化数据分类分级识别-A

打开数据包 过滤http

![img](https://greetdawn.oss-cn-hangzhou.aliyuncs.com/img/202404300943306.jpg

导出内容,修改为excel文件打开

img

根据题目要求编写正则判断规则

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
身份证号码:
131123\d{12}
130522\d{12}
驾照
1101\d{8}
1305\d{8}
银行卡
622481\d{13}
622513\d{13}
622250\d{13}
MAC地址
^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$
邮箱
^[a-zA-Z0-9_]+@[a-zA-Z0-9_]+.[a-zA-Z0-9_]+$

根据《数据分类分级规则.xlsx》中的信息,将这些敏感信息分类为以下类别和级别:

身份证号码:1-1-5-1个人证件信息,3级数据
驾照编号:1-1-5-1个人证件信息,3级数据
银行卡号:1-1-2-1个人财产信息,3级数据
MAC 地址:1-1-2-2个人设备信息,3级数据
邮箱:1-1-3-1普通个人联系信息,2级数据

判断c1-c10符合规则的列为:
c1 c2 c3 c5 c7

按照格式要求拼接,最后结果为

c1_1-1-5-1_3;c2_1-1-5-1_3;c3_1-1-2-1_3;c5_1-1-2-2_3;c7_1-1-3-1_2;

MD5加密后结果为
bd8c4ee3e25545b16eb3622378b2a95a

5.找到钥匙-A

binwalk 分离出来文件flag.enc

img

strings /Users/apple/Desktop/_key.jpg.extracted/key.jpg源文件获得

n和e

![img](https://greetdawn.oss-cn-hangzhou.aliyuncs.com/img/202404300944743.jpg

img

在线分解得出q和q

img

1
2
3
4
5
6
7
8
9
10
11
12
13
代码:
from Crypto.Util.number import *
import gmpy2
import libnum
n =58239180654929120650500449428917292711228851865043992721378668316322123829843

q = 336864880216429367305541498622715085359
p = n // q
e = 65537
with open('./flag.enc','rb') as enc1:
c1 = bytes_to_long(enc1.read())
d = gmpy2.invert(e,(p-1)*(q-1) )
print(long_to_bytes(pow(c1, d, n)))

image-20240430094500623

6.Easy-re-a

提示upx,用upx查壳,显示没壳。

image-20240430094537330

调试运行,还是有upx节。

image-20240430094549324

阅读代码段代码。

image-20240430094558152

取内存内容亦或0x62,lea取内存地址 00007FF676A6C000,长度为0x26.

image-20240430094606303

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <stdlib.h>
int main(int argc, const char* argv[]) {
// insert code here...
char v4[] = "0123456789abcdef";
char result[] = {
0x04,0x0E,03,0x05,0x19,0x26,0x50,0x53,0x51,0x23,0x52,0x20,0x56,0x21,0x27,0x54,
0x56,0x55,0x52,0x56,0x51,0x57,0x51,0x21,0x57,0x56,0x55,0x54,0x52,0x20,0x24,0x24,
0x55,0x5A,0x57,0x26,0x5B,0x1F, 0};
for (size_t i = 0; i < 0x26; i++)
{
result[i] ^= 0x62;
}
printf("%s\r\n", result);
}

flag{D213A0B4CE64704353C54760BFF785D9}

7.testJava-a

前期貌似没有给附件。

parseUserNameByToken函数存在反序列化漏洞。

image-20240430094644874

发现并没有校验签名,所以伪造sub就行了。

image-20240430094654929

生成cc4 payload

image-20240430094720557

伪造subimage-20240430094730054

反弹shell

image-20240430094743596image-20240430094748758

8.seeyouagain

binwork直接分离,得到flag压缩包,crc修复图片得到密码直接解压即可。

image-20240430095025831

image-20240430095030351

base64隐写解密拿到flag

image-20240430095039461

9.Modbus-A

明文拼接即可。

image-20240430095716395

10.Ezsys-A

IDA分析

image-20240430095758010

image-20240430095804695

得到结果不对,在前面随机种子被修改了。

image-20240430095851240

image-20240430095857714

但是还是不对,

换了Windows 的visual studio的结果才对、歧视mac么

image-20240430095906500

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
//
// main.cpp
// dsfsdfd
//
// Created by lyu on 4/25/24.
//

#include <iostream>
#include <stdlib.h>
int main(int argc, const char * argv[]) {
// insert code here...
char v4[]= "0123456789abcdef";
char a1[100]="";
srand(2333);
int i;
for ( i = 0; i < 36; ++i )
{
if ( i == 8 || i == 13 || i == 18 || i == 23 )
{
a1[i] = 45;
// printf("%d = %c\r\n", i, 45);
}
else
{
int v3 = rand() % 16;

a1[i] = v4[v3];
// printf("%d = %c\r\n",i, v4[v3]);
}
}
a1[36]=0;

printf("%s",a1);
// result = 36i64;
return 0;
}


97e45a19-624d-3c47-bc17-57f1c3bcbb26
作者

丨greetdawn丨

发布于

2024-04-25

更新于

2024-05-07

许可协议

评论