시스템 해킹59 [Nebula] Level 02 LEVEL 02 There is a vulnerability in the below program that allows arbitrary programs to be executed, can you find it? To do this level, log in as the level02 account with the password level02. Files for this level can be found in /home/flag02. Source code #include #include #include #include #include int main(int argc, char **argv, char **envp) { char *buffer; gid_t gid; uid_t uid; gid = getegid.. 2021. 8. 19. [Pwnable.kr] loveletter unsigned int __cdecl protect(const char *a1) { size_t v1; // ebx size_t v2; // eax size_t i; // [esp+1Ch] [ebp-12Ch] size_t j; // [esp+20h] [ebp-128h] char v6[279]; // [esp+25h] [ebp-123h] BYREF unsigned int v7; // [esp+13Ch] [ebp-Ch] v7 = __readgsdword(0x14u); strcpy(v6, "#&;`'\"|*?~^()[]{}$\\,"); for ( i = 0; i 2021. 8. 13. [Pwnable.kr] dragon int __cdecl PriestAttack(int a1, void *ptr) { int v2; // eax do { (*(void (__cdecl **)(void *))ptr)(ptr); (*(void (__cdecl **)(int))(a1 + 12))(a1); v2 = GetChoice(); switch ( v2 ) { case 2: puts("Clarity! Your Mana Has Been Refreshed"); *(_DWORD *)(a1 + 8) = 50; printf("But The Dragon Deals %d Damage To You!\n", *((_DWORD *)ptr + 3)); *(_DWORD *)(a1 + 4) -= *((_DWORD *)ptr + 3); printf("And The .. 2021. 8. 13. [Nebula] Level 01 LEVEL 01 There is a vulnerability in the below program that allows arbitrary programs to be executed, can you find it? To do this level, log in as the level01 account with the password level01. Files for this level can be found in /home/flag01. Source code #include #include #include #include #include int main(int argc, char **argv, char **envp) { gid_t gid; uid_t uid; gid = getegid(); uid = gete.. 2021. 8. 11. [Nebula] Level 00 LEVEL 00 This level requires you to find a Set User ID program that will run as the “flag00” account. You could also find this by carefully looking in top level directories in / for suspicious looking directories. Alternatively, look at the find man page. To access this level, log in as level00 with the password of level00. Source code There is no source code available for this level. ssh level0.. 2021. 8. 11. [Pwnable.kr] echo1 __int64 echo1() { char s[32]; // [rsp+0h] [rbp-20h] BYREF (*((void (__fastcall **)(void *))o + 3))(o); get_input(s, 128LL); puts(s); (*((void (__fastcall **)(void *))o + 4))(o); return 0LL; } int __cdecl main(int argc, const char **argv, const char **envp) { _QWORD *v3; // rax unsigned int i; // [rsp+Ch] [rbp-24h] BYREF _QWORD v6[4]; // [rsp+10h] [rbp-20h] setvbuf(stdout, 0LL, 2, 0LL); setvbuf(s.. 2021. 8. 8. [Pwnable.kr] fsb #include #include #include unsigned long long key; char buf[100]; char buf2[100]; int fsb(char** argv, char** envp){ char* args[]={"/bin/sh", 0}; int i; char*** pargv = &argv; char*** penvp = &envp; char** arg; char* c; for(arg=argv;*arg;arg++) for(c=*arg; *c;c++) *c='\0'; for(arg=envp;*arg;arg++) for(c=*arg; *c;c++) *c='\0'; *pargv=0; *penvp=0; for(i=0; i 2021. 8. 7. [Pwnable.kr] tiny_easy scp -P 2222 horcruxes@pwnable.kr:/home/tiny_easy/tiny_easy ./ 명령어로 파일을 가져옵니다. 그리고 IDA로 열어주면 아래와 같이 명령어 4개가 실행되고 오류가 납니다. 문제 서버로 들어가서 gdb에서 0x08048054에 브레이크 포인트를 걸고 분석을 하겠습니다. gdb에서 source /usr/share/peda/peda.py를 입력하면 gdb-peda를 통해 쉽게 분석할 수 있습니다. disas main을 입력하면 역시나 심볼이 없어서 분석을 할 수 없습니다. 위에 IDA에서 찾은 주소에 브레이크 포인트를 걸고 실행을 합니다. edx에는 home/tiny_easy/tiny_easy 라는 문자열이 담겨있고 따라서 [edx]는 '/hom' 을 의미하고 16.. 2021. 8. 4. [Pwnable.kr] horcruxes 문제 코드가 주어지지 않으므로 실행파일을 가져와서 IDA로 분석합니다. 아래 명령어를 입력하면 파일을 가져올 수 있습니다. scp -P 2222 horcruxes@pwnable.kr:/home/horcruxes/horcruxes ./ 아래는 IDA로 분석한 코드입니다. int ropme() { char s[100]; // [esp+4h] [ebp-74h] BYREF int v2; // [esp+68h] [ebp-10h] BYREF int fd; // [esp+6Ch] [ebp-Ch] printf("Select Menu:"); __isoc99_scanf("%d", &v2); getchar(); if ( v2 == a ) { A(); } else if ( v2 == b ) { B(); } else if ( .. 2021. 8. 3. 이전 1 2 3 4 5 6 7 다음