SlideShare a Scribd company logo
Stack-Based Buffer
Overflows
Joni Hall and Daniel Tumser
Overview
=>
Table of Contents
● Introduction
● Related Works
● Technical Aspects
● Careers and Jobs
● Social Impact
● Ethical Impact
● Conclusion
● References
Introduction
● occurs when a program writes to a memory address outside of (usually) a
fixed-length buffer
● results in data corruption, the stopping of a program, or the program to
operate incorrectly
● deliberately overflowing a buffer is an attack known as stack smashing
● can be exploited to inject executable code into the running program and
take control of the process
o gain unauthorized access to a computer
Related Works
● 1962 - Burroughs B5000 designed first implementation of memory segmentation
● 1978 - x86 Instruction Set Architecture memory segmentation introduced on Intel 8086
● 1996 - “Smashing the Stack for Fun and Profit” by Elias Levy published in Phrack issue 49
● 2001 - Code Red Worm exploits buffer overflow in Microsoft’s Internet Information Services
● 2003 - SQL Slammer Worm compromises machines running Microsoft SQL Server 2000
● 2003 - Buffer overflows in Xbox games allow unlicensed software to run on console
o followed by PS2
o followed by Nintendo Wii (this one specifically a Stack-Based Buffer Overflow)
Technical Aspects
● A logical stack
● Variable size memory
segment containing
function variables,
parameters, and
context
● Grows from higher
memory addresses to
lower addresses
● Divided into Stack
Frames via pointers
stored in CPU
registers
The Stack & Stack Frames
Technical Aspects
● Instruction Pointer (32-bit EIP or 64-bit RIP)
o Holds address of the next instruction to be executed
o Next address after a function call is pushed onto the stack
as the Return Address to continue execution when the
function completes/returns.
o Overwriting this is the danger of a stack buffer
overflow
● Stack Frame pointers
o EBP points to the address at the base of the stack frame
just above the return address
o ESP points to the top memory address of the stack frame
● There are more registers but not necessarily relevant in this
case
x86 Registers
eg.
EIP: 004013C2
EBP: 0028FEB8
ESP: 0028FE80
Technical Aspects
● A buffer is a block of memory for storing some
data
● A buffer on Youtube stores a portion of the video
that can be watched, and loads more as you go,
as well as makes sure enough has loaded to
compensate for some lost packets
(ex. “buffering”)
● In this case it’s a block of memory (character
arrays) for storing user input
● Buffers declared with Malloc(), Calloc(),
Realloc() will be stored in the Heap.
● The buffers created in this example go in the
Stack.
What’s a buffer?
Technical Aspects
With input strings of the proper length the
program executes as normal and returns without
error.
With a 2nd string input of length 22(+1 for string
terminator) it is overflowed and overwrites what is
immediately below that buffer in the stack. In this
case it overflows the 1st string input.
Function context (base pointer, return address)
isn’t overwritten, so program returns without an
exception thrown.
Examples’ Output
Technical Aspects
● OllyDbg with Vuln2.exe
loaded and execution
paused
● Window divided into 4
panes
o Top-left is the Code
memory segment
o Top-Right are CPU
registers
o Bottom-Reft is the
Data segment
o Bottom-Right is the
Stack
OllyDbg of Example
Technical Aspects
Stack Frame (no overflow)
Technical Aspects
Stack Frame (with overflow)
Technical Aspects
ContrastNo Overflow Overflowed
Technical Aspects
Same exact buffer overflow as in previous examples
but with user input instead of hardcoded strcpy()
Stack pane shows 10 bytes between end of our
overflowed buffer to the beginning of Return Address.
Return Addr is a pointer, x86 is 32-bit, so it’s a 4 byte
address. The 4 characters (8 hex digits) after the 10th
additional character will become the new return addr.
When function returns Return Addr is loaded into the
Instruction pointer
Overwriting Return Addr
Technical Aspects
EIP successfully overwritten with user input, in this case
four A characters, or hex-41.
User can now control program execution flow with the
Instruction pointer and execute code with this process’s
privileges.
Overwriting Return Addr
Career Impact & Job Outlook
Information Security Analyst
● 2012 - 2022 job growth
o +37%
o more than 2x the total of all occupations
● Median Salary
o $86, 170
o 2.4x total of all occupations
Vulnerability Analyst
Career Impact & Job Outlook
● Skills
o security risk management
o security intrusion detection
o IT security infrastructure
o security testing and auditing
o x86/x86_64 & Fuzzing*
● Minimum Qualifications
o Bachelor’s in CS,
Engineering or
Programming
o CompTIA Security+
Vulnerability Analyst
Career Impact & Job Outlook
Software Developer
● Job Growth 2012-2022
o +22%
o +222,600 jobs
● Median Salary
o $93,350
o x2.69 national median
Software Engineer
Career Impact & Job Outlook
Software Engineer
● Skills
○ Python
○ C
○ C++
○ UNIX
○ Linux
● Minimum Requirements
○ Bachelor’s Degree in
Computer Science or
Software Engineering
○ Programming experience
Social Impact
● Too esoteric for widespread social
impact
● Should affect coding practices of
CS and IT professionals
Write secure code.
Make your coworkers write secure code
Bounds check all the buffers
Ethical Impact
Code you produce is the responsibility of yourself
and the organization you produce it for.
Both have an ethical obligation to customers to
provide secure code.
To write secure code you need to understand the
vulnerability and how it’s exploited
Patch vulnerabilities that are discovered in
development or in the wild.
Vulnerability discovery and proofs of concept are
not illegal, and obtaining a Common
Vulnerabilities and Exposures (CVE) number for
your work looks great on a resume.
Vulnerability disclosure often negotiated and
timed with the software vendor for patching.
Exploiting vulnerabilities for unauthorized access
of computer systems still very illegal. Don’t do it
unless you’re cool with the risk of fines and prison
time.
Coding Vulnerability Analysis
Conclusion
● Overflowing a buffer may result in a program crash, program errors, or
data corruption
● CS and IT professionals should write more secure code to prevent it from
happening
● Exploiting a buffer overflow is one of the oldest ways to gain unauthorized
access to a computer
● Don’t do it unless you are okay with fines and prison time!
References
1. Erickson, Jon. Hacking: the Art of Exploitation. 2nd ed. San Francisco, Calif.: No Starch, 2008.
Print.
2. Koziol, Jack. The Shellcoder's Handbook: Discovering and Exploiting Security Holes.
Indianapolis, IN: Wiley Pub., 2004. Print.
3. Levy, Elias. "Smashing the Stack for Fun and Profit." Phrack 49 (1996). Phrack. Web. 1 July
2015. <http://phrack.org/issues/49/14.html#article>.
4. "Information Security Analyst Salary (United States)." Information Security Analyst Salary
(United States). Web. 5 July 2015.
<http://www.payscale.com/research/US/Job=Information_Security_Analyst/Salary>.
5. "Software Engineer Salary (United States)." Software Engineer Salary (United States). Web. 5
July 2015. <http://www.payscale.com/research/US/Job=Software_Engineer/Salary>.
6. Staff Contributor. "Sourcefire VRT Unveils Research on 25 Years of Vulnerabilities: 1988-2012 |
| Sourcefire Blog." Sourcefire, 5 Mar. 2013. Web. 5 July 2015.
<http://blog.sourcefire.com/Post/2013/03/05/1362499920-sourcefire-vrt-unveils-research-on--
years-of-vulnerabilities-/>.
Stack-Based Buffer
Overflows
Joni Hall and Daniel Tumser

More Related Content

What's hot

Buffer overflow attacks
Buffer overflow attacksBuffer overflow attacks
Buffer overflow attacks
Japneet Singh
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basics
Cysinfo Cyber Security Community
 
Linux binary analysis and exploitation
Linux binary analysis and exploitationLinux binary analysis and exploitation
Linux binary analysis and exploitation
Dharmalingam Ganesan
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
Joxean Koret
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit development
Payampardaz
 
SEH based buffer overflow vulnerability exploitation
SEH based buffer overflow vulnerability exploitationSEH based buffer overflow vulnerability exploitation
SEH based buffer overflow vulnerability exploitation
Payampardaz
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1
Payampardaz
 
08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one
Alexandre Moneger
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
Malachi Jones
 
Introduction to ida python
Introduction to ida pythonIntroduction to ida python
Introduction to ida pythongeeksec80
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
Peter Hlavaty
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
enSilo
 
Buffer Overflow Countermeasures, DEP, Security Assessment
Buffer Overflow Countermeasures, DEP, Security AssessmentBuffer Overflow Countermeasures, DEP, Security Assessment
Buffer Overflow Countermeasures, DEP, Security Assessment
Amar Myana
 
Return oriented programming
Return oriented programmingReturn oriented programming
Return oriented programming
hybr1s
 
Exploitation techniques and fuzzing
Exploitation techniques and fuzzingExploitation techniques and fuzzing
Exploitation techniques and fuzzing
G Prachi
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av software
Thomas Pollet
 
JProfiler / an introduction
JProfiler / an introductionJProfiler / an introduction
JProfiler / an introductionTommaso Torti
 
Embedded device hacking Session i
Embedded device hacking Session iEmbedded device hacking Session i
Embedded device hacking Session i
Malachi Jones
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
Peter Hlavaty
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_en
Sunghun Kim
 

What's hot (20)

Buffer overflow attacks
Buffer overflow attacksBuffer overflow attacks
Buffer overflow attacks
 
Reversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basicsReversing malware analysis training part4 assembly programming basics
Reversing malware analysis training part4 assembly programming basics
 
Linux binary analysis and exploitation
Linux binary analysis and exploitationLinux binary analysis and exploitation
Linux binary analysis and exploitation
 
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage FuzzerThe Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
The Nightmare Fuzzing Suite and Blind Code Coverage Fuzzer
 
Dive into exploit development
Dive into exploit developmentDive into exploit development
Dive into exploit development
 
SEH based buffer overflow vulnerability exploitation
SEH based buffer overflow vulnerability exploitationSEH based buffer overflow vulnerability exploitation
SEH based buffer overflow vulnerability exploitation
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1
 
08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one08 - Return Oriented Programming, the chosen one
08 - Return Oriented Programming, the chosen one
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
 
Introduction to ida python
Introduction to ida pythonIntroduction to ida python
Introduction to ida python
 
How Safe is your Link ?
How Safe is your Link ?How Safe is your Link ?
How Safe is your Link ?
 
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
 
Buffer Overflow Countermeasures, DEP, Security Assessment
Buffer Overflow Countermeasures, DEP, Security AssessmentBuffer Overflow Countermeasures, DEP, Security Assessment
Buffer Overflow Countermeasures, DEP, Security Assessment
 
Return oriented programming
Return oriented programmingReturn oriented programming
Return oriented programming
 
Exploitation techniques and fuzzing
Exploitation techniques and fuzzingExploitation techniques and fuzzing
Exploitation techniques and fuzzing
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av software
 
JProfiler / an introduction
JProfiler / an introductionJProfiler / an introduction
JProfiler / an introduction
 
Embedded device hacking Session i
Embedded device hacking Session iEmbedded device hacking Session i
Embedded device hacking Session i
 
Hacking - high school intro
Hacking - high school introHacking - high school intro
Hacking - high school intro
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_en
 

Similar to Stack-Based Buffer Overflows

Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
kozossakai
 
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
CODE BLUE
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
Tomer Zait
 
Lab 2Lab ObjectivesThe objective for this lab is to review.docx
Lab 2Lab ObjectivesThe objective for this lab is to review.docxLab 2Lab ObjectivesThe objective for this lab is to review.docx
Lab 2Lab ObjectivesThe objective for this lab is to review.docx
DIPESH30
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
Brian Lyttle
 
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1  Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
securityxploded
 
Exploit development 101 - Part 1 - Null Singapore
Exploit development 101 - Part 1 - Null SingaporeExploit development 101 - Part 1 - Null Singapore
Exploit development 101 - Part 1 - Null Singapore
Mohammed A. Imran
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for MiddlewareManuel Brugnoli
 
Reverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debuggerReverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debugger
mahakant sharma
 
Ceh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflowCeh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflow
Vi Tính Hoàng Nam
 
Itroduction about java
Itroduction about javaItroduction about java
Itroduction about java
srmohan06
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
EstelaJeffery653
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012DefCamp
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
Student
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Elvin Gentiles
 
Parallel port programming
Parallel port programmingParallel port programming
Parallel port programmingmangal das
 
Reverse code engineering
Reverse code engineeringReverse code engineering
Reverse code engineering
Krishs Patil
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utility
IOSR Journals
 

Similar to Stack-Based Buffer Overflows (20)

Possibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented ProgrammingPossibility of arbitrary code execution by Step-Oriented Programming
Possibility of arbitrary code execution by Step-Oriented Programming
 
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
Possibility of arbitrary code execution by Step-Oriented Programming by Hiroa...
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
 
Lab 2Lab ObjectivesThe objective for this lab is to review.docx
Lab 2Lab ObjectivesThe objective for this lab is to review.docxLab 2Lab ObjectivesThe objective for this lab is to review.docx
Lab 2Lab ObjectivesThe objective for this lab is to review.docx
 
Production Debugging at Code Camp Philly
Production Debugging at Code Camp PhillyProduction Debugging at Code Camp Philly
Production Debugging at Code Camp Philly
 
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1  Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
Advanced Malware Analysis Training Session 2 - Botnet Analysis Part 1
 
Exploit development 101 - Part 1 - Null Singapore
Exploit development 101 - Part 1 - Null SingaporeExploit development 101 - Part 1 - Null Singapore
Exploit development 101 - Part 1 - Null Singapore
 
Resume
ResumeResume
Resume
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for Middleware
 
Reverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debuggerReverse engineering &amp; immunity debugger
Reverse engineering &amp; immunity debugger
 
Ceh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflowCeh v5 module 20 buffer overflow
Ceh v5 module 20 buffer overflow
 
Itroduction about java
Itroduction about javaItroduction about java
Itroduction about java
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
Parallel port programming
Parallel port programmingParallel port programming
Parallel port programming
 
Reverse code engineering
Reverse code engineeringReverse code engineering
Reverse code engineering
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utility
 

Recently uploaded

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Stack-Based Buffer Overflows

  • 3. Table of Contents ● Introduction ● Related Works ● Technical Aspects ● Careers and Jobs ● Social Impact ● Ethical Impact ● Conclusion ● References
  • 4. Introduction ● occurs when a program writes to a memory address outside of (usually) a fixed-length buffer ● results in data corruption, the stopping of a program, or the program to operate incorrectly ● deliberately overflowing a buffer is an attack known as stack smashing ● can be exploited to inject executable code into the running program and take control of the process o gain unauthorized access to a computer
  • 5. Related Works ● 1962 - Burroughs B5000 designed first implementation of memory segmentation ● 1978 - x86 Instruction Set Architecture memory segmentation introduced on Intel 8086 ● 1996 - “Smashing the Stack for Fun and Profit” by Elias Levy published in Phrack issue 49 ● 2001 - Code Red Worm exploits buffer overflow in Microsoft’s Internet Information Services ● 2003 - SQL Slammer Worm compromises machines running Microsoft SQL Server 2000 ● 2003 - Buffer overflows in Xbox games allow unlicensed software to run on console o followed by PS2 o followed by Nintendo Wii (this one specifically a Stack-Based Buffer Overflow)
  • 6. Technical Aspects ● A logical stack ● Variable size memory segment containing function variables, parameters, and context ● Grows from higher memory addresses to lower addresses ● Divided into Stack Frames via pointers stored in CPU registers The Stack & Stack Frames
  • 7. Technical Aspects ● Instruction Pointer (32-bit EIP or 64-bit RIP) o Holds address of the next instruction to be executed o Next address after a function call is pushed onto the stack as the Return Address to continue execution when the function completes/returns. o Overwriting this is the danger of a stack buffer overflow ● Stack Frame pointers o EBP points to the address at the base of the stack frame just above the return address o ESP points to the top memory address of the stack frame ● There are more registers but not necessarily relevant in this case x86 Registers eg. EIP: 004013C2 EBP: 0028FEB8 ESP: 0028FE80
  • 8. Technical Aspects ● A buffer is a block of memory for storing some data ● A buffer on Youtube stores a portion of the video that can be watched, and loads more as you go, as well as makes sure enough has loaded to compensate for some lost packets (ex. “buffering”) ● In this case it’s a block of memory (character arrays) for storing user input ● Buffers declared with Malloc(), Calloc(), Realloc() will be stored in the Heap. ● The buffers created in this example go in the Stack. What’s a buffer?
  • 9. Technical Aspects With input strings of the proper length the program executes as normal and returns without error. With a 2nd string input of length 22(+1 for string terminator) it is overflowed and overwrites what is immediately below that buffer in the stack. In this case it overflows the 1st string input. Function context (base pointer, return address) isn’t overwritten, so program returns without an exception thrown. Examples’ Output
  • 10. Technical Aspects ● OllyDbg with Vuln2.exe loaded and execution paused ● Window divided into 4 panes o Top-left is the Code memory segment o Top-Right are CPU registers o Bottom-Reft is the Data segment o Bottom-Right is the Stack OllyDbg of Example
  • 12. Technical Aspects Stack Frame (with overflow)
  • 14. Technical Aspects Same exact buffer overflow as in previous examples but with user input instead of hardcoded strcpy() Stack pane shows 10 bytes between end of our overflowed buffer to the beginning of Return Address. Return Addr is a pointer, x86 is 32-bit, so it’s a 4 byte address. The 4 characters (8 hex digits) after the 10th additional character will become the new return addr. When function returns Return Addr is loaded into the Instruction pointer Overwriting Return Addr
  • 15. Technical Aspects EIP successfully overwritten with user input, in this case four A characters, or hex-41. User can now control program execution flow with the Instruction pointer and execute code with this process’s privileges. Overwriting Return Addr
  • 16. Career Impact & Job Outlook Information Security Analyst ● 2012 - 2022 job growth o +37% o more than 2x the total of all occupations ● Median Salary o $86, 170 o 2.4x total of all occupations Vulnerability Analyst
  • 17. Career Impact & Job Outlook ● Skills o security risk management o security intrusion detection o IT security infrastructure o security testing and auditing o x86/x86_64 & Fuzzing* ● Minimum Qualifications o Bachelor’s in CS, Engineering or Programming o CompTIA Security+ Vulnerability Analyst
  • 18. Career Impact & Job Outlook Software Developer ● Job Growth 2012-2022 o +22% o +222,600 jobs ● Median Salary o $93,350 o x2.69 national median Software Engineer
  • 19. Career Impact & Job Outlook Software Engineer ● Skills ○ Python ○ C ○ C++ ○ UNIX ○ Linux ● Minimum Requirements ○ Bachelor’s Degree in Computer Science or Software Engineering ○ Programming experience
  • 20. Social Impact ● Too esoteric for widespread social impact ● Should affect coding practices of CS and IT professionals Write secure code. Make your coworkers write secure code Bounds check all the buffers
  • 21. Ethical Impact Code you produce is the responsibility of yourself and the organization you produce it for. Both have an ethical obligation to customers to provide secure code. To write secure code you need to understand the vulnerability and how it’s exploited Patch vulnerabilities that are discovered in development or in the wild. Vulnerability discovery and proofs of concept are not illegal, and obtaining a Common Vulnerabilities and Exposures (CVE) number for your work looks great on a resume. Vulnerability disclosure often negotiated and timed with the software vendor for patching. Exploiting vulnerabilities for unauthorized access of computer systems still very illegal. Don’t do it unless you’re cool with the risk of fines and prison time. Coding Vulnerability Analysis
  • 22. Conclusion ● Overflowing a buffer may result in a program crash, program errors, or data corruption ● CS and IT professionals should write more secure code to prevent it from happening ● Exploiting a buffer overflow is one of the oldest ways to gain unauthorized access to a computer ● Don’t do it unless you are okay with fines and prison time!
  • 23. References 1. Erickson, Jon. Hacking: the Art of Exploitation. 2nd ed. San Francisco, Calif.: No Starch, 2008. Print. 2. Koziol, Jack. The Shellcoder's Handbook: Discovering and Exploiting Security Holes. Indianapolis, IN: Wiley Pub., 2004. Print. 3. Levy, Elias. "Smashing the Stack for Fun and Profit." Phrack 49 (1996). Phrack. Web. 1 July 2015. <http://phrack.org/issues/49/14.html#article>. 4. "Information Security Analyst Salary (United States)." Information Security Analyst Salary (United States). Web. 5 July 2015. <http://www.payscale.com/research/US/Job=Information_Security_Analyst/Salary>. 5. "Software Engineer Salary (United States)." Software Engineer Salary (United States). Web. 5 July 2015. <http://www.payscale.com/research/US/Job=Software_Engineer/Salary>. 6. Staff Contributor. "Sourcefire VRT Unveils Research on 25 Years of Vulnerabilities: 1988-2012 | | Sourcefire Blog." Sourcefire, 5 Mar. 2013. Web. 5 July 2015. <http://blog.sourcefire.com/Post/2013/03/05/1362499920-sourcefire-vrt-unveils-research-on-- years-of-vulnerabilities-/>.