½Ã½ºÅÛ ÇØÅ·

 1574, 1/79 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   ka0r1
   ¹è¿­ »çÀÌÀÇ ´õ¹Ì

http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_system&no=1903 [º¹»ç]


[ka0r1@localhost ka0r1]$ cat test.c
#include <stdio.h>

main()
{
    char str1[10];
    char str2[20];

    printf("It can be overflow : ");
    fgets(str2, 40, stdin);

    if(strncmp(str1, "go", 2)==0)
    {
        printf("Good Skill!\n");
        system("/bin/bash");
    }
}
[ka0r1@localhost ka0r1]$ gcc -o test test.c
[ka0r1@localhost ka0r1]$ ./test
It can be overflow : 12345
[ka0r1@localhost ka0r1]$ gdb -q test
(gdb) disas main
Dump of assembler code for function main:
0x8048488 <main>:       push   %ebp
0x8048489 <main+1>:     mov    %esp,%ebp
0x804848b <main+3>:     sub    $0x20,%esp
0x804848e <main+6>:     push   $0x8048540
0x8048493 <main+11>:    call   0x80483cc <printf>
0x8048498 <main+16>:    add    $0x4,%esp
0x804849b <main+19>:    mov    0x804965c,%eax
0x80484a0 <main+24>:    push   %eax
0x80484a1 <main+25>:    push   $0x28
0x80484a3 <main+27>:    lea    0xffffffe0(%ebp),%eax
0x80484a6 <main+30>:    push   %eax
0x80484a7 <main+31>:    call   0x804839c <fgets>
0x80484ac <main+36>:    add    $0xc,%esp
0x80484af <main+39>:    push   $0x2
0x80484b1 <main+41>:    push   $0x8048556
0x80484b6 <main+46>:    lea    0xfffffff4(%ebp),%eax
0x80484b9 <main+49>:    push   %eax
0x80484ba <main+50>:    call   0x80483ac <strncmp>
0x80484bf <main+55>:    add    $0xc,%esp
0x80484c2 <main+58>:    mov    %eax,%eax
0x80484c4 <main+60>:    test   %eax,%eax
0x80484c6 <main+62>:    jne    0x80484e2 <main+90>
0x80484c8 <main+64>:    push   $0x8048559
0x80484cd <main+69>:    call   0x80483cc <printf>
0x80484d2 <main+74>:    add    $0x4,%esp
0x80484d5 <main+77>:    push   $0x8048566
0x80484da <main+82>:    call   0x804837c <system>
0x80484df <main+87>:    add    $0x4,%esp
0x80484e2 <main+90>:    leave
0x80484e3 <main+91>:    ret
0x80484e4 <main+92>:    nop
0x80484e5 <main+93>:    nop
0x80484e6 <main+94>:    nop
0x80484e7 <main+95>:    nop
0x80484e8 <main+96>:    nop
0x80484e9 <main+97>:    nop
0x80484ea <main+98>:    nop
0x80484eb <main+99>:    nop
0x80484ec <main+100>:   nop
0x80484ed <main+101>:   nop
0x80484ee <main+102>:   nop
0x80484ef <main+103>:   nop
End of assembler dump.
(gdb) q
[ka0r1@localhost ka0r1]$ test
[ka0r1@localhost ka0r1]$ ./test
It can be overflow : 12345678901234go
[ka0r1@localhost ka0r1]$ ./test
It can be overflow : 12345678901234go
[ka0r1@localhost ka0r1]$












0x80484a3 <main+27>:    lea    0xffffffe0(%ebp),%eax
0x80484a6 <main+30>:    push   %eax
0x80484a7 <main+31>:    call   0x804839c <fgets>
0x80484ac <main+36>:    add    $0xc,%esp¿ä
0x80484af <main+39>:    push   $0x2
0x80484b1 <main+41>:    push   $0x8048556
0x80484b6 <main+46>:    lea    0xfffffff4(%ebp),%eax


¿©±â¼­ 0xffffff4 - 0xffffffe0À» Çϴϱñ 14°¡ ³ª¿À´õ¶ó±¸¿ä
±×·¡¼­

12345678901234go¸¦ ÀÔ·ÂÇߴµ¥ /bin/bash¸¦ ½ÇÇàÇÏÁö ¸øÇß½À´Ï´Ù.
¹è¿­ °è»ê ¾î¶»°Ô ÇÏ´Â °Ç°¡¿ä?

  Hit : 1952     Date : 2017/12/14 12:46



    
±è´äº¯ 14°¡ ½ÊÁø¼ö°¡ ¾Æ´Ï¶ó 16Áø¼öÀÔ´Ï´Ù
0x14 = 20
°Å¸®Â÷ÀÌ°¡ 20³ª´Ï±î ¸ÕÀú 20°³ÀÇ ¾Æ¹« ¹®ÀÚ³ª ¾²½ÅÈÄ¿¡ go ¸¦ ¾²½Ã¸é µË´Ï´Ù
2017/12/14  
ka0r1 ±è´äº¯ // ÀÌ·± ¾îó±¸´Ï ¾ø´Â ½Ç¼ö°¡... 16Áø¼ö¶û ÇÞ°¥·È³ªº¾´Ï´Ù.
´äº¯ÇØÁּż­ °¨»çÇÕ´Ï´Ù.
2017/12/14  
1574   pwnable.kr echo1 Áú¹®2 (½ºÆ÷ ÁÖÀÇ)[2]     turttle2s
10/05 1232
1573   LOB GATE¹®Á¦ Ç®¸é¼­ ±Ã±ÝÇÑÁ¡[3]     hackxx123
08/24 921
1572   libc°ü·Ã - 2[5]     lMaxl04
08/24 879
1571   ASLRÀÌ °É·ÁÀÖÀ»¶§ ret¿¡ ROPÀ¸·Î jmp %espÀ» »ç¿ëÇÑ °æ¿ì.[3]     lMaxl04
06/29 1140
1570   ¸®¸ðÆ® ȯ°æ¿¡¼­ÀÇ ½ºÅà ÁÖ¼Ò È®ÀÎ ¹æ¹ýÀÌ ±Ã±ÝÇÕ´Ï´Ù.[2]     lMaxl04
06/16 936
1569   ÇØÅ· ÇÁ¸®¼­¹ö ¾ø¾îÁ³³ª¿ä?[1]     terfkim
04/15 1716
1568   ½ºÅÿ¡ µ¥ÀÌÅÍ ³ÖÀ» ¶§ SIGSEGV[4]     turttle2s
02/04 1448
1567   pwnable.kr echo1 Áú¹®[2]     turttle2s
06/17 1724
1566   ROP strcpy °ü·Ã Áú¹®ÀÔ´Ï´Ù.[3]     heeyoung0511
06/16 1569
1565   Level2 -> Level3 ¿¡¼­ vi¿Í /usr/bin/EditorÀÇ Â÷ÀÌ[2]     hyemin1826
07/18 1824
1564   Trainer3 ftz.hackerschool.org È£½ºÆ® Á¢¼Ó ºÒ°¡[1]     hyemin1826
07/18 3212
1563   dllÀÎÁ§¼Ç ½ÇÇèÁß Áú¹® µå¸³´Ï´Ù.[1]     kkk477
05/31 1840
1562   ÆÐŶ º¹È£È­¸¦ ¸¶½ºÅÍ ÇÏ·Á¸é ¾î¶² °úÁ¤ÀÌ ÀÖ¾î¾ßÇϳª¿ä?     sa0814
04/01 1687
1561   »ç±â[2]     jas08
03/31 1980
1560   ½Ã½ºÅÛ ÄÝÀÌ °¡´ÉÇÑ ¸Þ¸ð¸® ¿µ¿ª°ú ºÒ°¡´ÉÇÑ ¸Þ¸ð¸® ¿µ¿ªÀÌ Á¸ÀçÇϳª¿ä?     ocal
03/30 1725
1559   pwntools »ç¿ë½Ã¿Í ±âº» socket ¸ðµâ ÀÌ¿ë½Ã Â÷ÀÌ?[4]     ocal
01/09 2259
1558   lob level19(nightmare) °ü·ÃÁú¹®[1]     dnjsdnwja
12/18 1736
1557   ftz level2 Áú¹®ÀÖ½À´Ï´Ù[1]     kihyun1998
12/13 1825
1556   ftz level2¹ø Ǫ´Âµ¥¿ä ±ÇÇÑÀÌ...     kihyun1998
12/06 1702
1555   ½Ã½ºÅÛÇØÅ·ÇÒ¶§ [3]     thsrhkdwns
12/05 2184
1 [2][3][4][5][6][7][8][9][10]..[79]

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org