목록Security (202)
cdor1's lab
50 - Just Integer overflow at selling and get flag100 - Just buffer overflow and get flag 150 - Heap pointer overwrite from pwn import * #s = process('./item') s = remote('112.166.114.143', 317) def add(data): print s.recvuntil('> ') s.sendline('1') print s.recvuntil('input content: ') s.sendline(data) def show(): print s.recvuntil('> ') s.sendline('2') def delete(idx): print s.recvuntil('> ') s..
보호되어 있는 글입니다.
참조자 심화버전 call by reference에서 포인터 대신 참조자로 가능, 하지만 c와 달리 함수 콜하는 곳에서 함수의 리턴값을 짐작하기 힘듬.(함수 초기선언은 무조건 알아야함, 참조자의 문제점)int& RefRetFuncOne(int &ref){ref++;return ref;}함수도 이런식으로 선언 가능 malloc, free대신 new delete사용(분석요망)new delete는 내부에서 malloc과 free를 부른다고 알고 있는데 추가적으로 더 공부해 봐야겠다.처리방식이 좀 다름. 객체 사용시에는 new delete사용. c++에서 c헤더 추가시 .h를 제외하고 c를 앞에 붙임ex) stdio.h -> cstdio그냥 .h붙여줘도 되지만 함수 오버로딩때문에 c++에 특화된 헤더 사용하는 것..
보호되어 있는 글입니다.
보호되어 있는 글입니다.
use after free, double free bug를 이용한 문제이다. malloc(256), malloc(256), free(0), malloc(256)을 이용해 unsorted bin fd, bk에 적힌 main_arena+88 주소를 leak하고 libc주소를 알아냈다. title, content를 add메뉴에서 title과 content를 입력받는데 매우 취약한 부분이 title을 입력받는 부분과 content의 포인터를 입력받는 부분의 주소가 같다. ex) title이 0x1f200이면 pointer는 0x1f210 그런데 title을 입력받는 부분에서 1byte overflow가 생겨 pointer의 최하위 1바이트를 수정할 수 있다. 이를 이용해 free(1), free(2), free..
bool 자료형bool Trueone = true;bool Falseone = false; sizeof(true) == 1 참조자(포인터와 다른 걔념, 별칭이라고 생각)int num1 = 2;int &num2 = num1; cout
Type confusionc++분석하느라 애먹었다 ㅠㅠㅠ root@noe:~/pwnchal# ./checksec.sh --file noe.systems/owner RELRO STACK CANARY NX PIE RPATH RUNPATH FILE Full RELRO Canary found NX enabled PIE enabled No RPATH No RUNPATH noe.systems/owner 1. Apartment에서 Restaurant로 type change해서 fd, bk leak2. pointer 이용해서 main_arena+88 leak 3. pointer 이용해서 malloc_hook overwrite4. get shell from pwn import * s = process('./owner')..