Home

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

网鼎杯 pwn 部分wp

网鼎杯 pwn部分wp 菜的不行的我就做出来了一道题。。。而且虚拟机版本太低环境变量还不一样,远程跑不了。。 1.babyheap 比赛的时候没做出来,后来看了swing大佬的解题才豁然开朗 程序分析: 每次只能申请一个0x30大小的堆块,很难搞 unsigned __int64 add() { unsigned int v1; // [rsp+Ch] [rbp-24h] char s; // [rsp+10h] [rbp-20h] unsigned __int64 v3; // [rsp+28h] [rbp-8h] v3 = __readfsqword(0x28u); printf("Ind...

Read more

ret2dlrsvl

ret2dl_resolve 学习 补习了一下栈的知识,看了一下最难的利用方式,发现还是有好多要学习的地方 ret2dlresolve主要就是在没有libc的时候,利用动态延迟绑定来进行利用的一种手法 总体来说比较麻烦,需要阅读源码理解 这里写一下总体的思路 首先程序调用系统函数的时候调用系统函数时先找plt,plt里面有一个偏移的index,之后跳到got表中执行,在这里会进行一堆操作,而且参数是基于栈传递的,这就说明如果我们控制了栈内的参数就可以在调用系统函数时做文章 这里贴一个参考链接 漏洞利用方式主要就是: 1.控制eip为PLT[0]的地址,只需传递一个index_arg参数 2.控制index_arg的大小,使reloc的位置落在可控地址内 3.伪造reloc的内容,使...

Read more