CISCN2024 初赛
好好好 人人都是取证大师、工控大师、侧信道、frida大师、代码审计大师
只有我是废物
(被战队web大爹带飞 好爽
只记录几个有意思的题目(x
盗版软件
取证大师来了
好好好 vol都失效了
010大法 改成utf-8 搜索下载 翻一翻就找到了
winhack.com
关于ip 题目都打穿了(50分) 我才搞出来
将题目的马放虚拟机里执行
(因为传了三个沙箱给的ip都不对 wb qax vt 。。。
释放了.ss文件夹
(此时猜测是经典的白+黑 这年头人人都是免杀大师
火绒剑都翻烂了 都找不到ip 网络连接更是没有
之后发现 loader.exe 根本就是空文件。。。
好好好 回头看Lena图(ieee都不允许了。。。
发现有隐写
都在r通道上
PK zip压缩包 看对应的16进制 确信
保存、提取
file = open("123","rb").read()
file1 = open("a.zip","wb")
for _,i in enumerate(file):
if _ % 2 == 0:
file1.write(i.to_bytes(1,byteorder='big'))
file1.close()
压缩包里.b文件 猜测base85 但是网上都不好使 以至于我以为我的思路错了
r()J$nEA'r!!#;^5u:HM1"'W(Mc*q[<_/-H(eBQ_+@m$P8kMf4a[h>1:e3=VX?9p=!\>H[_9!-P!Q!d_;F+/NMc([U69Id>ct7iR(^gBUKlR.n!/lA`!!!!iKtqeC8-.(6Mb"[QMa/CV!RTk-8H6e+1!)_>1l+['ejqO2X?j\E%7($238erL9ERs6#Xpc$FkBeaMa/OZ!RPFEM[W-EMa/7R!RO,j"Gf?G6!.Ga!ROtQ6!-EU6!?g3ll\Sls57!F=^"@S''W'hs8Q@r^3=WR?SaG;!'sXWM<7?[m%=@Z!(i%/8\>*)+T!Ns8F&Q@8VuM%M=EmC9Qqfgs4'f"l=^2!!!$.f\g`/F!<:Sa$:.up:e`[d9ejFSs1h0^_FX^B8;Y/K]'9g`i;_=uM8s?B6!-g;i^eq%6+WJ\FCG4"Ktqd;8cR(Yjlhm.!!#QBlju^Ei_;/LC'6h)8;[..\cUR+?iSZ/p],bC8;"i'?A\Aj5XAOd!"],16!-[7njkLW6+U0o;s"&08;Y5UM8r=Fa[q?Y8;Z%kM>9HK!nkY%s4)bs!.?7t6!%3&!'gMa6!.k%>!]_-0+Tc:eQ5m>\ohmb@K4kLs3Bjks8W*i!Q.GW`^kgWFgOI7k?)I!=hET4.LJIugAf\
后面尝试python解
import base64
b = open(".b", "r").read()
b_decode = base64.a85decode(b, adobe=True)
file = open("b.bin", "wb")
file.write(b_decode)
file.close()
加上用python就能解开了。。。。。。
传沙箱
androidso_re
frida大师来啦
关于这个题 我xxxx、我xxxxxxx
经典我会,但比赛打不出来,赛后准能复现。。。
吐槽一下 这个题 在输入一个符合条件的flag时
安卓9hook调用so必报错 安卓12第二次调用so函数必报错
不知道为啥
环境
。。。五个模拟器 我一个一个捋 挨个接受拷打
背景:本人使用了wsl2 开启了hyper-v 导致我之前配好环境的frida无法使用
避雷夜神
雷电 安卓9 hook的时候会报错
mumu 不重启adb就死活连不上 。。。root没共享文件夹目录下执行权限(somebody
逍遥 安卓9 root都root不了(更somebody
蓝叠 安卓10 也报错
安卓12就要用frida16了
注意
firda14 frida -U -l hook.js -f com.example.re11113 -no-pause
frida16 frida -U -l hook.js -f com.example.re11113
因为 16默认是不暂停 14默认暂停
如需暂停 frida16 frida -U -l hook.js -f com.example.re11113 -pause
进入正题
Java.perform(function () {
var Iv = Java.use("javax.crypto.spec.IvParameterSpec")
var Key = Java.use("javax.crypto.spec.SecretKeySpec")
Iv.$init.overload('[B').implementation = function (iv) {
// console.log("iv:", iv);
var temp = iv;
var temp2 = "";
for (var i = 0; i < temp.length; i++) {
temp2 += String.fromCharCode(temp[i]);
}
console.log("iv:", temp2);
return this.$init(iv);
}
Key.$init.overload('[B', 'java.lang.String').implementation = function (key, algo) {
// console.log("key:", key);
var temp = key;
var temp2 = "";
for (var i = 0; i < temp.length; i++) {
temp2 += String.fromCharCode(temp[i]);
}
console.log("key:", temp2);
return this.$init(key, algo);
}
});
这个hook脚本需要输入符合条件的flag 因为hook的初始化iv和key函数
Java.perform(function () {
var MainActivity = Java.use('com.example.re11113.MainActivity');
var legal = MainActivity.legal;
var jni = Java.use('com.example.re11113.jni');
legal.implementation = function () {
console.log('legal() called');
var iv = jni.getiv();
console.log('IV:', iv);
var key = jni.getkey();
console.log('Key:', key);
return true;
};
});
按理说应该也可以 但是安卓12也直接崩
包上flag就可以 呜呜呜 我恨。。。
Power Trajectory Diagram
侧信道大师来了
import numpy as np
import matplotlib.pyplot as plt
a = np.load('attachment.npz')
pos = []
trance = a['trace']
# for i in range(0,10):
# fig, ax = plt.subplots(figsize=(12, 8))
# ax.plot(trance[i])
# ax.set_title(i)
# plt.show()
# exit()
# for i in range(40):
# index = np.where(trance[i+40] <= -0.5)
# print(index)
pos = []
try:
for i in range(11):
index = []
for j in range(40):
temp = np.where(trance[j+40*i] <= -0.4)
index.append(temp[0][0])
result = np.where(index == np.max(index))
pos.append(result[0][0])
except:
print('error',i)
i = 11
index = []
for j in range(40):
temp = np.where(trance[j+40*i] <= -0.3)
index.append(temp[0][0])
result = np.where(index == np.min(index))
pos.append(result[0][0])
for i in pos:
print(a['input'][i],end='')
简单看一下都给了啥
里面有index input output trance
猜测一下 index就是第几位
input就是输入
对应一下 发现index和input正好对应上了
(13*40==520
那么就是按位爆破了
trance就是消耗的能量
最开始分析是最大值
后面发现有两个值 肯定不合适
包括看plt的图 最明显就是最小值
舒服多了 显然这个值应该就是我们需要的值
是倒数第四个字符 就是_
发现11报错了
看看
那么就对11特殊处理下
i = 11
index = []
for j in range(40):
temp = np.where(trance[j+40*i] <= -0.3)
index.append(temp[0][0])
result = np.where(index == np.min(index))
pos.append(result[0][0])
12为a 其实就是0因为所有的值都一样 以为着结束
所以密文是0-11 总计12位
总结
人人讲安全 个个会应急
呜呜呜 被我们web大爹夸了
web大爹审了ssrf的0day 第二天的revenge 拿了三血
ezjava 直接一血(我打打下手写了个so文件