C and C++ security master course

CL-CSM
5 nap
350 000 Ft + ÁFA
tanfolyamkezdési időpontok:
Jelentkezem!
oktatók:

A tanfolyam célja

As a developer, your duty is to write bulletproof code. However...

What if we told you that despite all of your efforts, the code you have been writing your entire career is full of weaknesses you never knew existed? What if, as you are reading this, hackers were trying to break into your code? How likely would they be to succeed?

This advanced course will change the way you look at code. A hands-on training during which we will teach you all of the attackers’ tricks and how to mitigate them, leaving you with no other feeling than the desire to know more.

It is your choice to be ahead of the pack, and be seen as a game changer in the fight against cybercrime.

  •     Understand basic concepts of security, IT security and secure coding
  •     Realize the severe consequences of unsecure buffer handling
  •     Understand the architectural protection techniques and their weaknesses
  •     Learn about typical coding mistakes and how to avoid them
  •     Be informed about recent vulnerabilities in various platforms, frameworks and libraries
  •     Understand the requirements of secure communication
  •     Have a practical understanding of cryptography
  •     Understand essential security protocols
  •     Understand some recent attacks against cryptosystems
  •     Learn about denial of service attacks and protections
  •     Learn about XML security
  •     Understand security considerations in the SDLC
  •     Understand security testing approaches and methodologies
  •     Get practical knowledge in using security testing techniques and tools
  •     Learn how to set up and operate the deployment environment securely
  •     Get sources and further readings on secure coding practices

Tematika

  •     IT security and secure coding
  •     x86 machine code, memory layout and stack operations
  •     Buffer overflow
  •     Common coding errors and vulnerabilities
  •     Requirements of secure communication
  •     Practical cryptography
  •     Security protocols
  •     Denial of service
  •     XML security
  •     Security in the software development lifecycle
  •     Security testing
  •     Security testing techniques
  •     Deployment environment
  •     Principles of security and secure coding
  •     Knowledge sources

1. IT security and secure coding

  •         Nature of security
  •         What is risk?
  •         IT security vs. secure coding
  •         From vulnerabilities to botnets and cybercrime
    •             Nature of security flaws
    •             Reasons of difficulty
    •             From an infected computer to targeted attacks
    •             The Seven Pernicious Kingdoms
    •             OWASP Top Ten 2017

    x86 machine code, memory layout and stack operations

  •         Intel 80x86 Processors – main registers
  •         Intel 80x86 Processors – most important instructions
  •         Intel 80x86 Processors – flags
  •         Intel 80x86 Processors – control instructions
  •         Intel 80x86 Processors – stack handling and flow control
  •         The memory address layout
  •         The function calling mechanism in C/C++ on x86
  •         Calling conventions
  •         The local variables and the stack frame
  •         Function calls – prologue and epilogue of a function
  •         Stack frame of nested calls
  •         Stack frame of recursive functions

    Buffer overflow

  •         Stack overflow
    •             Buffer overflow on the stack
    •             Overwriting the return address
    •             Exercises – introduction
    •             Exercise BOFIntro
    •             Exercise BOFShellcode
    •             Exercise BOFShellcode – spot the bug!
  •         Protection against stack overflow
    •             Specific protection methods
    •             Protection methods at different layers
    •             The PreDeCo matrix of software security
    •             Stack overflow – Prevention (during development)
    •             Stack overflow – Detection (during execution)
    •             Fortify istrumentation (FORTIFY_SOURCE)
    •             Exercise BOFShellcode – Fortify
  •         Stack smashing protection
    •             Stack smashing protection variants
    •             Stack smashing protection in GCC
    •             Exercise BOFShellcode – Stack smashing protection
    •             Effects of stack smashing protection
    •             Bypassing stack smashing protection – an example
    •             Overwriting arguments – Mitigation
  •         Address Space Layout Randomization (ASLR)
    •             Randomization with ASLR
    •             Using ASLR
    •             Circumventing ASLR: NOP sledding
  •         Non executable memory areas – the NX bit
    •             Access Control on memory segments
    •             The Never eXecute (NX) bit
    •             Exercise BOFShellcode – Enforcing NX memory segments

 2. Buffer overflow

  •         Return-to-libc attack – Circumventing the NX bit protection
    •             Circumventing memory execution protection
    •             Return-to-libc attack
    •             Exercise BOFShellcode – The Return-to-libc attack
    •             Multiple function calls with return-to-libc
  •         Return oriented programming (ROP)
    •             Exploiting with ROP
    •             ROP gadgets
    •             ROP gadget - Register fill with constants
    •             ROP gadget – Memory write
    •             Combining the ROP gadgets
    •             Real ROP attack scenarios
    •             Exercise BOFROP
    •             ROP mitigation
      •                 Mitigation techniques of ROP attack
  •         Heap overflow
    •             Memory allocation managed by a doubly-linked list
    •             Buffer overflow on the heap
    •             Steps of freeing and joining memory blocks
    •             Freeing allocated memory blocks
    •             Case study – Heartbleed
      •                 TLS Heartbeat Extension
      •                 Heartbleed – information leakage in OpenSSL
      •                 Heartbleed – fix in v1.0.1g
      •                 Protection against heap overflow

    Common coding errors and vulnerabilities

  •         Input validation
    •             Input validation concepts
    •             Integer problems
      •                 Representation of negative integers
      •                 Integer ranges
      •                 Integer overflow
      •                 Integer problems in C/C++
      •                 The integer promotion rule in C/C++
      •                 Arithmetic overflow – spot the bug!
      •                 Exercise IntOverflow
      •                 What is the value of abs(INT_MIN)?
      •                 Signedness bug – spot the bug!
      •                 Integer truncation – spot the bug!
      •                 Integer problem – best practices
      •                 Case study – Android Stagefright
    •             Injection flaws
      •                 SQL Injection exercise
      •                 Typical SQL Injection attack methods
      •                 Blind and time-based SQL injection
      •                 SQL Injection protection methods
      •                 Command injection
      •                 Command injection exercise – starting Netcat
    •             Printf format string bug
    •                 Printf format strings
    •                 Printf format string bug – exploitation
    •                 Exercise Printf
    •                 Printf format string exploit – overwriting the return address
    •             Mitigation of printf format string problem
    •             Some other input validation problems
      •                 Array indexing – spot the bug!
      •                 Off-by-one and other null termination errors
      •                 The Unicode bug
    •             Path traversal vulnerability
      •                 Path traversal mitigation
    •             Log forging
      •                 Some other typical problems with log files
  •         Time and state problems
    •             Time and state related problems
    •             Serialization errors (TOCTTOU)
    •             Attacks with symbolic links
    •             Exercise TOCTTOU

3. Requirements of secure communication

  •         Security levels
  •         Secure acknowledgment
    •             Malicious message absorption
      •                 Feasibility of secure acknowledgment
      •                 The solution: Clearing Centers
    •             Inadvertent message loss
  •         Integrity
    •             Error detection - Inadvertent message distortion (noise)
      •                 Modeling message distortion
      •                 Error detection and correction codes
    •             Authenticity - Malicious message manipulation
      •                 Modeling message manipulation
      •                 Practical integrity protection (detection)
    •             Non-repudiation
      •                 Non-repudiation
    •             Summary
      •                 Detecting integrity violation
  •         Confidentiality
    •             Model of encrypted communication
    •             Encryption methods in practice
    •             Strength of encryption algorithms
  •         Remote identification
    •             Requirements of remote identification
  •         Anonymity and traffic analysis
    •             Model of anonymous communication
    •             Traffic analysis
    •             Theoretically strong protection against traffic analysis
    •             Practical protection against traffic analysis
  •         Summary
    •             Relationship between the requirements

    Practical cryptography

  •         Cryptosystems
    •             Elements of a cryptosystem
  •         Symmetric-key cryptography
    •             Providing confidentiality with symmetric cryptography
    •             Symmetric encryption algorithms
    •             Block ciphers – modes of operation
  •         Other cryptographic algorithms
    •             Hash or message digest
    •             Hash algorithms
    •             SHAttered
    •             Message Authentication Code (MAC)
    •             Providing integrity and authenticity with a symmetric key
    •             Random numbers and cryptography
    •             Cryptographically-strong PRNGs
    •             Hardware-based TRNGs
  •         Asymmetric (public-key) cryptography
    •             Providing confidentiality with public-key encryption
    •             Rule of thumb – possession of private key
    •             The RSA algorithm
      •                 Introduction to RSA algorithm
      •                 Encrypting with RSA
      •                 Combining symmetric and asymmetric algorithms
      •                 Digital signing with RSA
  •         Public Key Infrastructure (PKI)
    •             Man-in-the-Middle (MitM) attack
    •             Digital certificates against MitM attack
    •             Certificate Authorities in Public Key Infrastructure
    •             X.509 digital certificate
  •         Web of Trust (WoT)
    •             Web of Trust (WoT) – introduction
    •             Challenges of Web of Trust

    Security protocols

  •         Secure network protocols
  •         Specific vs. general solutions
  •         IPSEC protocol family
    •             IPSEC standards
    •             Security Association (SA)
    •             Message formats
    •             AH packet structure
    •             ESP packet structure
    •             Protected channels
    •             More complex set-ups
    •             Traffic control
    •             SA structure
    •             Key management
  •         SSL/TLS protocols
    •             Security services
    •             SSL/TLS handshake
  •         Protocol-level vulnerabilities
    •             BEAST
    •             FREAK
    •             FREAK – attack against SSL/TLS
    •             Logjam attack
  •         Padding oracle attacks
    •             Adaptive chosen-ciphertext attacks
    •             Padding oracle attack
    •             CBC decryption
    •             Padding oracle example
    •             Lucky Thirteen
    •             POODLE

 4. Common coding errors and vulnerabilities

  •             Improper use of security features
    •                 Typical problems related to the use of security features
    •                 Insecure randomness
    •                     Weak PRNGs in C and C++
    •                     Stronger PRNGs in C
    •                 Password management
      •                     Exercise – Weakness of hashed passwords
      •                     Password management and storage
      •                     Brute forcing
      •                     Special purpose hash algorithms for password storage
      •                     Argon2 and PBKDF2 implementations in C/C++
      •                     bcrypt and scrypt implementations in C/C++
      •                     Case study – the Ashley Madison data breach
      •                     Typical mistakes in password management
      •                     Exercise – Hard coded passwords
    •                 Insufficient anti-automation
      •                     Captcha
      •                     Captcha weaknesses
  •             Sensitive information in memory
    •                 Protecting secrets in memory
    •                 Minimize the attack surface
    •                 Core dumps
    •                 Disabling core dumps
    •                 Swapping
    •                 Preventing swapping
    •                 Problems with page locking
    •                 Your secrets vs. dynamic memory
    •                 Zeroisation
    •                 Optimization vs. zeroisation – Spot the bug!
    •                 Best practices
  •             Improper error and exception handling
    •                 Typical problems with error and exception handling
    •                 Empty catch block
    •                 Overly broad catch
    •                 Exercise ErrorHandling – spot the bug!
    •                 Exercise – Error handling
  •             Code quality problems
    •                 Dangers arising from poor code quality
    •                 Poor code quality – spot the bug!
    •                 Unreleased resources
    •                 Type mismatch – Spot the bug!
    •                 Exercise TypeMismatch
    •                 Memory allocation problems
      •                     Smart pointers
      •                     Zero length allocation
      •                     Double free
      •                     Mixing delete and delete[]
    •                 Use after free
      •                     Use after free – Instance of a class
      •                     Spot the bug
      •                     Use after free – Dangling pointers

        Denial of service

  •             DoS introduction
  •             Asymmetric DoS
  •             Case study – Denial-of-service against ICDs
    •                 Evaluation of St. Jude Medical pacemakers / ICDs
    •                 Denial-of-service: battery drain
    •                 SSL/TLS renegotiation DoS
  •             Regular expression DoS (ReDoS)
    •                 Exercise ReDoS
    •                 Case Study – ReDos in Stack Exchange
  •             Hashtable collision attack
    •                 Using hashtables to store inputs
    •                 Hashtable collision

        XML security

  •             Introduction
  •             XML parsing
  •             XML injection
    •                 (Ab)using CDATA to store XSS payload in XML
    •                 Exercise – XML injection
  •             Abusing XML Entity
    •                 XML Entity introduction
    •                 XML bomb
    •                 Exercise – XML bomb
    •                 XML external entity attack (XXE) – resource inclusion
    •                 XML external entity attack – URL invocation
    •                 XML external entity attack – parameter entities
    •                 Exercise – XXE attack
    •                 Preventing entity-related attacks
  •             Case study – XXE in Google Toolbar
  •             XPath injection
    •                 XPath introduction
    •                 XPath injection
    •                 XPath injection defenses
  •             XML Signature
    •                 XML Signature introduction
    •                 XML Signature structure
    •                 Hash collision with XML Digital Signature
    •                 XML canonicalization
    •                 Signing XML documents – spot the bug!
    •                 XML Signature Wrapping (XSW) attack
    •                 XML Signature Wrapping – countermeasures
  •             XML Encryption
    •                 XML Encryption introduction
    •                 XML Encryption structure
    •                 Encryption Wrapping Attack

 5. Security in the software development lifecycle

  •         Building Security In Maturity Model (BSIMM)
  •         Software Assurance Maturity Model (SAMM)
  •         Microsoft Security Development Lifecycle (SDL)
    •             Microsoft Security Development Lifecycle (SDL)
    •             Pre-SDL Requirements: Security Training
    •             Phase One: Requirements
    •             Phase Two: Design
    •             Phase Three: Implementation
    •             Phase Four: Verification
    •             Phase Five: Release
    •             Post-SDL Requirement: Response
    •             SDL Process Guidance for LOB Apps
    •             SDL Guidance for Agile Methodologies

    Security testing

  •         Functional testing vs. security testing
  •         Security vulnerabilities
  •         Prioritization – risk analysis
  •         Security in the SDLC
  •         Security assessments in various SDLC phases
  •         Security testing methodology
    •             Steps of test planning (risk analysis)
    •             Scoping and information gathering
      •                 Stakeholders
      •                 Assets
      •                 Security objectives for testing
    •             Threat modeling
      •                 Attacker profiles
      •                 Threat modeling
      •                 Threat modeling based on attack trees
      •                 Threat modeling based on misuse/abuse cases
      •                 Misuse/abuse cases – a simple example
      •                 SDL threat modeling
      •                 The STRIDE threat categories
      •                 Diagramming – elements of a DFD
      •                 Data flow diagram – example
      •                 Threat enumeration – mapping STRIDE to DFD elements
      •                 Risk analysis – classification of threats
      •                 The DREAD risk assessment model
    •             Testing steps
      •                 Deriving test cases
      •                 Accomplishing the tests
      •                 Processing test results
      •                 Mitigation concepts
      •                 Standard mitigation techniques of MS SDL
      •                 Communicating the results
      •                 Review phase

    Security testing techniques

  •         General testing approaches
  •         Design review
    •             Assessment of security requirements
    •             Identifying security-critical aspects – hotspots
  •         Source code review
    •             Code review for software security
    •             Taint analysis
    •             Heuristic-based
    •             Static code analysis
      •                 Static code analysis
      •                 Exercise – Static code analysis using FlawFinder
  •         Testing the implementation
    •             Dynamic security testing
    •             Manual vs. automated security testing
    •             Penetration testing
    •             Stress tests
    •             Binary and memory analysis
      •                 Exercise – Binary analysis with strings
    •             Instrumentation libraries and frameworks
      •                 Exercise – Using Valgrind
    •             Fuzzing
      •                 Automated security testing - fuzzing
      •                 Challenges of fuzzing

    Deployment environment

  •         Configuration management
  •         Hardening
  •         Patch management
  •         Assessing the environment
    •             Assessing the environment
    •             Searching for online devices with SHODAN
    •             Exercise – using SHODAN
    •             Finding weaknesses with search engines
    •             Exercise – Finding weaknesses with search engines
    •             Password audit
    •             Exercise – using John the Ripper
    •             Testing random number generators
    •             Exercise – Testing random number generators
  •         Vulnerability management
    •             Vulnerability repositories
    •             Vulnerability attributes
    •             Software identification through CPE and SWID
    •             Common Vulnerability Scoring System – CVSS
    •             Vulnerability scanners
  •         Case study - Shellshock
    •             Shellshock – basics of using functions in bash
    •             Shellshock – vulnerability in bash
    •             Exercise - Shellshock
    •             Shellshock fix and counterattacks
    •             Exercise – Command override with environment variables

    Principles of security and secure coding

  •         Matt Bishop’s principles of robust programming
  •         The security principles of Saltzer and Schroeder

    Knowledge sources

  •         Secure coding sources – a starter kit
  •         Vulnerability databases
  •         Recommended books – C/C++  

 

 

 

Kinek ajánljuk

Előfeltételek

Advanced C/C++ development

Kapcsolódó tanfolyamok



Ajánlja másoknak is!