Home

hack it ctf (2)

chall2-bank 这道题目真的快烦死我了。。。 if ( i <= 19 ) { v3 = (struct bank *)malloc(0x28uLL); v3->flag = (__int64)&magic; LODWORD(v3->size) = 16; printf("Enter title of bank account: "); read(0, v3->title, 0x11uLL); printf("Enter size of your bank statement: ", v3->title); fflush(stdout); scanf("%d\n",...

Read more

hack it ctf

1.army 还以为是个堆题目,想多了 三个功能,加入军队,显示信息,升级(delete) 漏洞点在于加入军队和升级,全局变量magic那里 unsigned int sub_4007E7() { unsigned int result; // eax int v1; // eax int v2; // eax char nptr; // [rsp+0h] [rbp-30h] void *des; // [rsp+8h] [rbp-28h] void *answer; // [rsp+10h] [rbp-20h] int answer_size; // [rsp+1Ch] [rbp-...

Read more

plaidctf 2017 bigpicture

BIG PICTURE 就是个画图的程序,输入大小,在指定的坐标画一个像素点(字符) 漏洞点在plot函数 : int __fastcall plot(int x, int y, char c) { char *v3; // rax char v4; // bl if ( width > x && height > y ) // -? { v4 = c; v3 = get(x, y); if ( *v3 ) LODWORD(v3) = _printf_chk(1LL, "overwriting %c!\n", (unsigned int)*v3); else ...

Read more

BCTF bugstore

bugstore 很直白的给了三个漏洞,栈溢出,格式化字符串,任意地址写固定值,而且每个漏洞只能用一次 int sub_C62() { if ( flag ) return puts("ain't it cool, bye now"); flag = 1; read(0, &bss_data_0, 0x200uLL); return _printf_chk(1LL, (__int64)&bss_data_0); } 格式化字符串这里用了printf_chk,但是地址泄露不影响 int sub_D0E() { int result; // eax if ( byte_202048 ) return puts("ain't...

Read more

starctf note

note 很神奇的一道offbynull栈题目 当时没做出来,后来赛后搞懂了忘记写wp,最近才拿出来复习下 漏洞点: char *edit() { char s; // [rsp+0h][rbp-100h] _isoc99_scanf((__int64)"%256s", (__int64)&s); return strdup(&s); } scanf会多读一个\x00字节,这样就可以局部写RBP指针 写完之后的rbp: $rsp : 0x7fffffffd688 → 0x000000000040102c → add BYTE PTR [rax], al $rbp : 0x7fffffffdd68 → 0...

Read more

N1CTF的两道简单的pwn题

N1ctf pwn 补了一些以前做过的题目还有没解决的一些题目的wp vote void create() { _QWORD *v0; // ST08_8 signed int i; // [rsp+0h][rbp-20h] int size; // [rsp+4h][rbp-1Ch] for ( i = 0; i <= 15; ++i ) { if ( !heaplst[i] ) { say("Please enter the name's size: "); size = getnum(); if ( size > 0 && size <= 0x1000 ) ...

Read more

linux kernel 爬坑记录

linux kernel 爬坑记录 好久以前就觉得研究二进制安全kernel方面一直是一个大坑,最近跟着网上的教程看了一下,记录一下所学的以及一些坑 主要参考的链接是这个 安装qume sudo apt-get install qemu qemu-system 内核安装与编译 https://mirrors.edge.kernel.org/pub/linux/kernel 到这个网站上找一个内核版本,wget下来(我这里是用的4.4.11) 而后 tar -zxvf 文件名.tar.gz cd linux-4.4.11/ apt-get install libncurses5-dev build-essential kernel-package make menuc...

Read more

twctf BBQ

bbq 漏洞点在eat函数那里没有初始化栈指针 if ( grridle_list[v2] ) { ptr = grridle_list[v2]; puts("found food."); } else { puts("empty..."); // if goes there ptr will be the last ptr we refer to } 卡了好久没有搞明白这个指针是怎么利用的,看了大佬的wp才明白 And after some debugging , I found that the ptr c...

Read more