Combined Java, PHP and Web application security

CL-JPW
4 nap
280 000 Ft + ÁFA
tanfolyamkezdési időpontok:
Jelentkezem!
oktatók:

A tanfolyam célja

Even experienced programmers do not master by all means the various security services offered by their development platforms, and are likewise not aware of the different vulnerabilities that are relevant for their developments. This course targets developers using both Java and PHP, providing them essential skills necessary to make their applications resistant to contemporary attacks through the Internet.

Levels of Java security architecture are walked through by tackling access control, authentication and authorization, secure communication and various cryptographic functions. Various APIs are also introduced that can be used to secure your code in PHP, like OpenSSL for cryptography or HTML Purifier for input validation. On server side, best practices are given for hardening and configuring the operating system, the web container, the file system, the SQL server and the PHP itself, while a special focus is given to client-side security through security issues of JavaScript, Ajax and HTML5.

General web vulnerabilities are discussed by examples aligned to the OWASP Top Ten, showing various injection attacks, script injections, attacks against session handling, insecure direct object references, issues with file uploads, and many others. The various Java- and PHP-specific language problems and issues stemming from the runtime environment are introduced grouped into the standard vulnerability types of missing or improper input validation, improper use of security features, incorrect error and exception handling, time- and state-related problems, code quality issues and mobile code-related vulnerabilities.

Participants can try out the discussed APIs, tools and the effects of configurations for themselves, while the introduction of vulnerabilities are all supported by a number of hands-on exercises demonstrating the consequences of successful attacks, showing how to correct the bugs and apply mitigation techniques, and introducing the use of various extensions and tools.

  •     Understand basic concepts of security, IT security and secure coding
  •     Learn Web vulnerabilities beyond OWASP Top Ten and know how to avoid them
  •     Learn about XML security
  •     Learn client-side vulnerabilities and secure coding practices
  •     Learn to use various security features of the Java development environment
  •     Learn how to set up and operate the deployment environment securely
  •     Have a practical understanding of cryptography
  •     Learn to use various security features of PHP
  •     Learn about typical coding mistakes and how to avoid them
  •     Understand security concepts of Web services
  •     Learn about JSON security
  •     Learn about denial of service attacks and protections
  •     Get sources and further readings on secure coding practices

Tematika

  •     IT security and secure coding
  •     Web application security
  •     Client-side security
  •     Foundations of Java security
  •     Secure communication in Java
  •     Deployment environment
  •     Practical cryptography
  •     Java security services
  •     Common coding errors and vulnerabilities
  •     Security of Web services
  •     JSON security
  •     Code quality problems
  •     Denial of service
  •     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
  •         Classification of security flaws
    •             Landwehr’s taxonomy
    •             The Seven Pernicious Kingdoms
    •             OWASP Top Ten 2017

    Web application security

  •         Injection
    •             Injection principles
    •             SQL injection
      •                 Exercise – SQL Injection
      •                 Exercise – SQL injection
      •                 Typical SQL Injection attack methods
      •                 Blind and time-based SQL injection
      •                 SQL injection protection methods
      •                 SQL injection protection in PHP
    •             Other injection flaws
      •                 Command injection
      •                 Command injection exercise – starting Netcat
      •                 Case study – ImageMagick
      •                 Cookie injection / HTTP parameter pollution
  •         Broken authentication
    •             Session handling threats
    •             Session data handling in PHP
    •             Exercise – Exploiting week session data handling
    •             Session handling best practices
    •             Session handling in Java
    •             Setting cookie attributes – best practices
  •         Sensitive data exposure
    •             Sensitive data exposure
    •             Transport layer security
  •         XML external entity (XXE)
    •             XML Entity introduction
    •             XML bomb
    •             XML external entity attack (XXE) – resource inclusion
    •             XML external entity attack – URL invocation
    •             XML external entity attack – parameter entities
    •             Preventing entity-related attacks
    •             Case study – XXE in Google Toolbar
  •         Broken access control
    •             Typical access control weaknesses
    •             Insecure direct object reference (IDOR)
    •             Exercise – Insecure direct object reference
    •             Protection against IDOR
    •             Case study – Facebook Notes
  •         Security misconfiguration
  •             Security misconfiguration
    •             Configuring the PHP environment
    •             Setting manipulation in PHP
    •             Insecure file uploads
    •             Exercise – Uploading executable files
    •             Filtering file uploads – validation and configuration

2. Web application security

  •         Cross-Site Scripting (XSS)
    •             Persistent XSS
    •             Reflected XSS
    •             DOM-based XSS
    •             Exercise – Cross Site Scripting
    •             Exploitation: CSS injection
    •             Exploitation: injecting the tag
    •             Exercise – HTML injection with base tag
    •             XSS prevention
    •             XSS prevention tools in Java and JSP
  •         Insecure deserialization
    •             Deserialization basics
    •             Security challenges of deserialization
    •             Deserialization in Java
    •             From deserialization to code execution
    •             POP payload targeting the Apache Commons gadget (Java)
    •             Real-world Java examples of deserialization vulnerabilities
    •             Issues with deserialization – JSON
    •             Best practices against deserialization vulnerabilities
  •         Using components with known vulnerabilities
    •             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
  •         Insufficient logging and monitoring
    •             Detection and response
    •             Logging and log analysis
    •             Intrusion detection systems and Web application firewalls

    Client-side security

  •         JavaScript security
  •         Same Origin Policy
  •         Cross Origin Resource Sharing (CORS)
  •         Exercise – Client-side authentication
  •         Client-side authentication and password management
  •         Protecting JavaScript code
  •         Exercise – JavaScript obfuscation
  •         Clickjacking
    •             Clickjacking
    •             Exercise – Do you Like me?
    •             Protection against Clickjacking
    •             Anti frame-busting – dismissing protection scripts
    •             Protection against busting frame busting
  •         AJAX security
    •             XSS in AJAX
    •             Script injection attack in AJAX
    •             Exercise – XSS in AJAX
    •             XSS protection in Ajax
    •             Exercise CSRF in AJAX – JavaScript hijacking
    •             CSRF protection in AJAX
  •         HTML5 security
    •             New XSS possibilities in HTML5
    •             HTML5 clickjacking attack – text field injection
    •             HTML5 clickjacking – content extraction
    •             Form tampering
    •             Exercise – Form tampering
    •             Cross-origin requests
    •             HTML proxy with cross-origin request
    •             Exercise – Client side include

    Foundations of Java security

  •         The Java environment
  •         Java security
  •         Low-level security – the Java language and environment
  •             Java language security
    •             Type safety
    •             Automatic memory management
    •             Java execution overview
    •             Bytecode Verifier
    •             Class Loader
    •             Protecting Java code
  •         High-level security – access control
    •             Protection domains
    •             Security Manager and Access Controller
    •             Permission checking
    •             Effects of doPrivileged
    •             Exercise Jars – Granting permission to signed code

    Secure communication in Java

  •         Security services
  •         SSL/TLS handshake
  •         Java Secure Socket Extension (JSSE)
  •         Exercise Https – Switching from HTTP to HTTPS
  •         Public Key Infrastructure support
    •             The Java Keystore (JKS)
    •             Java Certification Path (CertPath)

    Deployment environment

  •         Configuration management
  •         Hardening
  •         Server virtualization
  •         PHP Suhosin
  •         Patch management
  •         PHP configuration
    •             php.ini settings – Information disclosure
    •             php.ini settings – Resource limits
    •             php.ini settings – Session handling
    •             php.ini settings – Other security related
  •         Apache configuration
    •             Apache settings
    •             Apache configuration
    •             MIME types

3. 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

    Java security services

  •         Java security services – architecture
  •         Java Cryptographic Architecture
    •             Java Cryptography Architecture / Extension (JCA/JCE)
    •             Using Cryptographic Service Providers
    •             Engine classes and algorithms
    •             Exercise Sign – Generating and verifying signatures
  •         Cryptography in PHP
    •             hash
    •             mcrypt
    •             openssl

    Common coding errors and vulnerabilities

  •         Input validation
    •             Input validation concepts
    •             Path traversal vulnerability
      •                 Path traversal
      •                 Path traversal mitigation
    •             Unvalidated redirects and forwards
    •             Log forging
      •                 Some other typical problems with log files
  •         Input validation and escaping APIs in PHP
    •             Basic input validation functions
    •             Escaping in PHP
    •             Arbitrary code execution
      •                 Arbitrary code execution
      •                 Dangerous functions regarding remote code execution
      •                 Exercise CodeExec –Remote PHP code execution
      •                 Exercise: exploiting preg_replace
  •         Time and state problems
    •             Concurrency and threading
    •             Concurrency in PHP
    •             Spot the bug – Race condition with files
    •             Exercise – Race condition with files
    •             Preventing file race condition
    •             Double submit problem
    •             PHP session handling
    •             A PHP design flaw – open_basedir race condition
    •             Database race condition
    •             Optimistic vs. pessimistic locking
  •         Time and state problems in Java
    •             Time and state related problems
    •             Concurrency – spot the bug!
    •             Calling Thread.run()
    •             Race condition in servlets – spot the bug!
    •             Race condition – spot the bug!
    •             ArrayList vs Vector

    Security of Web services

  •         SOAP security
    •             SOAP - Simple Object Access Protocol
    •             Security of SOAP messages - two approaches
    •             Message level security
  •         Security of RESTful web services
    •             Authentication with REST
    •             Authorization with REST
    •             Vulnerabilities in connection with REST
  •         XML security
    •             Introduction
    •             XML parsing
    •             XML injection
      •                 (Ab)using CDATA to store XSS payload in XML

4. JSON security

  •             Introduction
  •             JSON parsing
  •             Embedding JSON server-side
  •             JSON injection
  •             JSON hijacking
  •             Case study – XSS via spoofed JSON element

        Common coding errors and vulnerabilities

  •             Improper use of security features
    •                 Typical problems related to the use of security features
    •                 Insecure randomness
      •                     Weak PRNGs in Java
      •                     Weak PRNGs in PHP
      •                     Stronger PRNGs in PHP
      •                     Exercise RandomTest
      •                     Using random numbers in Java – spot the bug!
    •                 Password management
      •                     Exercise – Weakness of hashed passwords
      •                     Password management and storage
      •                     Special purpose hash algorithms for password storage
      •                     Argon2 and PBKDF2 implementations in Java
      •                     bcrypt and scrypt implementations in Java
      •                     Storing credentials for external systems in PHP
      •                     Case study – the Ashley Madison data breach
    •                 Accessibility modifiers
      •                     Accessing private fields with reflection in Java
      •                     Exercise Reflection – Accessing private fields with reflection
    •                 Exercise ScademyPay – Integrity protection weakness
  •             Improper error and exception handling
    •                 Typical problems with error and exception handling
    •                 Empty catch block
    •                 Overly broad throws
    •                 Overly broad catch
    •                 Using multi-catch
    •                 Exception handling – spot the bug!
    •                 Exercise ScademyPay – Error handling
    •                 Information leakage through error reporting
    •                 Exercise – Information leakage through error reporting
    •                 Error handling best practices

        Code quality problems

  •             Code quality problems in Java
  •                 Dangers arising from poor code quality
    •                 Poor code quality – spot the bug!
    •                 Unreleased resources
    •                 Private arrays – spot the bug!
    •                 Private arrays – typed field returned from a public method
    •                 Exercise Object Hijack
    •                 Public method without final – object hijacking
    •                 Immutable String – spot the bug!
    •                 Exercise Immutable Strings
    •                 Immutability and security
    •                 Serialization – spot the bug!
    •                 Exercise Serializable Sensitive
  •             Code quality problems in PHP
    •                 PHP variable initialization problems
    •                 PHP type comparison rules
    •                 Magic float
      •                     Magic float

        Denial of service

  •             DoS introduction
  •             Asymmetric DoS
  •             SSL/TLS renegotiation DoS
  •             Asymmetric DOS with JSON deserialization
  •             Regular expression DoS (ReDoS)
    •                 Exercise ReDoS
    •                 ReDoS mitigation
    •                 Case Study – ReDos in Stack Exchange
  •             Hashtable collision attack
    •                 Using hashtables to store inputs
    •                 Hashtable collision
    •                 Hashtable collision in Java
    •                 Fix for the hashtable collision attack

        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
  •             PHP secure coding guidelines and sources – a compilation
  •             Cheat sheets
  •             Java secure coding sources
  •             Recommended books – PHP
  •             Recommended books – Java

 

Kinek ajánljuk

Előfeltételek

Advanced Java, PHP and Web application development

Kapcsolódó tanfolyamok



Ajánlja másoknak is!