Security testing C and C++ applications

Security testing C and C++ applications

Course overview

Your application written in C and C++ is tested functionally, so you’re done, right?

But have you thought about entering incorrect values? 16 GB data? And zero? An apostrophe? Negative numbers, or specifically -1 or -2^31? Because that’s what the bad guys will do – and the list is far from complete.

Security testing requires a remarkable expertise in software security and a healthy level of paranoia, and that’s what this course provides: a strong emotional engagement through lots of hands-on labs and real-life stories. Particular focus is placed on finding all discussed issues during testing, and an overview is given of security testing methods, techniques, and tools. So that you are prepared for the forces of the dark side. So that nothing unexpected happens. Nothing.

Overview of the

  • Cybersecurity basics
  • Vulnerabilities in memory management
  • Strengthening memory management
  • Security testing
  • Common software security flaws
  • Unpacking

Delivery:

  • On site for three days, 09:00–17:00
  • Online for five days, Monday–Friday 09:00–13:00

This product is currently out of stock and unavailable.

Course Objective

  • Getting acquainted with basic concepts of cybersecurity
  • Understanding of security testing methodology and approaches
  • Identifying vulnerabilities and their consequences
  • Learn best practices for security in C and C++
  • Methods and principles for validating input data
  • Familiarize yourself with security testing techniques and tools

Target Group

C/C++ Developers Testers

Prerequisites

General C/C++ development, testing, and quality assurance

Certification

This course does not have any associated certification. Each participant who completes the course receives a course certificate.

Trainer

This course is delivered in collaboration with one of Informator’s partners.

More about the course

DAY 1

Cybersecurity basics

Vulnerabilities in memory management

  • Basics of assembly and calling conventions
  • x64 assembly essentials
  • Records and addressing
  • The most common instructions
  • Calling Conventions on x64
  • Call conventions – what is it all about
  • The stacking frame
  • Stacked function calls
  • Buffer overflow
  • Memory Management and Security
  • Real-world vulnerabilities
  • Buffer security issues
  • Buffer overflow on the stack
  • Buffer overflow on the stack – stack smashing
  • Exploitation – Hijacking the control flow
  • Lab – Buffer overflow 101, code reuse
  • Exploit – arbitrary execution of code
  • Shell code injection
  • Lab – Code injection, shellcode exploit
  • Buffer overflow on the heap
  • Uncertain decoupling
  • Case Study – Heartbleed
  • Pointer Manipulation
  • Modification of jump tables
  • Function pointer overwriting
  • Best practices and some typical mistakes
  • Uncertain features
  • Handling of insecure features
  • Lab – Fixing Buffer Overflow
  • What is the problem with asctime()?
  • Lab – The problem with asctime()
  • Using std::string in C++
  • Strings that don’t terminate
  • readlink() and string termination
  • Manipulating C-style strings in C++
  • Intentional string termination
  • Lab – Confusion about string termination
  • Mistakes when calculating string length
  • Off-by-one error
  • Allocate nothing
  • Test for typical mistakes

DAY 2 — Strengthening memory management

  • Runtime protection
  • Runtime Instrumentation
  • Address Space Layout Randomization (ASLR)
  • ASLR on different platforms
  • Lab – Effects of ASLR
  • Bypass ASLR – NOP Sleds
  • Bypass ASLR – Memory Leak – Non-Executable Memory Ranges
  • The NX bit
  • Write XOR Execute (W^X)
  • NX on different platforms
  • Lab – Effects of NX
  • NX Prompts – Code Reuse Attacks
  • Return-to-libc/arc injection
  • Return Oriented Programming (ROP)
  • Protection against ROP

Security testing

  • Security Testing vs. Functional Testing
  • Manual and automated methods
  • Methodology for security testing
  • Security testing – objectives and methods
  • Overview of security testing processes
  • Asset identification and valuation
  • Preparation
  • Asset identification
  • Attack surface detection
  • Assigning security requirements
  • Lab – Asset Identification and Valuation
  • Threat modeling
  • SDL threat modeling
  • Mapping STRIDE to DFD
  • Examples of DFD
  • Attacking trees
  • Examples of infestation trees
  • Lab – Creating an Infestation Tree
  • Cases of abuse
  • Examples of cases of abuse
  • Risk analysis
  • Laboratory work – Risk analysis
  • Reporting, recommendations and review

Common software security flaws

  • Security features
  • Authentication
  • Basics of authentication
  • Multi-factor authentication
  • Weaknesses in authentication
  • Case Study – PayPal 2FA Bypass
  • Password Management
  • Inbound password management
  • Account password storage
  • Passwords in transit
  • Lab – Is it enough to just hash passwords?
  • Dictionary attacks and brute forcing
  • Salting
  • Adaptive hash functions for storing passwords
  • Password policy
  • NIST authenticator requirements for memorized secrets
  • Case study – The Ashley Madison data breach
  • The attack with a dictionary
  • The ultimate crack
  • Exploitation and lessons learned
  • Password database migration
  • Testing for password management issues

DAY 3 — Common Software Security Flaws

  • Validation of input
  • Input validation principles
  • Denylists and allowlists
  • What to validate – the attack surface
  • Where to validate – defense in depth
  • When to Validate – Validation vs. Transformations
  • Validation with regex
  • Injection
  • Injection Principles
  • Injection attacks
  • Code injection
  • Injection of OS commands
  • Lab – Command Injection
  • Best practices for injecting OS commands
  • Avoid command injection with the right APIs
  • Lab – Best Practices for Command Injection
  • Case Study – Shellshock
  • Laboratory – Shellshock
  • Command Injection Testing – Process Control – Library Injection
  • Hijacking of libraries
  • Lab – Library Hijacking
  • Problems with handling integers
  • Impersonate signed speeches
  • Integer visualization
  • Integer Marketing
  • Abundance of integers
  • Lab – Abundance of Integers
  • Confusion between signed and unsigned
  • Case study – Stockholm Stock Exchange
  • Lab – Confusion of signed and unsigned characters
  • Integer truncation
  • Laboratory – Truncation of integers
  • Case Study – WannaCry
  • Best practices
  • Upcasting
  • Prep testing
  • Post-conditioning testing
  • Best practices in C
  • UBSan changes to arithmetic
  • Lab – Toolchain-level Handling of Integer Overruns in C and C++
  • Best practices in C++
  • Laboratory – Best Practices for Handling Integers in C++
  • Numerical Problem Testing
  • Files and streams
  • Path Traversal
  • Lab – Traversing Path
  • Example of path traversal
  • Best practices for trail traversal
  • Lab – Path Canonicalization
  • Path Traversal Test

Security testing (continued)

  • Security Testing Techniques and Tools
  • Code analysis
  • Static Application Security Testing (SAST)
  • Laboratory work – Use of tools for static analysis
  • Dynamic analytics
  • Safety testing at the drive
  • Penetration testing
  • Stress testing
  • Dynamic analytics tools
  • Dynamic Application Security Testing (DAST)
  • Fuzzing
  • Fuzzing Techniques
  • Fuzzing – Observing the process

Closure

  • Secure Coding Principles
  • Principles of Robust Programming by Matt Bishop
  • Principles of Safe Design by Saltzer and Schroeder
  • And now what?
  • Sources and Further Reading on Software Security
  • C and C++ Resources
  • Security testing resources

Course overview

3 days

Basic

Can’t find a (suitable) date, but are interested in the course? Send in an expression of interest and we will do what we can to get an opportunity that suits.

För samtliga utbildningar gäller våra
Allmänna Villkor.

Company-adapted course

The course can be adapted from several perspectives:
  • Content and focus area
  • Scope of application
  • Structure

In collaboration with the course leader, we make sure that the course meets your wishes

Send an expression of interest for the training

Send an expression of interest for the training