SlideShare a Scribd company logo
1
241-427-SV-2-2553-COE-PSU 1
241-427 Computer Security
Chapter VIII: Malicious programs
Dr. Sangsuree Vasupongayya
241-427-SV-2-2553-COE-PSU 2
Outline
o Unintentional software flaws
n Buffer overflow
o Intentional software
n Virus
n Worm
2
241-427-SV-2-2553-COE-PSU 3
Buffer Overflow
o A.k.a. smashing the stack
o Occur when software fails to sanity check input
o How common computer works
n A new process is given memory by the OS
n Function code is in the memory
n First function to get run is main (entry point)
n The execution continue until the end
o Terminated
o Crashes
o Purposefully shut down
n Functions may be called
o Functions can call each other
o When finish, the control is returned to the caller
241-427-SV-2-2553-COE-PSU 4
Function call
o Function stores data about what it is doing in the
stack
o Stack grows and shrinks
o When a function is called
n Make sure that the stack has enough room
n If not enough room and function knows it then
o Error occurs
n If not enough room and function does not know
o Store data regardless
o Overwriting the stack
o Corrupting the stack
o Crashing the program
3
241-427-SV-2-2553-COE-PSU 5
Program execution
o Instruction pointer (IP): points to the currently
executing instruction
o During execution
n IP is incremented, jumps over sections of code,
jumps backward and re-running the same section
o All CPU registers must be stored
n Where? In the stack
o Given the IP is in the stack, when the buffer
overflow occurs, the IP is also corrupted
o What good does it do?
n The hacker can overwrite the IP
n Instead of returning to the caller
n The control returns to the address saved in IP
241-427-SV-2-2553-COE-PSU 6
Buffer overflow
o Write pass the end of a buffer and corrupt the stack
Normal case Buffer overflow attack
4
241-427-SV-2-2553-COE-PSU 7
Preventing stack overflow
o Make stack non-executable
n Hardware or OS
n E.g., NX bit
o Using “safe” programming languages
n JAVA or C#
n Automatically check all memory accesses
o Runtime stack checking
n by pushing a special value onto the stack immediately
after the return address
241-427-SV-2-2553-COE-PSU 8
Malware
o Software designed to break security
o Malicious in its intent
5
241-427-SV-2-2553-COE-PSU 9
Virus
o A segment of code that attaches itself to existing
programs; performs some predetermined action
o Typical actions
n System or file modification
n Further infection
o Viruses only infect executable programs not data
o Infection
n system comes into contact with a carrier of the virus
n After a system is infected, it becomes a carrier
o What can we do
n Protect by prevention
n Remove any virus
241-427-SV-2-2553-COE-PSU 10
Types of Virus
o Parasitic virus
n Attacks itself to executable files and replicates, when
the infected program is executed, by finding other
executable files to infect
o Memory-resident virus
n Reside in the main memory and infecting every
program that executes
o Boot sector virus
n Infects a master boot record
o Stealth virus: designed to hide itself from anti-virus
o Polymorphic virus: mutates with every infection
o Metamorphic virus: mutates by rewriting itself
completely at each iteration
6
241-427-SV-2-2553-COE-PSU 11
Worms
o A stand-alone program
o Infects a computer system and other computers
only through network connections
o It replicates itself
o Attacks a system with the potential to do
irrecoverable damage
o Activities
n Modification or deletion of files
n Communicate information back to the author
n Disrupt normal operations causing DoS
241-427-SV-2-2553-COE-PSU 12
Trojan Horses
o A program that is advertised to perform one
function while performs a different function
o E.g.,
n stealing passwords
n Covering for virus
7
241-427-SV-2-2553-COE-PSU 13
Backdoor
o a.k.a. trapdoor
o A secret entry point into a program
o Allow access w/o the usual security procedure
o Usually for testing & debugging the program
241-427-SV-2-2553-COE-PSU 14
Logic Bomb
o A code embedded in some legitimate program
n To explode when certain conditions are met
n Examples of conditions
o Presence or absence of certain files
o A particular day of the week or date
o Particular user running the application
n Actions
o Alter or delete data or entire files
o Cause a machine halt or do some damages
8
241-427-SV-2-2553-COE-PSU 15
Anti-virus approaches
o First generation: simple scanners
n requires a virus signature
o Second generation: heuristic scanners
n Use heuristic rules, not a specific signature
n E.g., look for the beginning of an encryption look in a
polymorphic virus; using a checksum for integrity checking
o Third generation: activity traps
n Identify a virus by its action
n Only identify the small set of actions that indicate an
infection is being attempted to intervene
o Fourth generation: full-featured protection
n Variety of anti-virus techniques used in conjunction
241-427-SV-2-2553-COE-PSU 16
Remarks
o An example virus in C language
http://www.gohacking.com/2007/12/c-program-to-
demonstrate-virus-in-c.html

More Related Content

PPT
Linux Virus
PDF
10 techniques from hacking labs1.3 miss confsp4
PDF
Windows persistence presentation
PDF
Penetrating Windows 8 with syringe utility
PDF
Awesome_fuzzing_for _pentester_red-pill_2017
PPT
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
PDF
Hands-on ethernet driver
Linux Virus
10 techniques from hacking labs1.3 miss confsp4
Windows persistence presentation
Penetrating Windows 8 with syringe utility
Awesome_fuzzing_for _pentester_red-pill_2017
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
Hands-on ethernet driver

What's hot (20)

PPT
Laboratory exercise - Network security - Penetration testing
PDF
Unix executable buffer overflow
PPTX
Client side exploits
PDF
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
PDF
2009-08-24 The Linux Audit Subsystem Deep Dive
PDF
Instalasi Solr
PDF
Reverse engineering Swisscom's Centro Grande Modem
PDF
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
PDF
The Linux Audit Framework
DOCX
JConrad_Mod11_FinalProject_031816
PPTX
Buffer overflow – Smashing The Stack
PDF
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
PPTX
Penetration Testing and Intrusion Detection System
DOCX
Audit commands by shift
PDF
Linux audit framework
PPT
Intrusion Discovery on Windows
PDF
Ceh v8 labs module 05 system hacking
PDF
How to exploit heartbleed vulnerability demonstration
TXT
Nativelog
PDF
Sebastián Guerrero - Ke ase Android? [Rooted CON 2013]
Laboratory exercise - Network security - Penetration testing
Unix executable buffer overflow
Client side exploits
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
2009-08-24 The Linux Audit Subsystem Deep Dive
Instalasi Solr
Reverse engineering Swisscom's Centro Grande Modem
A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages! ...
The Linux Audit Framework
JConrad_Mod11_FinalProject_031816
Buffer overflow – Smashing The Stack
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Penetration Testing and Intrusion Detection System
Audit commands by shift
Linux audit framework
Intrusion Discovery on Windows
Ceh v8 labs module 05 system hacking
How to exploit heartbleed vulnerability demonstration
Nativelog
Sebastián Guerrero - Ke ase Android? [Rooted CON 2013]
Ad

Similar to Ch8-Computer Security (20)

PDF
Ch6-Computer Security
PDF
Ch06b-Computer Security
PDF
Ch5-Computer Security
PDF
Securing Containers, One Patch at a Time - Michael Crosby, Docker
PDF
Breaking paravirtualized devices
PDF
Di shen pacsec_final
PPTX
Nagios Conference 2011 - Nate Broderick - Nagios XI Large Implementation Tips...
PPTX
Install ovs on local pc
PPTX
The Art of Exploiting Unconventional Use-after-free Bugs in Android Kernel by...
PDF
You're Off the Hook: Blinding Security Software
PPTX
Presentación1
PDF
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
PDF
BadUSB — On accessories that turn evil by Karsten Nohl
PPTX
Chasing the Adder. A tale from the APT world...
ODP
How to debug ocfs2 hang problem
PPT
virusessssßsssssssssssssssssssssssssssssssss.ppt
PPT
formation malware CSC50 pour les attaque malware .ppt
PDF
<sing> %post and %pre and securiteeee </sing>
PDF
Advanced System Security and Digital Forensics
Ch6-Computer Security
Ch06b-Computer Security
Ch5-Computer Security
Securing Containers, One Patch at a Time - Michael Crosby, Docker
Breaking paravirtualized devices
Di shen pacsec_final
Nagios Conference 2011 - Nate Broderick - Nagios XI Large Implementation Tips...
Install ovs on local pc
The Art of Exploiting Unconventional Use-after-free Bugs in Android Kernel by...
You're Off the Hook: Blinding Security Software
Presentación1
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
BadUSB — On accessories that turn evil by Karsten Nohl
Chasing the Adder. A tale from the APT world...
How to debug ocfs2 hang problem
virusessssßsssssssssssssssssssssssssssssssss.ppt
formation malware CSC50 pour les attaque malware .ppt
<sing> %post and %pre and securiteeee </sing>
Advanced System Security and Digital Forensics
Ad

More from Attaporn Ninsuwan (20)

PDF
J query fundamentals
PDF
Jquery enlightenment
PDF
Jquery-Begining
PDF
Br ainfocom94
PDF
Chapter 12 - Computer Forensics
PDF
Techniques for data hiding p
PDF
Stop badware infected_sites_report_062408
PDF
Steganography past-present-future 552
PDF
Ch03-Computer Security
PDF
Ch02-Computer Security
PDF
Ch01-Computer Security
PDF
Ch7-Computer Security
PDF
Ch04-Computer Security
PDF
Chapter5 - The Discrete-Time Fourier Transform
PDF
Chapter4 - The Continuous-Time Fourier Transform
PDF
Chapter3 - Fourier Series Representation of Periodic Signals
PDF
Chapter2 - Linear Time-Invariant System
PDF
Chapter1 - Signal and System
PDF
15955 state-of-the-art-post-exploitation-in-hardened-php-environments
PDF
47300 php-web-backdoor-decode
J query fundamentals
Jquery enlightenment
Jquery-Begining
Br ainfocom94
Chapter 12 - Computer Forensics
Techniques for data hiding p
Stop badware infected_sites_report_062408
Steganography past-present-future 552
Ch03-Computer Security
Ch02-Computer Security
Ch01-Computer Security
Ch7-Computer Security
Ch04-Computer Security
Chapter5 - The Discrete-Time Fourier Transform
Chapter4 - The Continuous-Time Fourier Transform
Chapter3 - Fourier Series Representation of Periodic Signals
Chapter2 - Linear Time-Invariant System
Chapter1 - Signal and System
15955 state-of-the-art-post-exploitation-in-hardened-php-environments
47300 php-web-backdoor-decode

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Computing-Curriculum for Schools in Ghana
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Lesson notes of climatology university.
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Insiders guide to clinical Medicine.pdf
Microbial diseases, their pathogenesis and prophylaxis
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
GDM (1) (1).pptx small presentation for students
Computing-Curriculum for Schools in Ghana
2.FourierTransform-ShortQuestionswithAnswers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Lesson notes of climatology university.
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Anesthesia in Laparoscopic Surgery in India
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
01-Introduction-to-Information-Management.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPH.pptx obstetrics and gynecology in nursing
Complications of Minimal Access Surgery at WLH
Pharmacology of Heart Failure /Pharmacotherapy of CHF

Ch8-Computer Security

  • 1. 1 241-427-SV-2-2553-COE-PSU 1 241-427 Computer Security Chapter VIII: Malicious programs Dr. Sangsuree Vasupongayya 241-427-SV-2-2553-COE-PSU 2 Outline o Unintentional software flaws n Buffer overflow o Intentional software n Virus n Worm
  • 2. 2 241-427-SV-2-2553-COE-PSU 3 Buffer Overflow o A.k.a. smashing the stack o Occur when software fails to sanity check input o How common computer works n A new process is given memory by the OS n Function code is in the memory n First function to get run is main (entry point) n The execution continue until the end o Terminated o Crashes o Purposefully shut down n Functions may be called o Functions can call each other o When finish, the control is returned to the caller 241-427-SV-2-2553-COE-PSU 4 Function call o Function stores data about what it is doing in the stack o Stack grows and shrinks o When a function is called n Make sure that the stack has enough room n If not enough room and function knows it then o Error occurs n If not enough room and function does not know o Store data regardless o Overwriting the stack o Corrupting the stack o Crashing the program
  • 3. 3 241-427-SV-2-2553-COE-PSU 5 Program execution o Instruction pointer (IP): points to the currently executing instruction o During execution n IP is incremented, jumps over sections of code, jumps backward and re-running the same section o All CPU registers must be stored n Where? In the stack o Given the IP is in the stack, when the buffer overflow occurs, the IP is also corrupted o What good does it do? n The hacker can overwrite the IP n Instead of returning to the caller n The control returns to the address saved in IP 241-427-SV-2-2553-COE-PSU 6 Buffer overflow o Write pass the end of a buffer and corrupt the stack Normal case Buffer overflow attack
  • 4. 4 241-427-SV-2-2553-COE-PSU 7 Preventing stack overflow o Make stack non-executable n Hardware or OS n E.g., NX bit o Using “safe” programming languages n JAVA or C# n Automatically check all memory accesses o Runtime stack checking n by pushing a special value onto the stack immediately after the return address 241-427-SV-2-2553-COE-PSU 8 Malware o Software designed to break security o Malicious in its intent
  • 5. 5 241-427-SV-2-2553-COE-PSU 9 Virus o A segment of code that attaches itself to existing programs; performs some predetermined action o Typical actions n System or file modification n Further infection o Viruses only infect executable programs not data o Infection n system comes into contact with a carrier of the virus n After a system is infected, it becomes a carrier o What can we do n Protect by prevention n Remove any virus 241-427-SV-2-2553-COE-PSU 10 Types of Virus o Parasitic virus n Attacks itself to executable files and replicates, when the infected program is executed, by finding other executable files to infect o Memory-resident virus n Reside in the main memory and infecting every program that executes o Boot sector virus n Infects a master boot record o Stealth virus: designed to hide itself from anti-virus o Polymorphic virus: mutates with every infection o Metamorphic virus: mutates by rewriting itself completely at each iteration
  • 6. 6 241-427-SV-2-2553-COE-PSU 11 Worms o A stand-alone program o Infects a computer system and other computers only through network connections o It replicates itself o Attacks a system with the potential to do irrecoverable damage o Activities n Modification or deletion of files n Communicate information back to the author n Disrupt normal operations causing DoS 241-427-SV-2-2553-COE-PSU 12 Trojan Horses o A program that is advertised to perform one function while performs a different function o E.g., n stealing passwords n Covering for virus
  • 7. 7 241-427-SV-2-2553-COE-PSU 13 Backdoor o a.k.a. trapdoor o A secret entry point into a program o Allow access w/o the usual security procedure o Usually for testing & debugging the program 241-427-SV-2-2553-COE-PSU 14 Logic Bomb o A code embedded in some legitimate program n To explode when certain conditions are met n Examples of conditions o Presence or absence of certain files o A particular day of the week or date o Particular user running the application n Actions o Alter or delete data or entire files o Cause a machine halt or do some damages
  • 8. 8 241-427-SV-2-2553-COE-PSU 15 Anti-virus approaches o First generation: simple scanners n requires a virus signature o Second generation: heuristic scanners n Use heuristic rules, not a specific signature n E.g., look for the beginning of an encryption look in a polymorphic virus; using a checksum for integrity checking o Third generation: activity traps n Identify a virus by its action n Only identify the small set of actions that indicate an infection is being attempted to intervene o Fourth generation: full-featured protection n Variety of anti-virus techniques used in conjunction 241-427-SV-2-2553-COE-PSU 16 Remarks o An example virus in C language http://www.gohacking.com/2007/12/c-program-to- demonstrate-virus-in-c.html