pwnable.kr memcpy之write up】的更多相关文章

// compiled with : gcc -o memcpy memcpy.c -m32 -lm #include <stdio.h> #include <string.h> #include <stdlib.h> #include <signal.h> #include <unistd.h> #include <sys/mman.h> #include <math.h> unsigned long long rdts…
pwnable的新一题,和堆分配相关. http://pwnable.kr/bin/memcpy.c ssh memcpy@pwnable.kr -p2222 (pw:guest) 我觉得主要考察的是堆块分配问题. 推荐<C和C++安全编码> 首先通过阅读源代码,看一下题目大意. // compiled with : gcc -o memcpy memcpy.c -m32 -lm #include <stdio.h> #include <string.h> #inclu…
这道题是pwnable.kr Rookiss部分的simple login,需要我们去覆盖程序的ebp,eip,esp去改变程序的执行流程   主要逻辑是输入一个字符串,base64解码后看是否与题目给定字符串一致,如果一致返回一个shell,仔细分析发现并不像网上普遍说的导致栈溢出.嗯,菜鸡如我觉得还是有必要做下笔记的=W=   看一下关键函数的反汇编    auth函数调用形参v6,因为v6<0xc才会执行auth,所以即使auth调用了memcpy,v4数组大小12也不会栈溢出 所以这道题…
一道写shellcode的题目, #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/mman.h> #include <seccomp.h> #include <sys/prctl.h> #include <fcntl.h> #include <unistd.h> #define LENGTH 128 void sa…
pwnable.kr之simple Login 懒了几天,一边看malloc.c的源码,一边看华庭的PDF.今天佛系做题,到pwnable.kr上打开了simple Login这道题,但是这道题个人觉得不simple,没有独立完成,看了wp,学到新的思路. 其实说实话,原理并不复杂,这道题比较难的地方,是它的结构比较复杂,溢出空间很小,而且很隐蔽. 这是主函数的伪代码,Base64Decode函数实现对输入内容进行base64解码,auth函数会生成解码内容的md5哈希值,并且与程序中保存的ha…
前段时间找到一个练习pwn的网站,pwnable.kr 这里记录其中的passcode的做题过程,给自己加深印象. 废话不多说了,看一下题目, 看到题目,就ssh连接进去,就看到三个文件如下 看了一下我们的用户名,并不能直接查看flag这个文件.查看passcode.c的源码看一下 #include <stdio.h> #include <stdlib.h> void login(){ int passcode1; int passcode2; printf("enter…
这一题与前两题不同,用到了静态调试工具ida 首先题中给出了源码: #include <stdio.h> #include <string.h> #include <stdlib.h> void func(int key){ ]; printf("overflow me : "); gets(overflowme); // smash me! if(key == 0xcafebabe){ system("/bin/sh"); }…
Daddy told me about cool MD5 hash collision today. I wanna do something like that too! ssh col@pwnable.kr -p2222 (pw:guest) 先看源代码: #include <stdio.h> #include <string.h> unsigned long hashcode = 0x21DD09EC; unsigned long check_password(const c…
I made a simple brain-fuck language emulation program written in C. The [ ] commands are not implemented yet. However the rest functionality seems working fine. Find a bug and exploit it to get a shell. Download : http://pwnable.kr/bin/bf Download :…
main函数如下: auth函数如下: 程序的流程如下: 输入Authenticate值,并base64解码,将解码的值代入md5_auth函数中 mad5_auth()生成其MD5值并与f87cd601aa7fedca99018a8be88eda34相比,如果相等则调用correct函数,得到shell 找12个字符进行base64加密: 将值输入找到溢出点: 发现AAAA覆盖了main函数的ebp,程序执行到leave出错. leave相当于以下两条指令 指令 含义 MOV ESP, EBP…