SlideShare a Scribd company logo
1 of 28
Buffer Overflow
Prepared by :
Qusai Nsour
BAU- Computer science master
2015
• In computer science, a data
buffer (or just buffer) is a region
of a physical memory storage
used to temporarily
store data while it is being moved
from one place to another.
• https://en.wikipedia.org/wiki/Data_buffer#Buffer_versus_cache
What is a Data buffer?- cont.
• The RP (resource pool) divides its
processor memory into pools.
Each pool contains a number of
memory blocks of equal size.
These memory blocks are called
buffers.
• http://www.cisco.com/c/en/us/support/docs/interfaces-modules/channel-interface-processors/14620-41.html
Why Buffers?
• Like a cache, a buffer is a
"midpoint holding place" but
exists not so much to accelerate
the speed of an activity as to
support the coordination of
separate activities.
• http://whatis.techtarget.com/definition/buffer
Bounded Buffers
• To minimize the amount of waiting time for
threads that share resources and operate at
the same average speeds, we can implement a
bounded buffer that provides a fixed number
of buffer cells into which the Producer can
place values, and from which the Consumer
can retrieve those values.
• Java™ How to Program, Seventh Edition By H. M. Deitel - Deitel & Associates, Inc., P. J.
Buffer failure
• Buffer Pools
There are six buffer pools:
1.Small—104 bytes buffers
2.Middle—600 byte buffers
3.Big—1524 byte buffers
4.VeryBig—4520 byte buffers
5.Large—5024 byte buffers
6.Huge—18024 byte buffers
Buffer failure – cont.
• For example, if an interface processor needs
to pass a 20 byte packet to the RP, it “asks” for
a Small buffer. If an interface processor needs
to pass a 500 byte packet to the RP, it asks for
a Middle buffer, and so forth.
• Note: The interface processor must ask for a
buffer of a certain size.
• When the interface processor asks for a buffer,
this occurs:
Buffer failure – cont.
• If a free buffer exists within the requested
pool, the buffer is granted. Otherwise, the
request generates a “miss” and the buffer
algorithm tries to “create” more buffers for
that pool .
Buffer failure – cont.
• When IOS fails to get a Small buffer, it does
not drop the packet. It increments the failed
counter and falls through to the next level
buffer, which is the Middle buffer and
requests a buffer there. If it fails to get a
Middle buffer, it requests the next level buffer,
which is a Big buffer. This process continues
until it hits the Huge buffer pool. If it fails to
get a Huge buffer, then it drops the packet.
Buffer failure – cont.
• When you use the IBM feature set, a miss
almost always generates a failure.
• Although the IBM features may be process-
switched, the code to get a buffer to pass a
packet from an interface to the RP executes
at interrupt level.
Buffer failure – cont.
• Buffers can not be created at interrupt level;
consequently, a miss queues its request for
more buffers to the RP.
• Because an additional buffer can not be
created on the spot, the buffer request fails,
and the packet is dropped.
Buffer failure – cont.
• Buffer failures are one of the most common reasons
for packet drops. When packet drops occur because of
buffer failure, this occurs:
• After a buffer failure, the RP has an outstanding
request to create more buffers of the appropriate size
for the particular pool.
• While the RP is servicing the create buffers request,
there may be additional failures in the pool.
• The RP may even fail to create more buffers, because
of memory constraints in the system when the extra
buffers are required.
Buffer failure – cont.
• Essentially, the create buffers operation could
take several microseconds, in which packets are
continually dropped because of the buffer
shortage.
• In addition, if buffers are used as quickly as they
are created, the RP could be forced to spend
more time on buffer creation than on packet
processing.
• This may cause the RP to begin to drop packets
so quickly that performance degrades and
sessions are lost.
• http://tools.cisco.com/search/results/en/us/get#q=buffer+overflow
How buffer overflow happens?
How buffer overflow happens? –cont.
• This a demo on c++
#include <stdio.h>
Int main()
{
Char str [20];
Gets (str);
Puts (str);
Return (0);
}
How buffer overflow happens? –cont.
• The string to get from
user is predefined to be
20 character in length
• The program will print
what the user send
using “puts”
How buffer overflow happens? –cont.
• Run the program using
cmd
How buffer overflow happens? –cont.
• Print anything ; say
Mohammad for
example
• The program will print
“mohammad”
How buffer overflow happens? –cont.
• Try typing
some thing
that is more
than 20 char.
• You will
receive the
warning
window as
shown at left
How buffer overflow happens? –cont.
• Expand the
warning
window and
check the
exception
offset to see
the error
• https://www.youtube.com/wat
ch?v=EekP8tuAuQw
What is a buffer overflow and how does it
work?
• A buffer is a temporary area for data storage.
When more data than was originally allocated
to be stored in a buffer gets placed there by a
program or system process, the extra data will
overflow, hence the name, causing some of
that data to leak out into other buffers, which
can corrupt or overwrite whatever data they
were holding.
What is a buffer overflow and how
does it work?- cont.
• In a buffer-overflow attack, the extra
data sometimes holds specific
instructions for actions intended by a
hacker or malicious user; for
example, the data could trigger a
response that damages files, changes
data or unveils private information.
What are buffer overflow types?
• Heap-based, which
are difficult to
execute and the
least common of the
two, attack an
application by
flooding the
memory space
reserved for a
program.
• Stack-based buffer
overflows, which are
more common
among hackers,
exploit applications
and programs by
using what is known
as a stack: memory
space used to store
user input.
How to stop a buffer overflow from
attacking applications
• 1. Avoid using library files: Library files, which
are used in programming language and are
inherently insecure, are a target for hackers
during application attacks. Any weakness
found by a hacker in a library file will also exist
in all applications that use that library file,
giving hackers a glaring target for a potential
attack.
How to stop a buffer overflow from
attacking applications – cont.
• 2. Filter user input: Filtering out possibly
dangerous HTML code and characters that
could cause database problems. For example,
in ASP code, the apostrophe, quotation mark
and ampersand symbols are all reserved
symbols. These reserved symbols can't be
included within a user's input or they will
cause the application to crash. Filter them out
and replace them with something else to
avoid complications and problems.
How to stop a buffer overflow from
attacking applications – cont.
• 3. Test applications: Be sure to test
all applications prior to deployment;
trying to break into every application
to ensure secure coding. If the
application breaks, it will be clear
that there is a problem that needs to
be fixed before a hacker is able to
exploit it.
• http://searchsecurity.techtarget.com/tip/How-to-stop-buffer-overflow-attacks-and-find-flaws-vulnerabilities

More Related Content

What's hot

Phishing attack, with SSL Encryption and HTTPS Working
Phishing attack, with SSL Encryption and HTTPS WorkingPhishing attack, with SSL Encryption and HTTPS Working
Phishing attack, with SSL Encryption and HTTPS WorkingSachin Saini
 
Password cracking and brute force
Password cracking and brute forcePassword cracking and brute force
Password cracking and brute forcevishalgohel12195
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecuritySanad Bhowmik
 
Exploitation techniques and fuzzing
Exploitation techniques and fuzzingExploitation techniques and fuzzing
Exploitation techniques and fuzzingG Prachi
 
Session10-PHP Misconfiguration
Session10-PHP MisconfigurationSession10-PHP Misconfiguration
Session10-PHP Misconfigurationzakieh alizadeh
 
VULNERABILITY ( CYBER SECURITY )
VULNERABILITY ( CYBER SECURITY )VULNERABILITY ( CYBER SECURITY )
VULNERABILITY ( CYBER SECURITY )Kashyap Mandaliya
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applicationsAdeel Javaid
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurationsMegha Sahu
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug BountiesOWASP Nagpur
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingNetsparker
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Moataz Kamel
 

What's hot (20)

Phishing attack, with SSL Encryption and HTTPS Working
Phishing attack, with SSL Encryption and HTTPS WorkingPhishing attack, with SSL Encryption and HTTPS Working
Phishing attack, with SSL Encryption and HTTPS Working
 
Password cracking and brute force
Password cracking and brute forcePassword cracking and brute force
Password cracking and brute force
 
Password Cracking
Password CrackingPassword Cracking
Password Cracking
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
 
Evolution of Hacking- Ronit Chakraborty .pptx
Evolution of Hacking- Ronit Chakraborty .pptxEvolution of Hacking- Ronit Chakraborty .pptx
Evolution of Hacking- Ronit Chakraborty .pptx
 
Exploitation techniques and fuzzing
Exploitation techniques and fuzzingExploitation techniques and fuzzing
Exploitation techniques and fuzzing
 
Session10-PHP Misconfiguration
Session10-PHP MisconfigurationSession10-PHP Misconfiguration
Session10-PHP Misconfiguration
 
VULNERABILITY ( CYBER SECURITY )
VULNERABILITY ( CYBER SECURITY )VULNERABILITY ( CYBER SECURITY )
VULNERABILITY ( CYBER SECURITY )
 
Email security
Email securityEmail security
Email security
 
Network security and viruses
Network security and virusesNetwork security and viruses
Network security and viruses
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
 
security misconfigurations
security misconfigurationssecurity misconfigurations
security misconfigurations
 
Chapter 2 program-security
Chapter 2 program-securityChapter 2 program-security
Chapter 2 program-security
 
Web security
Web securityWeb security
Web security
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 

Similar to Buffer overflow

Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
memorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptxmemorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptxshahdivyanshu1002
 
Unit I Memory technology and optimization
Unit I Memory technology and optimizationUnit I Memory technology and optimization
Unit I Memory technology and optimizationK Gowsic Gowsic
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureShweta Ghate
 
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
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangLyon Yang
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache frameworkMohammed Fazuluddin
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cacheMichael Nokhamzon
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLArnab Biswas
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
 
Managing Memory & Locks - Series 1 Memory Management
Managing  Memory & Locks - Series 1 Memory ManagementManaging  Memory & Locks - Series 1 Memory Management
Managing Memory & Locks - Series 1 Memory ManagementDAGEOP LTD
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyserAlex Moskvin
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practiceswebuploader
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 

Similar to Buffer overflow (20)

Buffer overflow
Buffer overflowBuffer overflow
Buffer overflow
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
memorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptxmemorytechnologyandoptimization-140416131506-phpapp02.pptx
memorytechnologyandoptimization-140416131506-phpapp02.pptx
 
Unit I Memory technology and optimization
Unit I Memory technology and optimizationUnit I Memory technology and optimization
Unit I Memory technology and optimization
 
Memory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer ArchitechtureMemory technology and optimization in Advance Computer Architechture
Memory technology and optimization in Advance Computer Architechture
 
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)
 
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon YangPractical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
Practical IoT Exploitation (DEFCON23 IoTVillage) - Lyon Yang
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
 
Share point 2013 distributed cache
Share point 2013 distributed cacheShare point 2013 distributed cache
Share point 2013 distributed cache
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 
Managing Memory & Locks - Series 1 Memory Management
Managing  Memory & Locks - Series 1 Memory ManagementManaging  Memory & Locks - Series 1 Memory Management
Managing Memory & Locks - Series 1 Memory Management
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
scale_perf_best_practices
scale_perf_best_practicesscale_perf_best_practices
scale_perf_best_practices
 
Cache optimization
Cache optimizationCache optimization
Cache optimization
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 

More from قصي نسور

Applying formal specifications on prometheus methodology
Applying formal specifications on prometheus methodologyApplying formal specifications on prometheus methodology
Applying formal specifications on prometheus methodologyقصي نسور
 
Dental health care center simulation
Dental health care center simulationDental health care center simulation
Dental health care center simulationقصي نسور
 
Hybrid elliptic curve cryptography using ant colony
Hybrid elliptic curve cryptography using ant colonyHybrid elliptic curve cryptography using ant colony
Hybrid elliptic curve cryptography using ant colonyقصي نسور
 
Network layer - design Issues
Network layer - design IssuesNetwork layer - design Issues
Network layer - design Issuesقصي نسور
 

More from قصي نسور (8)

Applying formal specifications on prometheus methodology
Applying formal specifications on prometheus methodologyApplying formal specifications on prometheus methodology
Applying formal specifications on prometheus methodology
 
Dental health care center simulation
Dental health care center simulationDental health care center simulation
Dental health care center simulation
 
Sales course
Sales courseSales course
Sales course
 
Hybrid elliptic curve cryptography using ant colony
Hybrid elliptic curve cryptography using ant colonyHybrid elliptic curve cryptography using ant colony
Hybrid elliptic curve cryptography using ant colony
 
Ant colony algorithm
Ant colony algorithmAnt colony algorithm
Ant colony algorithm
 
Elliptic curve protocol
Elliptic curve protocolElliptic curve protocol
Elliptic curve protocol
 
Network layer - design Issues
Network layer - design IssuesNetwork layer - design Issues
Network layer - design Issues
 
Aries
AriesAries
Aries
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

Buffer overflow

  • 2. Prepared by : Qusai Nsour BAU- Computer science master 2015
  • 3. • In computer science, a data buffer (or just buffer) is a region of a physical memory storage used to temporarily store data while it is being moved from one place to another. • https://en.wikipedia.org/wiki/Data_buffer#Buffer_versus_cache
  • 4. What is a Data buffer?- cont. • The RP (resource pool) divides its processor memory into pools. Each pool contains a number of memory blocks of equal size. These memory blocks are called buffers. • http://www.cisco.com/c/en/us/support/docs/interfaces-modules/channel-interface-processors/14620-41.html
  • 5. Why Buffers? • Like a cache, a buffer is a "midpoint holding place" but exists not so much to accelerate the speed of an activity as to support the coordination of separate activities. • http://whatis.techtarget.com/definition/buffer
  • 6. Bounded Buffers • To minimize the amount of waiting time for threads that share resources and operate at the same average speeds, we can implement a bounded buffer that provides a fixed number of buffer cells into which the Producer can place values, and from which the Consumer can retrieve those values. • Java™ How to Program, Seventh Edition By H. M. Deitel - Deitel & Associates, Inc., P. J.
  • 7. Buffer failure • Buffer Pools There are six buffer pools: 1.Small—104 bytes buffers 2.Middle—600 byte buffers 3.Big—1524 byte buffers 4.VeryBig—4520 byte buffers 5.Large—5024 byte buffers 6.Huge—18024 byte buffers
  • 8. Buffer failure – cont. • For example, if an interface processor needs to pass a 20 byte packet to the RP, it “asks” for a Small buffer. If an interface processor needs to pass a 500 byte packet to the RP, it asks for a Middle buffer, and so forth. • Note: The interface processor must ask for a buffer of a certain size. • When the interface processor asks for a buffer, this occurs:
  • 9. Buffer failure – cont. • If a free buffer exists within the requested pool, the buffer is granted. Otherwise, the request generates a “miss” and the buffer algorithm tries to “create” more buffers for that pool .
  • 10. Buffer failure – cont. • When IOS fails to get a Small buffer, it does not drop the packet. It increments the failed counter and falls through to the next level buffer, which is the Middle buffer and requests a buffer there. If it fails to get a Middle buffer, it requests the next level buffer, which is a Big buffer. This process continues until it hits the Huge buffer pool. If it fails to get a Huge buffer, then it drops the packet.
  • 11. Buffer failure – cont. • When you use the IBM feature set, a miss almost always generates a failure. • Although the IBM features may be process- switched, the code to get a buffer to pass a packet from an interface to the RP executes at interrupt level.
  • 12. Buffer failure – cont. • Buffers can not be created at interrupt level; consequently, a miss queues its request for more buffers to the RP. • Because an additional buffer can not be created on the spot, the buffer request fails, and the packet is dropped.
  • 13. Buffer failure – cont. • Buffer failures are one of the most common reasons for packet drops. When packet drops occur because of buffer failure, this occurs: • After a buffer failure, the RP has an outstanding request to create more buffers of the appropriate size for the particular pool. • While the RP is servicing the create buffers request, there may be additional failures in the pool. • The RP may even fail to create more buffers, because of memory constraints in the system when the extra buffers are required.
  • 14. Buffer failure – cont. • Essentially, the create buffers operation could take several microseconds, in which packets are continually dropped because of the buffer shortage. • In addition, if buffers are used as quickly as they are created, the RP could be forced to spend more time on buffer creation than on packet processing. • This may cause the RP to begin to drop packets so quickly that performance degrades and sessions are lost. • http://tools.cisco.com/search/results/en/us/get#q=buffer+overflow
  • 15.
  • 17. How buffer overflow happens? –cont. • This a demo on c++ #include <stdio.h> Int main() { Char str [20]; Gets (str); Puts (str); Return (0); }
  • 18. How buffer overflow happens? –cont. • The string to get from user is predefined to be 20 character in length • The program will print what the user send using “puts”
  • 19. How buffer overflow happens? –cont. • Run the program using cmd
  • 20. How buffer overflow happens? –cont. • Print anything ; say Mohammad for example • The program will print “mohammad”
  • 21. How buffer overflow happens? –cont. • Try typing some thing that is more than 20 char. • You will receive the warning window as shown at left
  • 22. How buffer overflow happens? –cont. • Expand the warning window and check the exception offset to see the error • https://www.youtube.com/wat ch?v=EekP8tuAuQw
  • 23. What is a buffer overflow and how does it work? • A buffer is a temporary area for data storage. When more data than was originally allocated to be stored in a buffer gets placed there by a program or system process, the extra data will overflow, hence the name, causing some of that data to leak out into other buffers, which can corrupt or overwrite whatever data they were holding.
  • 24. What is a buffer overflow and how does it work?- cont. • In a buffer-overflow attack, the extra data sometimes holds specific instructions for actions intended by a hacker or malicious user; for example, the data could trigger a response that damages files, changes data or unveils private information.
  • 25. What are buffer overflow types? • Heap-based, which are difficult to execute and the least common of the two, attack an application by flooding the memory space reserved for a program. • Stack-based buffer overflows, which are more common among hackers, exploit applications and programs by using what is known as a stack: memory space used to store user input.
  • 26. How to stop a buffer overflow from attacking applications • 1. Avoid using library files: Library files, which are used in programming language and are inherently insecure, are a target for hackers during application attacks. Any weakness found by a hacker in a library file will also exist in all applications that use that library file, giving hackers a glaring target for a potential attack.
  • 27. How to stop a buffer overflow from attacking applications – cont. • 2. Filter user input: Filtering out possibly dangerous HTML code and characters that could cause database problems. For example, in ASP code, the apostrophe, quotation mark and ampersand symbols are all reserved symbols. These reserved symbols can't be included within a user's input or they will cause the application to crash. Filter them out and replace them with something else to avoid complications and problems.
  • 28. How to stop a buffer overflow from attacking applications – cont. • 3. Test applications: Be sure to test all applications prior to deployment; trying to break into every application to ensure secure coding. If the application breaks, it will be clear that there is a problem that needs to be fixed before a hacker is able to exploit it. • http://searchsecurity.techtarget.com/tip/How-to-stop-buffer-overflow-attacks-and-find-flaws-vulnerabilities