Wargame/pwnable.xyz

Let's encrypt the seed Mitigation Analysis Stack buffer overflow read_line()은 개행 문자가 들어올 때까지 계속해서 입력을 받는 gets()와 동일한 동작을 합니다. 따라서 BOF가 발생하고 main()의 return address를 덮어쓸 수 있습니다. Exploit Leak address of win() main()에서 do_seed()에 win()의 주소를 인자로 전달하고, do_seed()에서는 인자로 전달된 값에서 1바이트를 뽑아 seed로 사용합니다. 가능한 경우의 수는 0x100가지이기 때문에, 가능한 seed들에 대해 미리 random value들을 준비해 놓으면 encryption 결과를 보고 seed를 역으로 알아낼 수 있습니다..
Door To Other RealmS Mitigation Analysis 1. Choose a door.에서 realm을 door의 값과 같게 맞추면 AAW가 가능합니다. door_의 값을 바꿀 수 있는 유일한 방법입니다. 3. Enter the door.에서 realm이 door의 주소이면 door_의 초깃값인 0을 넣어서 random value를 제거할 수 있지만, 그렇게 하면 door의 값이 0이 되어 2. Open the door.를 사용할 수 없게 됩니다. Exploit door가 아니라 door + 1에 0을 넣어서 random value를 1바이트만 남길 수 있습니다. 남은 1바이트는 brute force로 맞출 수 있습니다. AAW로는 한 번에 4바이트만 쓸 수 있기 때문에 GOT를 한 번..
Children are misbehaving. When are they going to grow up? Mitigation Analysis Struct adult Struct child Type confusion in transform_person() create_child()에서 age가 18 이하이면 child가 되는데, transform_person()에서는 17보다 크면, 즉 18이면 type이 2로 바뀌어 adult가 됩니다. child와 adult의 메모리 구조를 비교해 보면 age와 job의 위치가 바뀌어 있어, type confusion이 발생합니다. Exploit Manipulate job pointer age가 18인 child를 생성하고 adult로 바꾸면 child의 job은 adu..
Can you restore the lost password? Mitigation Analysis OOB in readline() __int64 __fastcall readline(void *buf, int size) { int len; // eax read(0, buf, size); len = strlen((const char *)buf); *((_BYTE *)buf + len - 1) = 0; return (unsigned int)(len - 1); } readline()에서 buf의 첫 바이트가 \x00일 경우 len이 0이 되어 buf - 1 위치의 1바이트를 0으로 덮어쓸 수 있습니다. Exploit Helpers from pwn import * REMOTE = False HOST = 'svc...
What can you access and what are you going to write? Mitigation Analysis win() int win() { return system("cat flag"); } win()이 실행되도록 하면 플래그를 획득할 수 있다. main() while ( 1 ) { num3 = 0LL; printf(intro, argv); v3 = _isoc99_scanf("%ld %ld %ld", &num1, &num2, &num3); if ( !num1 || !num2 || !num3 || num3 > 9 || v3 != 3 ) break; result[num3] = num2 ^ num1; argv = (const char **)result[num3]; printf("Resu..
homeb0dy
'Wargame/pwnable.xyz' 카테고리의 글 목록