Exploit-Exercise
-
-
heap0Exploit-Exercise 2015. 6. 27. 21:09
#include #include #include #include #include struct data { char name[64]; }; struct fp { int (*fp)(); }; void winner() { printf("level passed\n"); } void nowinner() { printf("level has not been passed\n"); } int main(int argc, char **argv) { struct data *d; struct fp *f; d = malloc(sizeof(struct data)); f = malloc(sizeof(struct fp)); f->fp = nowinner; printf("data is at %p, fp is at %p\n", d, f)..
-
stack2Exploit-Exercise 2015. 4. 21. 20:53
buffer와 modified, 각각 취약점터지는것과 수정해야할 변수들이다. variable이 추가되었다. variable은 밑에서보면 getenv("GREENIE");코드로 GREENIE라는 환경변수를 참조한다. 즉,이번문제는 환경변수를 이용해서 공격해야하는문제이다. 밑에서 보면 modified는 0x0d0a0d0a로 만들어줘야한다. 환경변수에다 넣는것만 빼면 64 + 값을 넣어주면된다는것을 눈치 챌수있다. 그럼 공격을 해보자. 환경변수에 공격코드를 넣어주고 stack2를 실행해보자