1234567int __cdecl main(int argc, const char **argv, const char **envp){ char buf; // [rsp+0h] [rbp-10h] read(0, &buf, 256uLL); return 0;}Colored by Color Scriptercs IDA로 보면 read 받고 끝난다. 그리고 1234int get_shell(){ return system("/bin/sh");}c 이런 함수도 있는데 PIE가 걸려있음. 근데 어셈블리로 보면 12345678910111213141516171819.text:00000000000007A8 push rbp.text:00000000000007A9 mov rbp, rsp.text:00000000000007AC sub rs..
친구랑 https://github.com/yacropolisy/pwn_challenge_list/blob/764c8661b5c7f1f07bedb629cd40dd7180bb529e/pwn_list.md 여기 문제들 푸는 중인데 재밌는 문제가 있었다. 스태틱이길래 strace 해봤는데 read 하고 무슨 문자열 출력하고 끝난다. 대충 IDA로 분석 좀 해보면12345678910111213141516171819void *sub_8048F8F(){ void **v0; // edx void *result; // eax char *v2; // [esp+0h] [ebp-8h] char *v3; // [esp+4h] [ebp-4h] void *retaddr; // [esp+Ch] [ebp+4h] array[idx++]..
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051#include #include int main(){ fprintf(stderr, "이 파일은 fastbin_dup.c 의 확장이다.\n" "malloc을 속여서 포인터를 컨트롤 된 위치에 리턴한다.(이 경우, 스택이다.)\n"); unsigned long long stack_var; fprintf(stderr, "우리가 원하는 malloc()이 리턴하기 원하는 주소는 %p이다.\n", 8+(char *)&stack_var); fprintf(stderr, "3개의 버퍼를 할당합니다.\n"); int *a = malloc(8); int *b ..