본문 바로가기

2014/0712

[Rookiss] ascii_easy ascii 프로그램은 getchar로 한 문자 씩 입력받아서 vuln함수 내에서 strcpy를 수행하는 프로그램이다.아래에 코드에서 보다싶이 0xa8(168) + ebp + ret을 덮을 수 있게된다. (gdb) disass vulnDump of assembler code for function vuln: 0x080484f1 : push %ebp 0x080484f2 : mov %esp,%ebp 0x080484f4 : sub $0xb8,%esp 0x080484fa : movl $0x80000000,0x4(%esp) 0x08048502 : lea -0xa8(%ebp),%eax 0x08048508 : mov %eax,(%esp) 0x0804850b : call 0x80483d0 0x08048510 : leav.. 2014. 7. 21.
[Rookiss] dragon I made a RPG game for my little brother.But to trick him, I made it impossible to win.I hope he doesn't get too angry with me :P! Author : rookissDownload : http://pwnable.kr/bin/dragon Running at : nc pwnable.kr 9004 문제는 아주 간단하게 해결할 수 있는 UAF 취약점이다. system("/bin/sh")를 띄우는 코드도 문제 바이너리에 포함되어 있어서 쉽게 해결할 수 있다. 아래는 Hex-ray 코드이다. void __cdecl FightDragon(int job) { char v1; // al@1 void *v2; // ST1C_4.. 2014. 7. 20.
[Toddler's Bottle] passcode passcode.c 소스 #include #include void login(){ int passcode1; int passcode2; printf("enter passcode1 : "); scanf("%d", passcode1); fflush(stdin); // ha! mommy told me that 32bit is vulnerable to bruteforcing :) printf("enter passcode2 : "); scanf("%d", passcode2); printf("checking...\n"); if(passcode1==338150 && passcode2==13371337){ printf("Login OK!\n"); system("/bin/cat flag"); } else{ printf(.. 2014. 7. 19.
[LOB_FC3] hell_fire ->evil_wizard #Env - NX- ascii armor- random stack #Technic - got overwrite- strcpy plt chain evil_wizard.c 소스 [hell_fire@Fedora_1stFloor ~]$ cat evil_wizard.c /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard - Local BOF on Fedora Core 3 - hint : GOT overwriting */ // magic potion for you void pop_pop_ret(void) { asm("pop %eax"); asm("pop %eax"); asm("ret"); } int main(int argc, char *argv[]) .. 2014. 7. 19.