SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Exploit Development
Win32 Buffer Overflow Exploitation
By
Kyaw Thiha
Whoami?
• Info-sec analyst
• Currently working at Kernellix
• Ex-team member of mmCERT
• Participate some bug bounty programs
Prerequisties Knowledge
• Memory stack
• CPU Register
• Knowledge on assembly language
• Buffer overflow attack
• Understanding Shellcode
CPU Register
General Purpose Registers
EAX EBX ECX EDX
Segment Registers
CS DS SS ES FS GS
CPU Register
Index and Pointer Register
EFLAGS Registers
EDIESI EBP ESP EIP
EFLAGS
General Purpose Registers
Base register It is used as a base pointer for memory access Gets some
interrupt return values
EAX
EBX
ECX
EDX
Counter register It is used as a loop counter and for shifts Gets some
interrupt values
Accumulator register.It is used for I/O port access, arithmetic, interrupt
calls, etc...
Data register It is used for I/O port access, arithmetic, some interruptcalls.
Segment Registers
Holds the Data segment that your program accesses. Changing its value
might give erronous data.
CS
DS
SS
ES
FS
GP
These are extra segment registers available for far pointer addressing like
video memory and such.
Holds the Stack segment your program uses. Sometimes has the same value as
DS.Changing its value can give unpredictable results, mostly data related.
Holds the Code segment in which your program runs. Changing its value
might make the computer hang.
Index and pointer Registers
EDI
ESI
ESP
EBP
Data Pointer Register for memory operations
Stack Pointer Register
Stack Data Pointer Register
EIP Next Instruction
EFLAGSRegisters
Bit Label Desciption
---------------------------
0 CF Carry flag
2 PF Parity flag
4 AF Auxiliary carry flag
6 ZF Zero flag
7 SF Sign flag
8 TF Trap flag
9 IF Interrupt enable flag
10 DF Direction flag
11 11 OF Overflow flag
12-13 IOPL I/O Priviledge level
14 NT Nested task flag
16 RF Resume flag
17 VM Virtual 8086 mode flag
18 AC Alignment check flag (486+)
19 VIF Virutal interrupt flag
20 VIP Virtual interrupt pending flag
21 ID ID flag
Those that are not listed are reserved by Intel.
General Purpose Register
EAX
AX
31 0
31 01516
AH AL
07815
Program Memory Layout
Stack
Unused
Memory
Heap
.bss
.data
.text
Used for stroing function
Dynamic Memory
Unintialize Data
Intialize Data
Program Code
0xffffffff
0x80961025
What is Buffer Overflow?
A buffer overflow condition exists when a program attempts to put
more data in a buffer than it can hold or when a program attempts to
put data in a memory area past a buffer
What is Buffer Overflow?
Environments Affected
Almost all known web servers, application servers, and web application
environments are susceptible to buffer overflows, the notable exception
being environments written in interpreted languages like Java or Python,
which are immune to these attacks (except for overflows in the Interpretor
itself).
Stack Layout
EIP
EBP
EBX
EAX
High Memory
Low Memory
Data
Data
Instruction
Sample Stack Overflow
AAAA
AAAA
AAAA
AAAA
High Memory
Low Memory
Data
Data
Instruction
Vul code sample
 Array
int [20];
int [20][5];
int [20][5][3];
 Format Strings;
printf(), fprint(),sprint(),sprintf()
 Overflow
strcpy()
strcat()
sprintf()
vsprint()
scanf()
Sample Program
GetInput()
{
char buffer[8];
gets(buffer);
puts(buffer);
}
Sample Program
Demo
• Prerequisites
• Freefloat FTP
• Debugger
• Python
• Metasploit
Fuzzing – the very first step
• Need to know crash point
• Need to know vul command
Fuzzing Framework
• Spike
• Sulley
• Peach
Overwrite EIP
Know Crash Point
Know crash point
Program stack
Buffer EIP Shellcode NOPs
Esp
Jmp esp
Control EIP
Shellcode Generate
Final Payload
Final Payload
Thanks !
Question ??

Weitere ähnliche Inhalte

Andere mochten auch

“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
“Nurturing International Talent from Ireland’s Largest Higher Education Insti...“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
Asia Matters
 
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
Duy Quang Nguyen Ly
 
Lake tahoe basin
Lake tahoe basinLake tahoe basin
Lake tahoe basin
Perry Quinn
 

Andere mochten auch (20)

Tersine Mühendislik 101
Tersine Mühendislik 101Tersine Mühendislik 101
Tersine Mühendislik 101
 
Exploit techniques and mitigation
Exploit techniques and mitigationExploit techniques and mitigation
Exploit techniques and mitigation
 
"Jiangsu Region: The Economic Gateway to China" Liang Baolin
"Jiangsu Region: The Economic Gateway to China" Liang Baolin "Jiangsu Region: The Economic Gateway to China" Liang Baolin
"Jiangsu Region: The Economic Gateway to China" Liang Baolin
 
"Attracting Blue Chip Chinese Firms to Establish a European Base in Ireland" ...
"Attracting Blue Chip Chinese Firms to Establish a European Base in Ireland" ..."Attracting Blue Chip Chinese Firms to Establish a European Base in Ireland" ...
"Attracting Blue Chip Chinese Firms to Establish a European Base in Ireland" ...
 
Eileen Sharpe, Director of Growth Markets, IDA Ireland, Asia Business Week Du...
Eileen Sharpe, Director of Growth Markets, IDA Ireland, Asia Business Week Du...Eileen Sharpe, Director of Growth Markets, IDA Ireland, Asia Business Week Du...
Eileen Sharpe, Director of Growth Markets, IDA Ireland, Asia Business Week Du...
 
Pets2015 slideshow
Pets2015 slideshowPets2015 slideshow
Pets2015 slideshow
 
"The Asian Opportunity: New Profitable Markets for Ireland’s Most Important I...
"The Asian Opportunity: New Profitable Markets for Ireland’s Most Important I..."The Asian Opportunity: New Profitable Markets for Ireland’s Most Important I...
"The Asian Opportunity: New Profitable Markets for Ireland’s Most Important I...
 
Opetus Erp
Opetus ErpOpetus Erp
Opetus Erp
 
“Delivering Real Education Partnership between Asia and Ireland” Professor Ci...
“Delivering Real Education Partnership between Asia and Ireland” Professor Ci...“Delivering Real Education Partnership between Asia and Ireland” Professor Ci...
“Delivering Real Education Partnership between Asia and Ireland” Professor Ci...
 
“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
“Nurturing International Talent from Ireland’s Largest Higher Education Insti...“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
“Nurturing International Talent from Ireland’s Largest Higher Education Insti...
 
UK Sport
UK SportUK Sport
UK Sport
 
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
Mientayvn.com.giao trinh moi_eagle_5_6_vutbay_net_3191
 
What is xml
What is xmlWhat is xml
What is xml
 
Opetus Admission Module
Opetus Admission ModuleOpetus Admission Module
Opetus Admission Module
 
“In Pursuit of Excellence: Creating a Global University” Professor Andrew Deeks
“In Pursuit of Excellence: Creating a Global University” Professor Andrew Deeks“In Pursuit of Excellence: Creating a Global University” Professor Andrew Deeks
“In Pursuit of Excellence: Creating a Global University” Professor Andrew Deeks
 
Constructivism
ConstructivismConstructivism
Constructivism
 
Lake tahoe basin
Lake tahoe basinLake tahoe basin
Lake tahoe basin
 
"New Realities in Asian Markets for Ireland:The Success of Origin Green" Aida...
"New Realities in Asian Markets for Ireland:The Success of Origin Green" Aida..."New Realities in Asian Markets for Ireland:The Success of Origin Green" Aida...
"New Realities in Asian Markets for Ireland:The Success of Origin Green" Aida...
 
Opetus erp
Opetus erpOpetus erp
Opetus erp
 
GD_EDMEDIA_061814
GD_EDMEDIA_061814GD_EDMEDIA_061814
GD_EDMEDIA_061814
 

Ähnlich wie Exploit Development

Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
Ahmed M. Abed
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
Ashim Saha
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
Alxus Shuvo
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
EstelaJeffery653
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
Abha Damani
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
sean chen
 
Intel x86 Architecture
Intel x86 ArchitectureIntel x86 Architecture
Intel x86 Architecture
ChangWoo Min
 

Ähnlich wie Exploit Development (20)

x86_1.ppt
x86_1.pptx86_1.ppt
x86_1.ppt
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Coal (1)
Coal (1)Coal (1)
Coal (1)
 
486 or 80486 DX Architecture
486 or 80486 DX Architecture486 or 80486 DX Architecture
486 or 80486 DX Architecture
 
AllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW SecurityAllBits presentation - Lower Level SW Security
AllBits presentation - Lower Level SW Security
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
 
Microprocessor 8086 and Microcontoller
Microprocessor 8086 and MicrocontollerMicroprocessor 8086 and Microcontoller
Microprocessor 8086 and Microcontoller
 
8086 MICROPROCESSOR
8086 MICROPROCESSOR8086 MICROPROCESSOR
8086 MICROPROCESSOR
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SFO17-203
 
The Cell Processor
The Cell ProcessorThe Cell Processor
The Cell Processor
 
Internal microprocessor architecture
Internal microprocessor architectureInternal microprocessor architecture
Internal microprocessor architecture
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
 
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SAN19-118
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SAN19-118Reliability, Availability, and Serviceability (RAS) on ARM64 status - SAN19-118
Reliability, Availability, and Serviceability (RAS) on ARM64 status - SAN19-118
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
Ceph Day Seoul - Delivering Cost Effective, High Performance Ceph cluster
Ceph Day Seoul - Delivering Cost Effective, High Performance Ceph cluster Ceph Day Seoul - Delivering Cost Effective, High Performance Ceph cluster
Ceph Day Seoul - Delivering Cost Effective, High Performance Ceph cluster
 
Intel x86 Architecture
Intel x86 ArchitectureIntel x86 Architecture
Intel x86 Architecture
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
 

Exploit Development