본문 바로가기

Wargame/pwnable.kr

(3)
[pwnable.kr] unlink 저 파일들을 로컬 환경에 다운받으려고 설쳤는데... 굳이 그러지 않아도 되었던 것 같다. #include #include #include typedef struct tagOBJ{ struct tagOBJ* fd; struct tagOBJ* bk; char buf[8]; }OBJ; void shell(){ system("/bin/sh"); } void unlink(OBJ* P){ OBJ* BK; OBJ* FD; BK=P->bk; FD=P->fd; FD->bk=BK; BK->fd=FD; } int main(int argc, char* argv[]){ malloc(1024); OBJ* A = (OBJ*)malloc(sizeof(OBJ)); OBJ* B = (OBJ*)malloc(sizeof(OBJ)); OBJ..
[pwnable.kr] bof 아래는 다운받은 bof.c 코드이다. #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("Nah..\n"); } } int main(int argc, char* argv[]){ func(0xdeadbeef); return 0; } main 함수의 func()에서 key = 0xdeadbeef를 위쪽 func()처럼 key = 0xcafebabe 로 바꿔주면 쉘을 띄워준다. gets 함수를 통해 입력을 받는데, 입력값의 길이를 제한하지 ..
[pwnable.kr] fd https://pwnable.kr/ https://pwnable.kr/ there are flag files corresponding to each challenges (similar to CTF), you need to read it and submit to pwnable.kr to get the corresponding point. in order to read the flag file, you need some skills regarding programming, reverse-engineering, bu pwnable.kr 마지막의 ssh fd@pwnable.kr -p2222 와 password로 guest 를 입력해 접속한다. ls -l 명령어를 입력해 현재 디렉토리에서 권한, 파일 수, 소유자..