当前位置: 代码网 > 科技>电脑产品>CPU > 第九届上海市大学生网络安全大赛暨“磐石行动”2024第二届全国高校网络安全攻防活动 初赛 网络安全赛道 个人Writeup(Re方向)

第九届上海市大学生网络安全大赛暨“磐石行动”2024第二届全国高校网络安全攻防活动 初赛 网络安全赛道 个人Writeup(Re方向)

2024年08月03日 CPU 我要评论
战队名称:Besti学研组战队排名:18个人排名:33。

战队信息

战队名称:besti学研组

战队排名:18

个人排名:33

crypto

字符串加密

根据提示,尝试仿射加密,发现不是常见的仿射加密,推测字符集为base32,即 abcdefghijklmnopqrstuvwxyz234567 ,已知明文前半部分为flag{的base32编码,即 mzwgcz33,求解a,b,过程如下图:

在这里插入图片描述

求得a,b后,编写脚本解密,脚本如下:

#得到a17,b3
for i in range(55):
    if (-15*i)%32==1:
        print(i)

r="pmzjfmoorehwf75s4ymibqegr47ibmnuj47ibl6q"

key="abcdefghijklmnopqrstuvwxyz234567"
a=17
b=3
for i in range(len(r)):
    temp = 0
    for j in range(len(key)):
        if key[j]==r[i]:
            temp=j
    for j in range(len(key)):
        if (a*j+b)%32==temp:
            print(key[j],end="")

在这里插入图片描述

base32解密,得到flag:
在这里插入图片描述

reverse

ezre

ida打开,搜索字符串,可以看到输入flag:
在这里插入图片描述
在这里插入图片描述

其中crazy函数对输入的str进行了处理:
在这里插入图片描述

ohh函数进行了判断:
在这里插入图片描述

密文为:
在这里插入图片描述

逻辑较为简单,直接写出脚本,得到flag1:

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
#include <ctime>
#include <unistd.h>
#include "defs.h"
// #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double dd;

int main()
{
	unsigned int a1[30] = {
    0x00000066, 0x0000006b, 0x00000063, 0x00000064, 0x0000007f, 0x00000063, 0x00000069, 0x00000070, 
    0x00000057, 0x00000060, 0x00000079, 0x00000054, 0x00000078, 0x0000005b, 0x0000006b, 0x00000050, 
    0x00000067, 0x00000054, 0x00000073, 0x00000061, 0x0000007c, 0x00000050, 0x00000064, 0x00000048, 
    0x0000006c, 0x00000056, 0x0000007e, 0x00000046, 0x00000065, 0x00000060
};
	for(int i=0;i<30;i++)
	{
		if ( (i & 1) != 0 )
			a1[i] += i;
		else	
			a1[i] ^= i;
	}

	for(int i=0;i<30;i++)
	{
		cout << (char) a1[i];
	}
	return 0; //-22 61 13 92
}

输入程序,发现还要我们输入一个true flag,仔细观察主程序,其在判断完第一个flag后,将my_function的每一比特异或 0x41u后,执行my_function,如图:
在这里插入图片描述

动态调试,发现my_function调用了xxx_crypt:
在这里插入图片描述

查看xxx_crypt,可以判断此为rc4编码:
在这里插入图片描述

回到my_function,仔细观察,可以看到密文:
在这里插入图片描述

在这里插入图片描述

猜测flag1为rc4密钥,尝试解密,得到flag:
在这里插入图片描述

easy_iot

使用binwalk分离文件:
在这里插入图片描述

得到一个文件夹,打开,感觉形似linux:
在这里插入图片描述

根据提示:比较简单的固件逆向,flag就在一个简单的文件里。挨个文件夹翻看,发现bin文件夹里有个文件修改日期不正常:

在这里插入图片描述

用ida反编译这个bash,搜索字符串,发现有upx壳:
在这里插入图片描述

使用upx -d脱壳,再次反编译,可以看到try again这种字样:
在这里插入图片描述

f5反汇编,
在这里插入图片描述

简单来讲就是输入的str每一字符异或0x63后与dword_a4154比较,也就是dword_a4154每一字符异或0x63后就能得到flag,脚本如下:

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
#include <ctime>
#include <unistd.h>
#include "defs.h"
// #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double dd;

int main()
{
	unsigned int a1[] = {
    5,0xf,2,4,0x18,0x36,0x55,0x2f,0x55,0x27,0x56,0x55,0x55,0x22,0x56,0x3a,0x51,0x35,0x56,0x56,0x12,0x26,0x56,0x39,0x16,0x55,0x56,0x2f,0x16,0x51,0x55,0x3a,0x20,0x24,0x56,0x39,0x20,0x1e
};

	for(int i=0;i<38;i++)
	{
		cout << (char) (a1[i]^0x63);
	}
	return 0; //-22 61 13 92
}

运行得到flag:
在这里插入图片描述

ezlogin

使用gda反编译,可以看到加密方式(des)和密文:
在这里插入图片描述

使用压缩软件打开apk,可以找到so文件:

在这里插入图片描述

使用ida反编译,可以找到getkey函数,看到了“key_here”,推测其为密钥:
在这里插入图片描述

尝试des解密,直接得到flag:
在这里插入图片描述

misc&pwn&web

队友blog:第九届上海市大学生网络安全大赛暨“磐石行动”2024第二届全国高校网络安全攻防活动 初赛 个人writeup | 瞻鹤的博客 (he-zhan.xyz)

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com