0x01. 进入环境,下载附件
给出了一个无后缀文件,我们尝试用exeinfo PE查看一下文件,如图: 发现结果如图,提示是32位的无加壳文件,使用32位IDA打开文件。
0x02. 问题分析
我们将文件丢入IDA中,找到mian函数,F5反编译,查看伪代码:
int __cdecl main(int argc, const char **argv, const char **envp)
{
time_t v3;
__pid_t v4;
unsigned int v5;
unsigned int v6;
char v7;
signed int i;
char s;
char v11;
char v12;
char v13;
char v14;
char v15;
char v16;
char v17;
char v18;
char v19;
char v20;
char v21;
char v22;
char v23;
char v24;
char v25;
char v26;
char v27;
char v28;
char v29;
char v30;
char v31;
char v32;
char v33;
char v34;
char v35;
char v36;
char v37;
char v38;
char v39;
char v40;
char v41;
char v42;
char v43;
char v44;
char v45;
char v46;
char v47;
char v48;
char v49;
unsigned int v50;
v50 = __readgsdword(0x14u);
s = 83;
v11 = 69;
v12 = 67;
v13 = 67;
v14 = 79;
v15 = 78;
v16 = 123;
v17 = 87;
v18 = 101;
v19 = 108;
v20 = 99;
v21 = 111;
v22 = 109;
v23 = 101;
v24 = 32;
v25 = 116;
v26 = 111;
v27 = 32;
v28 = 116;
v29 = 104;
v30 = 101;
v31 = 32;
v32 = 83;
v33 = 69;
v34 = 67;
v35 = 67;
v36 = 79;
v37 = 78;
v38 = 32;
v39 = 50;
v40 = 48;
v41 = 49;
v42 = 52;
v43 = 32;
v44 = 67;
v45 = 84;
v46 = 70;
v47 = 33;
v48 = 125;
v49 = 0;
v3 = time(0);
v4 = getpid();
srand(v3 + v4);
for ( i = 0; i <= 99; ++i )
{
v5 = rand() % 0x28u;
v6 = rand() % 0x28u;
v7 = *(&s + v5);
*(&s + v5) = *(&s + v6);
*(&s + v6) = v7;
}
puts(&s);
return 0;
}
我们可以看到,定义了巨多的变量,同时使用for循环,产生随机数,进行赋值,达到干扰的目的。因此,众多的v变量才是真实的隐藏信息。我们将其拷贝出来,上代码:
data = [83, 69, 67, 67, 79, 78, 123, 87, 101, 108, 99, 111, 109, 101, 32, 116, 111, 32, 116, 104, 101, 32, 83, 69, 67,
67, 79, 78, 32, 50, 48, 49, 52, 32, 67, 84, 70, 33, 125, 0]
flag = ''
for i in range(len(data)):
flag += chr(data[i])
print(flag)
得到最终的结果为:SECCON{Welcome to the SECCON 2014 CTF!}
或者使用右键,如图: 可以以字符的形式展示字符!
|