SlideShare ist ein Scribd-Unternehmen 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

Weitere ähnliche Inhalte

Was ist angesagt?

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 python
geeksec80
 
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 introduction
Tommaso 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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 
Resume
ResumeResume
Resume
Anil Kumar
 
Secure Coding Practices for Middleware
Secure Coding Practices for MiddlewareSecure Coding Practices for Middleware
Secure Coding Practices for Middleware
Manuel 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
 
Chapter three embedded system corse ppt AASTU.pdf
Chapter three embedded system corse ppt AASTU.pdfChapter three embedded system corse ppt AASTU.pdf
Chapter three embedded system corse ppt AASTU.pdf
MitikuAbebe2
 
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 2012
DefCamp
 
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 programming
mangal 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
 

Ähnlich wie 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
 
Chapter three embedded system corse ppt AASTU.pdf
Chapter three embedded system corse ppt AASTU.pdfChapter three embedded system corse ppt AASTU.pdf
Chapter three embedded system corse ppt AASTU.pdf
 
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
 

Kürzlich hochgeladen

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 

Kürzlich hochgeladen (20)

Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 

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-/>.