SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Software security
        Vulnerabilities, exploits and
                                                             November 14th,
        possible countermeasures                                 2012




                                Roman Oliynykov
Associated Professor of Information Technologies Security
                                             Department
          Kharkov National University of Radioelectronics

                 Head of Scientific Research Department
               JSC “Institute of Information Technologies”
                                                  Kharkov
                                                Ukraine

                                 ROliynykov@gmail.com
Lecture outline
   List of topics I suppose you already understand
   Importance of secure software for customers on the
    modern highly competitive consumer electronics
    market
   Example of vulnerable network daemon for Linux, and
    exploit for it (buffer overflow demo)
   Possible countermeasures against software
    vulnerabilities together with new hackers’ tricks against
    them
   Need for permanent attention for software security
For this lecture
I suppose you understand

C  programming language source code
 main terms of operation system architecture
  (process, address space, stack, heap, etc.)
 x86 assembler language source code
  (preferably AT&T notation)
 basics of Linux (command line)

 network utilities (ping, telnet)
Importance of secure software for
customers on the modern highly
competitive consumer electronics
market
Importance of secure software
   A smartphone is a mobile
    phone built on a mobile
    operating system, with more
    advanced computing capability
    and connectivity than a feature
    phone [Wikipedia]

   Mobile operating system: Linux
    (Android, Bada, etc.), potentially
    vulnerable to malware (viruses,
    worms, Trojan horses, etc.)
Financial threats to
smartphone users via malware
   Invisible to user automatic
    premium number calls and SMS

   Mobile banking application
    credentials theft via:
       mobile banking application attacks
        (Zeus malware for mobiles, etc.)
       access to bank card readers
        connected to the smartphone via
        microphone port, NFC chip, etc.
Other threats to smartphone
users via malware
   Privacy threats (spying) for
    remote transmission to the
    hacker group:
     voice recording
     video and photo
     contact list, sms, etc.
     customer location via
       GPS data, etc.

   Customer incrimination to
    be a source of the
    cybercrime attack when
    his/her smartphone is a part
    of the botnet
New attacks on smartphones:
‘visual malware’
Automated malicious software
based on camera photos for
3D model creation of indoor
environment and stealing data
of financial documents,
information on monitors, etc.
Importance of secure software
   A Smart TV is the phrase used to
    describe the current trend of
    integration of the Internet and Web
    2.0 features into modern television
    sets and set-top boxes, as well as the
    technological convergence between
    computers and these television sets
    [Wikipedia]

   Mobile operating system: Linux
    (Android, Bada, etc.), potentially
    vulnerable to malware (viruses,
    worms, Trojan horses, etc.)
Threats to Smart TV users:
almost the same
   Financial:
       banking application credentials theft
   Privacy threats (spying) for remote transmission to
    the hacker group from customer’s house:
       voice recording
       video and photo
       blackmails for confidential recording at user’s home
   Family digital data lost (photos, videos, contacts,
    etc. - example)
   Customer incrimination to be a source of the
    cybercrime attack when his/her Smart TV is a part of
    the botnet or hacker’s proxy node
Example of vulnerable network
daemon (service) for Linux,
and exploit for it
netcalcd – vulnerable daemon
(service) for Linux (x86)
 intentionally written for this lecture and
  contains intentionally man-made
  vulnerabilities
 processes simple network text requests for
  basic calculations
 prints debug information about its stack on
  the server console
netcalcd normal operation
netcalcd normal operation
netcacld source code:
part of the main() function
netcacld source code:
process_request() function
netcacld source code:
get_result() function
netcacld source code in asm:
get_result() function
Vulnerability in
 get_result() function


strcpy( &dst, &src ) in contrast to
strncpy( &dst, &src, sizeof (dst) )
takes into account only
destination string length (buffer
size) and copies data until finds
termination zero in src
netcalcd stack after strcpy() call with
malicious data (hacker’s code) from the
network
netcalcd normal operation
Running exploit against
netcalcd
netcalcd buffer overflow in
get_result()
Open ports on the victim
computer: before and after
Victim computer successfully
cracked
What’s inside exploit and how
it works?
Exploit: usual C program for Windows
sending block of data (shellcode):
Shellcode in the example: relocatable
binary code can be run at any user address

Protect the running code in the stack, find absolute address it is
run at and decode the rest part of the shellcode
Why encode the main part of
the shellcode?
After encoding the rest part of the
shellcode runs web server at port 8801




                       or does everything
                       intruder wants to do with
                       the vulnerable process
                       privileges
How to protect our software
against such an attack?
Possible countermeasures
against buffer overflow
   write secure code based on secure functions calls
    and all necessary user input verification (the most
    important recommendation)
   make your operation system to use Address Space
    Layout Randomization (ASLR)
   make your operation system use processor NX bit
    (on x86 platform)
   keep on canary words in your compiler
   run the code with the least necessary privileges
Write secure code based on
secure functions calls




strcpy( &dst, &src ) fills destination buffer without taking into account its size;
strncpy( &dst, &src, sizeof( dst ) ) won’t write outside the destination buffer (but
it’s possible the lost of terminating zero)
Write secure code based on
secure functions calls




       And many other recommendations for writing secure code…
Security check of existing
projects: automated tools




     But no guarantee that all vulnerabilities are discovered
Address Space Layout
Randomization
 computer security method which involves
 randomly arranging the positions of key data
 areas, usually including the base of the
 executable and position of libraries, heap,
 and stack, in a process's address space
 [wikipedia]

 Each running time stack, heap, etc. are put at
 random addresses in the process address space
Address Space Layout
Randomization (example)




It’s difficult to guess correct return address to be written on the stack
smashing. But it is possible: only16 less bits of address are changed
Running code addresses are NOT changed
ASLR appeared:
 Linux   kernel support: 2.6.12 (released June
  2005)
 Microsoft's Windows Vista (released January
  2007), Windows Server 2008, Windows 7,
  and later have ASLR enabled by default
 Android 4.0 Ice Cream Sandwich provides
  ASLR
…
ASLR evasion techniques




   brute force address search attempt
   return into code on non-randomized memory
   jmp *esp (ret address points to such bytes in code)
   etc.
Make your operation system use
processor NX bit (on x86 platform)
NX bit, which stands for Never eXecute, is a technology used in
  CPUs to segregate areas of memory for use by either storage
  of processor instructions (or code) or for storage of data
NX bit protection evasion:
return-to-libc attack
   no code in the stack (no
    processor exception)
   return address is
    overwritten and points to
    the existing code
   intruder calls standard
    function and passes
    arbitrary arguments to it
   in Windows it is possible
    to call a sequence of
    functions due to _stdcall_
    convention
Never switch off canary words
 in your compiler
Canary words are known values that are placed between a buffer and
  control data on the stack to monitor buffer overflows
Canary words
 Implementation:
    GCC Stack-Smashing Protector (ProPolice)
    Microsoft Visual Studio 2003 and higher ( /GS )
    etc.

 What   cannot be handled:
    buffer overflows in the heap
     (intruder uses pointers to functions in virtual
     method tables of dynamic objects)
There is no universal silver
    bullet for security
  If a system switched on and running
              we may have
   up-do-date security solutions only




Security is a process, not a state
Conclusions (I)
 Security  is important (and sometimes is a
  crucial factor) for consumer acceptance

 Secure    code is a major element of the secure
  system

 Writing secure code is much more effective
  than later security improvement
Conclusions (II)

 Effective
          methods for security level
  improvement for existing applications:
     Address Space Layout Randomization (ASLR)
     NX bit on x86 processors
     canary words in your compiler
     code running with the least necessary privileges
Conclusions (III)
   All acceptable security features of the
    operation system should be used
   There is no universal “silver bullet” for
    security
   Security is a process, not a state
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Cybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by AdamCybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by AdamMohammed Adam
 
Security risk management
Security risk managementSecurity risk management
Security risk managementG Prachi
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Cybersecurity Attack Vectors: How to Protect Your Organization
Cybersecurity Attack Vectors: How to Protect Your OrganizationCybersecurity Attack Vectors: How to Protect Your Organization
Cybersecurity Attack Vectors: How to Protect Your OrganizationTriCorps Technologies
 
Cia security model
Cia security modelCia security model
Cia security modelImran Ahmed
 
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...Edureka!
 
Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testingNezar Alazzabi
 
Password Cracking
Password CrackingPassword Cracking
Password CrackingSagar Verma
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTIONAnoop T
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissanceNishaYadav177
 
Intrusion detection
Intrusion detectionIntrusion detection
Intrusion detectionCAS
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internetRohan Bharadwaj
 
Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Umesh Mahawar
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentationMahmoud Ibra
 

Was ist angesagt? (20)

Introduction to Information Security
Introduction to Information Security Introduction to Information Security
Introduction to Information Security
 
Security threats
Security threatsSecurity threats
Security threats
 
Cybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by AdamCybersecurity Awareness Session by Adam
Cybersecurity Awareness Session by Adam
 
Web security
Web securityWeb security
Web security
 
Security risk management
Security risk managementSecurity risk management
Security risk management
 
Network security
Network securityNetwork security
Network security
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Cybersecurity Attack Vectors: How to Protect Your Organization
Cybersecurity Attack Vectors: How to Protect Your OrganizationCybersecurity Attack Vectors: How to Protect Your Organization
Cybersecurity Attack Vectors: How to Protect Your Organization
 
Cia security model
Cia security modelCia security model
Cia security model
 
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
 
Introduction to penetration testing
Introduction to penetration testingIntroduction to penetration testing
Introduction to penetration testing
 
Password Cracking
Password CrackingPassword Cracking
Password Cracking
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Secure software design
Secure software designSecure software design
Secure software design
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissance
 
Intrusion detection
Intrusion detectionIntrusion detection
Intrusion detection
 
Different types of attacks in internet
Different types of attacks in internetDifferent types of attacks in internet
Different types of attacks in internet
 
Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)Ethical Hacking PPT (CEH)
Ethical Hacking PPT (CEH)
 
Brute force-attack presentation
Brute force-attack presentationBrute force-attack presentation
Brute force-attack presentation
 

Andere mochten auch

Cryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin frameworkCryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin frameworkRoman Oliynykov
 
Kalyna block cipher presentation in English
Kalyna block cipher presentation in EnglishKalyna block cipher presentation in English
Kalyna block cipher presentation in EnglishRoman Oliynykov
 
Software Security Testing
Software Security TestingSoftware Security Testing
Software Security Testingankitmehta21
 
Next generation block ciphers
Next generation block ciphersNext generation block ciphers
Next generation block ciphersRoman Oliynykov
 
AES effecitve software implementation
AES effecitve software implementationAES effecitve software implementation
AES effecitve software implementationRoman Oliynykov
 
Matteo meucci Software Security - Napoli 10112016
Matteo meucci   Software Security - Napoli 10112016Matteo meucci   Software Security - Napoli 10112016
Matteo meucci Software Security - Napoli 10112016Minded Security
 
Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Roman Oliynykov
 
Presentation Software
Presentation SoftwarePresentation Software
Presentation Softwaregueste5c836
 
Desktop Publishing
Desktop PublishingDesktop Publishing
Desktop Publishingbjoe777
 
Software Security Frameworks
Software Security FrameworksSoftware Security Frameworks
Software Security FrameworksMarco Morana
 
Graphics software
Graphics softwareGraphics software
Graphics softwareMohd Arif
 
Desktop publishing (power point)
Desktop publishing (power point)Desktop publishing (power point)
Desktop publishing (power point)kuromi12
 
Wired and wireless technologies
Wired and  wireless  technologiesWired and  wireless  technologies
Wired and wireless technologiesAkhil Sabu
 

Andere mochten auch (20)

Software Security
Software SecuritySoftware Security
Software Security
 
My life plans
My  life  plansMy  life  plans
My life plans
 
Kupyna
KupynaKupyna
Kupyna
 
Cryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin frameworkCryptocurrency with central bank regulations: the RSCoin framework
Cryptocurrency with central bank regulations: the RSCoin framework
 
Kalyna block cipher presentation in English
Kalyna block cipher presentation in EnglishKalyna block cipher presentation in English
Kalyna block cipher presentation in English
 
Kalyna
KalynaKalyna
Kalyna
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Security Testing
Software Security TestingSoftware Security Testing
Software Security Testing
 
Next generation block ciphers
Next generation block ciphersNext generation block ciphers
Next generation block ciphers
 
Desktop Publishing
Desktop PublishingDesktop Publishing
Desktop Publishing
 
AES effecitve software implementation
AES effecitve software implementationAES effecitve software implementation
AES effecitve software implementation
 
Matteo meucci Software Security - Napoli 10112016
Matteo meucci   Software Security - Napoli 10112016Matteo meucci   Software Security - Napoli 10112016
Matteo meucci Software Security - Napoli 10112016
 
Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...Buffer overflow and other software vulnerabilities: theory and practice of pr...
Buffer overflow and other software vulnerabilities: theory and practice of pr...
 
Presentation Software
Presentation SoftwarePresentation Software
Presentation Software
 
Desktop Publishing
Desktop PublishingDesktop Publishing
Desktop Publishing
 
Software Security Frameworks
Software Security FrameworksSoftware Security Frameworks
Software Security Frameworks
 
Graphics software
Graphics softwareGraphics software
Graphics software
 
Information Security and the SDLC
Information Security and the SDLCInformation Security and the SDLC
Information Security and the SDLC
 
Desktop publishing (power point)
Desktop publishing (power point)Desktop publishing (power point)
Desktop publishing (power point)
 
Wired and wireless technologies
Wired and  wireless  technologiesWired and  wireless  technologies
Wired and wireless technologies
 

Ähnlich wie Software security

Chapter 09
Chapter 09Chapter 09
Chapter 09 Google
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CDamiable_indian
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008ClubHack
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008ClubHack
 
Op Sy 03 Ch 61
Op Sy 03 Ch 61Op Sy 03 Ch 61
Op Sy 03 Ch 61 Google
 
20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)LeClubQualiteLogicielle
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101ysurer
 
[Codientu.org] design of a microcontroller based circuit for software protection
[Codientu.org] design of a microcontroller based circuit for software protection[Codientu.org] design of a microcontroller based circuit for software protection
[Codientu.org] design of a microcontroller based circuit for software protectionHieu Le Dinh
 
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...Area41
 
Reducing attack surface on ICS with Windows native solutions
Reducing attack surface on ICS with Windows native solutionsReducing attack surface on ICS with Windows native solutions
Reducing attack surface on ICS with Windows native solutionsJan Seidl
 
Embedded
EmbeddedEmbedded
EmbeddedAbindas
 
Inception framework
Inception frameworkInception framework
Inception framework한익 주
 
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)Alexandre Borges
 
introduction to Embedded System Security
introduction to Embedded System Securityintroduction to Embedded System Security
introduction to Embedded System SecurityAdel Barkam
 
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
 
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 Programmingkozossakai
 
An Overview of Cyber Attack and Computer Network Operations Si.docx
An Overview of Cyber Attack and Computer Network Operations Si.docxAn Overview of Cyber Attack and Computer Network Operations Si.docx
An Overview of Cyber Attack and Computer Network Operations Si.docxnettletondevon
 

Ähnlich wie Software security (20)

Buffer Overflows
Buffer OverflowsBuffer Overflows
Buffer Overflows
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008
 
Op Sy 03 Ch 61
Op Sy 03 Ch 61Op Sy 03 Ch 61
Op Sy 03 Ch 61
 
20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)20100309 03 - Vulnerability analysis (McCabe)
20100309 03 - Vulnerability analysis (McCabe)
 
Buffer overflows
Buffer overflowsBuffer overflows
Buffer overflows
 
Reverse Engineering 101
Reverse Engineering 101Reverse Engineering 101
Reverse Engineering 101
 
[Codientu.org] design of a microcontroller based circuit for software protection
[Codientu.org] design of a microcontroller based circuit for software protection[Codientu.org] design of a microcontroller based circuit for software protection
[Codientu.org] design of a microcontroller based circuit for software protection
 
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...
hashdays 2011: Felix 'FX' Lindner - Targeted Industrial Control System Attack...
 
Reducing attack surface on ICS with Windows native solutions
Reducing attack surface on ICS with Windows native solutionsReducing attack surface on ICS with Windows native solutions
Reducing attack surface on ICS with Windows native solutions
 
Embedded
EmbeddedEmbedded
Embedded
 
9(1)
9(1)9(1)
9(1)
 
Inception framework
Inception frameworkInception framework
Inception framework
 
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)
MODERN MALWARE: OBFUSCATION AND EMULATION DEF CON CHINA 1.0 (2019)
 
introduction to Embedded System Security
introduction to Embedded System Securityintroduction to Embedded System Security
introduction to Embedded System Security
 
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...
 
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
 
An Overview of Cyber Attack and Computer Network Operations Si.docx
An Overview of Cyber Attack and Computer Network Operations Si.docxAn Overview of Cyber Attack and Computer Network Operations Si.docx
An Overview of Cyber Attack and Computer Network Operations Si.docx
 

Kürzlich hochgeladen

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Kürzlich hochgeladen (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Software security

  • 1. Software security Vulnerabilities, exploits and November 14th, possible countermeasures 2012 Roman Oliynykov Associated Professor of Information Technologies Security Department Kharkov National University of Radioelectronics Head of Scientific Research Department JSC “Institute of Information Technologies” Kharkov Ukraine ROliynykov@gmail.com
  • 2. Lecture outline  List of topics I suppose you already understand  Importance of secure software for customers on the modern highly competitive consumer electronics market  Example of vulnerable network daemon for Linux, and exploit for it (buffer overflow demo)  Possible countermeasures against software vulnerabilities together with new hackers’ tricks against them  Need for permanent attention for software security
  • 3. For this lecture I suppose you understand C programming language source code  main terms of operation system architecture (process, address space, stack, heap, etc.)  x86 assembler language source code (preferably AT&T notation)  basics of Linux (command line)  network utilities (ping, telnet)
  • 4. Importance of secure software for customers on the modern highly competitive consumer electronics market
  • 5. Importance of secure software  A smartphone is a mobile phone built on a mobile operating system, with more advanced computing capability and connectivity than a feature phone [Wikipedia]  Mobile operating system: Linux (Android, Bada, etc.), potentially vulnerable to malware (viruses, worms, Trojan horses, etc.)
  • 6. Financial threats to smartphone users via malware  Invisible to user automatic premium number calls and SMS  Mobile banking application credentials theft via:  mobile banking application attacks (Zeus malware for mobiles, etc.)  access to bank card readers connected to the smartphone via microphone port, NFC chip, etc.
  • 7. Other threats to smartphone users via malware  Privacy threats (spying) for remote transmission to the hacker group:  voice recording  video and photo  contact list, sms, etc.  customer location via GPS data, etc.  Customer incrimination to be a source of the cybercrime attack when his/her smartphone is a part of the botnet
  • 8. New attacks on smartphones: ‘visual malware’ Automated malicious software based on camera photos for 3D model creation of indoor environment and stealing data of financial documents, information on monitors, etc.
  • 9. Importance of secure software  A Smart TV is the phrase used to describe the current trend of integration of the Internet and Web 2.0 features into modern television sets and set-top boxes, as well as the technological convergence between computers and these television sets [Wikipedia]  Mobile operating system: Linux (Android, Bada, etc.), potentially vulnerable to malware (viruses, worms, Trojan horses, etc.)
  • 10. Threats to Smart TV users: almost the same  Financial:  banking application credentials theft  Privacy threats (spying) for remote transmission to the hacker group from customer’s house:  voice recording  video and photo  blackmails for confidential recording at user’s home  Family digital data lost (photos, videos, contacts, etc. - example)  Customer incrimination to be a source of the cybercrime attack when his/her Smart TV is a part of the botnet or hacker’s proxy node
  • 11. Example of vulnerable network daemon (service) for Linux, and exploit for it
  • 12. netcalcd – vulnerable daemon (service) for Linux (x86)  intentionally written for this lecture and contains intentionally man-made vulnerabilities  processes simple network text requests for basic calculations  prints debug information about its stack on the server console
  • 15. netcacld source code: part of the main() function
  • 18. netcacld source code in asm: get_result() function
  • 19. Vulnerability in get_result() function strcpy( &dst, &src ) in contrast to strncpy( &dst, &src, sizeof (dst) ) takes into account only destination string length (buffer size) and copies data until finds termination zero in src
  • 20. netcalcd stack after strcpy() call with malicious data (hacker’s code) from the network
  • 23. netcalcd buffer overflow in get_result()
  • 24. Open ports on the victim computer: before and after
  • 26. What’s inside exploit and how it works?
  • 27. Exploit: usual C program for Windows sending block of data (shellcode):
  • 28. Shellcode in the example: relocatable binary code can be run at any user address Protect the running code in the stack, find absolute address it is run at and decode the rest part of the shellcode
  • 29. Why encode the main part of the shellcode?
  • 30. After encoding the rest part of the shellcode runs web server at port 8801 or does everything intruder wants to do with the vulnerable process privileges
  • 31. How to protect our software against such an attack?
  • 32. Possible countermeasures against buffer overflow  write secure code based on secure functions calls and all necessary user input verification (the most important recommendation)  make your operation system to use Address Space Layout Randomization (ASLR)  make your operation system use processor NX bit (on x86 platform)  keep on canary words in your compiler  run the code with the least necessary privileges
  • 33. Write secure code based on secure functions calls strcpy( &dst, &src ) fills destination buffer without taking into account its size; strncpy( &dst, &src, sizeof( dst ) ) won’t write outside the destination buffer (but it’s possible the lost of terminating zero)
  • 34. Write secure code based on secure functions calls And many other recommendations for writing secure code…
  • 35. Security check of existing projects: automated tools But no guarantee that all vulnerabilities are discovered
  • 36. Address Space Layout Randomization computer security method which involves randomly arranging the positions of key data areas, usually including the base of the executable and position of libraries, heap, and stack, in a process's address space [wikipedia] Each running time stack, heap, etc. are put at random addresses in the process address space
  • 37. Address Space Layout Randomization (example) It’s difficult to guess correct return address to be written on the stack smashing. But it is possible: only16 less bits of address are changed Running code addresses are NOT changed
  • 38. ASLR appeared:  Linux kernel support: 2.6.12 (released June 2005)  Microsoft's Windows Vista (released January 2007), Windows Server 2008, Windows 7, and later have ASLR enabled by default  Android 4.0 Ice Cream Sandwich provides ASLR …
  • 39. ASLR evasion techniques  brute force address search attempt  return into code on non-randomized memory  jmp *esp (ret address points to such bytes in code)  etc.
  • 40. Make your operation system use processor NX bit (on x86 platform) NX bit, which stands for Never eXecute, is a technology used in CPUs to segregate areas of memory for use by either storage of processor instructions (or code) or for storage of data
  • 41. NX bit protection evasion: return-to-libc attack  no code in the stack (no processor exception)  return address is overwritten and points to the existing code  intruder calls standard function and passes arbitrary arguments to it  in Windows it is possible to call a sequence of functions due to _stdcall_ convention
  • 42. Never switch off canary words in your compiler Canary words are known values that are placed between a buffer and control data on the stack to monitor buffer overflows
  • 43. Canary words  Implementation:  GCC Stack-Smashing Protector (ProPolice)  Microsoft Visual Studio 2003 and higher ( /GS )  etc.  What cannot be handled:  buffer overflows in the heap (intruder uses pointers to functions in virtual method tables of dynamic objects)
  • 44. There is no universal silver bullet for security If a system switched on and running we may have up-do-date security solutions only Security is a process, not a state
  • 45. Conclusions (I)  Security is important (and sometimes is a crucial factor) for consumer acceptance  Secure code is a major element of the secure system  Writing secure code is much more effective than later security improvement
  • 46. Conclusions (II)  Effective methods for security level improvement for existing applications:  Address Space Layout Randomization (ASLR)  NX bit on x86 processors  canary words in your compiler  code running with the least necessary privileges
  • 47. Conclusions (III)  All acceptable security features of the operation system should be used  There is no universal “silver bullet” for security  Security is a process, not a state