hlogin2



Similar documents
hlogin7

Deok9_Exploit Technique

No Slide Title

INTRO Basic architecture of modern computers Basic and most used assembly instructions on x86 Installing an assembly compiler and RE tools Practice co

Microsoft PowerPoint - a8a.ppt [호환 모드]

IDA 5.x Manual hwp

강의10

Linux Binary Hardening with Glibc Hyeonho Seo

01.ROP(Return Oriented Programming)-x86 Excuse the ads! We need some help to keep our site up. List Return Oriented Programming(ROP) -x86 Gadgets - PO

Reusing Dynamic Linker For Exploitation Author : Date : 2012 / 05 / 13 Contact : Facebook : fb.me/kwonpwn

PowerPoint Template

02( ) CSTV11-22.hwp

Microsoft PowerPoint - hy2-12.pptx

Microsoft PowerPoint - a10.ppt [호환 모드]

PowerPoint 프레젠테이션

Microsoft Word - Heap_Spray.doc

The_IDA_Pro_Book

Microsoft PowerPoint - a5a.ppt [호환 모드]

목 차 1. 개요 취약점분석추진배경 취약점요약 취약점정보 취약점대상시스템목록 분석 공격기법및기본개념 시나리오 공격코드

Microsoft PowerPoint - a2.ppt [호환 모드]

Microsoft PowerPoint - a6.ppt [호환 모드]

윤석언 - Buffer Overflow - 윤석언 제12회세미나 수원대학교보안동아리 FLAG

Microsoft PowerPoint - secu10.pptx

Microsoft Word - Reversing Engineering Code with IDA Pro-4-1.doc

6주차.key

Microsoft PowerPoint - a9.ppt [호환 모드]

untitled

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

02.Create a shellcode that executes "/bin/sh" Excuse the ads! We need some help to keep our site up. List Create a shellcode that executes "/bin/sh" C

Return-to-libc

11강-힙정렬.ppt

Microsoft Word - readme.doc

/* */

학습목차 r 컴퓨터본체에서 CPU 의위치살펴보기 r CPU 의성능 r CPU 의기능 r CPU 의조직 r 레지스터의조직 r 명령어사이클 r 명령어파이프라이닝 컴퓨터구조 2 9. CPU 조직과기능

Microsoft PowerPoint - a4.ppt [호환 모드]

Microsoft Word - building the win32 shellcode 01.doc

Microsoft Word - FunctionCall

Microsoft Word - Reverse Engineering Code with IDA Pro-2-1.doc

=

02 C h a p t e r Java

텀블러514

<BEEEBCC0BAEDB8AEBEEEC1A4B8AE2E687770>

various tricks for remote linux exploits v3.pptx

Index

Microsoft PowerPoint - a4.ppt [호환 모드]

<4D F736F F F696E74202D206D61696E D F6E D20C7C1B7CEBCBCBCAD20B7CEB5F920C8C420B8DEB8F0B8AE20B9D B20B1B8C1B6C0CCC7D8>

Microsoft Word - ExecutionStack

<BDC3B8AEBEF320B9F8C8A320C0DBBCBA20B7E7C6BEC0BB20BBCCBEC6B3BBBCAD D466F E687770>

2013년 1회 정보처리산업기사 실기.hwp

*세지6문제(306~316)OK

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

PowerPoint 프레젠테이션

(Microsoft PowerPoint - 1-2\300\345)

시스템 해킹 101

PowerPoint 프레젠테이션

chapter4

Microsoft PowerPoint - ch04_코드 보안 [호환 모드]

SRC PLUS 제어기 MANUAL

0x00 Contents 0x About Nickster 0x Analaysis 0x Exploit

목차 1. 제품 소개 특징 개요 Function table 기능 소개 Copy Compare Copy & Compare Erase

0x <main+41>: lea eax,[ebp-264] 0x f <main+47>: push eax 0x080484a0 <main+48>: call 0x804835c <strcpy> 0x080484a5 <main+53>: add esp,0x1

Microsoft PowerPoint - ch04_코드 보안 [호환 모드]

CKKeyPro 적용가이드

[8051] 강의자료.PDF

Table Of Contents 1/7 0. Introduction 0-1. Introduction 0-1. Testing Environment 1. Software Vulnerabilty Review 1-1. Buffer OverFlow 1-2. Format Stri

BOF Foundation.doc

Computer Security Chapter 08. Format String 김동진 1 Secure Software Lab.

untitled

Level 4 ( hell_fire -> evil_wizard ) ~]$ cat evil_wizard.c /* The Lord of the BOF : The Fellowship of the BOF - evil_wizard

Chapter 2

Microsoft Word - FS_ZigBee_Manual_V1.3.docx

DRB1598A

Mac OS X 이란.hwp

Smashing The Stack For Fun And Profit by Aleph One

목차 1. 소개... 3 가. BOF란?... 3 나. 윈도우 BOF 개발환경및사용툴 Shellcode 작성하기... 4 가. cmd 쉘 ) 소스코드작성 ) 디스어셈블리 ) 어셈블리코드편집 간단

TTA Verified : HomeGateway :, : (NEtwork Testing Team)

Macaron Cooker Manual 1.0.key

9

Microsoft PowerPoint - System Programming Lab Week1.ppt [호환 모드]

Microsoft Word - MS_rshd_exploit.doc

Deok9_PE Structure

구문 분석

2. GCC Assembler와 AVR Assembler의차이 A. GCC Assembler 를사용하는경우 i. Assembly Language Program은.S Extension 을갖는다. ii. C Language Program은.c Extension 을갖는다.

Fedora Core 3,4,5 stack overflow.docx

Chap7.PDF

Microsoft PowerPoint - polling.pptx

Here is a "PLDWorld.com"... // EXCALIBUR... // Additional Resources // µc/os-ii... Page 1 of 23 Additional Resources: µc/os-ii Author: Source: HiTEL D

Poison null byte Excuse the ads! We need some help to keep our site up. List 1 Conditions 2 Exploit plan 2.1 chunksize(p)!= prev_size (next_chunk(p) 3

본문서는 Syngress 의 Writing Security Tools and Exploits Chap11 을요약정리한 것입니다. 참고로 Chap 10 ~ 12 까지가 Metasploit 에대한설명입니다. Metasploit Framework 활용법 1. Metasplo

IPAK 윤리강령 나는 _ 한국IT전문가협회 회원으로서 긍지와 보람을 느끼며 정보시스템 활용하 자. 나는 _동료, 단체 및 국가 나아가 인류사회에 대하여 철저한 책임 의식을 가진 다. 나는 _ 활용자에 대하여 그 편익을 증진시키는데 최선을 다한다. 나는 _ 동료에 대해

IT CookBook, 정보보안개론 ( 개정판 ) [ 강의교안이용안내 ] 본강의교안의저작권은한빛아카데미 에있습니다. 이자료를무단으로전제하거나배포할경우저작권법 136 조에의거하여최고 5 년이하의징역또는 5 천만원이하의벌금에처할수있고이를병과 ( 倂科 ) 할수도있습니다.

익스플로잇실습 / 튜토리얼 Easy RM to MP3 Converter ROP [ Direct RET VirtualProtect() 함수사용 ] By WraithOfGhost

Microsoft PowerPoint - o8.pptx

Cogame 취약점 보고

Microsoft Word - 1. ARM Assembly 실습_xp2.doc

03장.스택.key

01.The basics technic of Shellcode Excuse the ads! We need some help to keep our site up. List Shellcode The basics of shellcode(ubuntu-16.04) C ASM M

MicrocontrollerAcademy_Lab_ST_040709

Microsoft PowerPoint APUE(Intro).ppt

hwp

Transcription:

0x02. Stack Corruption

off-limit Kernel Stack libc Heap BSS Data Code

off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code :

off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code :

* 1.. 2.. Stack libc Heap

Stack Corruption

ret2 0xbffffa26 parameter buf[] sfp ret parameter 0xbffff4c0.

ret2 0xbffffa26 parameter buf[] sfp ret parameter Saved Frame Pointer : EBP Return EBP SFP 0xbffff4c0.

ret2 0xbffffa26 parameter buf[] sfp ret parameter Saved Frame Pointer : EBP Return EBP SFP 0xbffff4c0.

Basic Stack corruption buf[20] sfp[4] ret[4] parameter 20byte 1234 4 byte 4 byte 4 byte 4 byte scanf( %s, buf); input buf = 1234

Basic Stack corruption sfp[4] ret[4] buf[20] ABCD HEHE parameter eip = 0x45484548 1234 1234 1234 1234 1234 scanf( %s, buf); input buf = 1234 * 5 + ABCD + HEHE buffer overflow

DEMO

Big Endian IBM SPARC Motorola Little Endian Intel x86 AMD DEC CPU Big Endian, Littie Endian, Big Endian, Little Endian.

Push EBP Mov EBP, ESP

Push EBP Mov EBP, ESP Stack Frame

Push EBP Mov EBP, ESP Stack Frame Stack Frame

Mov ESP, EBP Pop EBP

Mov ESP, EBP Pop EBP Stack pointer Caller function stack frame

Mov ESP, EBP Pop EBP Stack pointer Caller function stack frame EBP

Leave Mov ESP, EBP Pop EBP Ret Pop EIP Jmp EIP

cdecl stdcall fastcall

EIP Extend instruction pointer. EBP Extend Base pointer. ESP Extend Stack pointer.

A BB TEST BB ESP BB ESP A A A ESP PUSH A PUSH BB POP TEST Stack TEST = BB

ESP EBP push EBP call Function() Mov ebx, eax

ESP EBP push EBP call Function() Mov ebx, eax Push EBP Mov EBP, ESP

EBP push EBP call Function() - 4 ESP Mov ebx, eax Push EBP Mov EBP, ESP

EBP push EBP call Function() - 4 ESP Mov ebx, eax Push EBP Mov EBP, ESP Push A

EBP push EBP call Function() - 4 A Mov ebx, eax - 4 ESP Push EBP Mov EBP, ESP Push A

EBP push EBP call Function() - 4 A Mov ebx, eax - 4 ESP Push EBP Mov EBP, ESP Push A Push B Push 1234

EBP push EBP call Function() - 4 A Mov ebx, eax - 4-4 ESP B 1234 Push EBP Mov EBP, ESP Push A Push B Push 1234

EBP push EBP call Function() - 4 A Mov ebx, eax - 4-4 ESP B 1234 Push EBP Mov EBP, ESP Pop eax Push A Push B Push 1234

EBP push EBP call Function() - 4 A Mov ebx, eax + 4-4 - 4 ESP B 1234 Push EBP Mov EBP, ESP eax = 1234 Pop eax Push A Push B Push 1234

EBP push EBP call Function() - 4 ESP A Mov ebx, eax + 4 + 4-4 - 4 B 1234 Push EBP Mov EBP, ESP eax = 1234 Pop eax Pop ebx Push A Push B Push 1234

EBP push EBP call Function() - 4 ESP A Mov ebx, eax + 4 + 4-4 - 4 B 1234 Push EBP Mov EBP, ESP eax = 1234 ebx = B Pop eax Pop ebx Push A Push B Push 1234

ESP EBP push EBP call Function() + 4-4 A Mov ebx, eax + 4 + 4-4 - 4 B 1234 Push EBP Mov EBP, ESP eax = 1234 ebx = B ecx = A Pop eax Pop ebx Pop ecx Push A Push B Push 1234

EAX Extend Accumulator,. EBX Extend Base index. ECX Extend Counter,. EDX Extend Data, Eax. ESI / EDI Extend Source, Extend Destination cpu 32bit

.

1 Mov Eax, Ebx == Eax = Ebx 2 Add Eax, 1 == Eax = Eax + 1

.

gdb gdb -q [binary] gdb (?). run (r). continue (c). quit (q). disassemble (disas) [ ]

gdb info function break reg info break, delete (del) delete [number] (del [number])

gdb break (b) function. skip. b* function.. b* [address] break.

gdb stepi (si).. nexti (ni).,.

gdb print [function] (p) p $reg p/[ ] [ ] d x 10 16

gdb x/[ ][ ][ ] [ ] x/[ ]i [address] x/[ ]s [address] x/[ ]wx [address] 16 4byte

gdb set {type}[address] ex) set {int}0x8048300 = 100 set $[reg] ex) set $eip = 0x41414141

gdb set disassembly-flavor intel set disassembly-flavor att at&t

gdb set follow-fork-mode child gdb. set follow-exec-mode new exec gdb.

gdb finish u disas [address] [address]

DEP (Data Execution Prevention) ASLR (Address Space Layout Randomization) Stack Canary == SSP (Stack Smashing Protector) Ascii Armor