Security Testing Tutorial
Total Page:16
File Type:pdf, Size:1020Kb
Security Testing About the Tutorial Security Testing is performed to reveal security flaws in the system in order to protect data and maintain functionality. This tutorial explains the core concepts of Security Testing and related topics with simple and useful examples. Audience This tutorial has been prepared for beginners to help them understand the basics of security testing. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of software testing and its related concepts. Copyright & Disclaimer ¬ Copyright 2017 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected] i Security Testing Table of Contents About the Tutorial ....................................................................................................................................... i Audience ..................................................................................................................................................... i Prerequisites ............................................................................................................................................... i Copyright & Disclaimer ................................................................................................................................ i Table of Contents ....................................................................................................................................... ii 1. SECURITY TESTING ─ OVERVIEW .............................................................................................1 What is Security Testing? ........................................................................................................................... 1 Example ..................................................................................................................................................... 1 2. SECURITY TESTING ─ PROCESS ................................................................................................2 Penetration Test – Workflow ..................................................................................................................... 2 Footprinting ............................................................................................................................................... 3 Footprinting – Steps ................................................................................................................................... 3 Scanning ..................................................................................................................................................... 4 Enumeration .............................................................................................................................................. 5 Exploitation ................................................................................................................................................ 6 3. SECURITY TESTING ─ MALICIOUS SOFTWARE .........................................................................8 Malwares ................................................................................................................................................... 8 Preventive Measures.................................................................................................................................. 8 Anti-Malware Software .............................................................................................................................. 9 4. SECURITY TESTING ─ HTTP PROTOCOL BASICS......................................................................10 HTTP Protocol .......................................................................................................................................... 10 Basic Features .......................................................................................................................................... 10 Architecture ............................................................................................................................................. 11 HTTP Parameters...................................................................................................................................... 11 ii Security Testing HTTP Messages ........................................................................................................................................ 14 HTTP Requests ......................................................................................................................................... 16 HTTP Responses ....................................................................................................................................... 20 HTTP Methods .......................................................................................................................................... 23 HTTP Status Codes.................................................................................................................................... 30 HTTP Header Fields .................................................................................................................................. 33 Client Request Headers ............................................................................................................................ 37 Server Response Headers ......................................................................................................................... 44 Entity Headers .......................................................................................................................................... 47 HTTP Security ........................................................................................................................................... 50 5. SECURITY TESTING ─ HTTPS PROTOCOL BASICS ....................................................................53 When is HTTPS Required? ........................................................................................................................ 53 Basic Working of HTTPS............................................................................................................................ 53 6. SECURITY TESTING ─ ENCODING AND DECODING ................................................................55 What is Encoding and Decoding? ............................................................................................................. 55 7. SECURITY TESTING ─ CRYPTOGRAPHY ..................................................................................61 What is Cryptography? ............................................................................................................................. 61 How Encryption Works? ........................................................................................................................... 61 Cryptography Techniques ......................................................................................................................... 61 8. SECURITY TESTING ─ SAME ORIGIN POLICY ..........................................................................63 What is Same Origin Policy? ..................................................................................................................... 63 Example ................................................................................................................................................... 63 Same Origin policy Exceptions for IE ........................................................................................................ 63 iii Security Testing 9. SECURITY TESTING ─ TESTING COOKIES ................................................................................64 What is a Cookie? ..................................................................................................................................... 64 Properties of Cookies ............................................................................................................................... 64 Cookie Contents ....................................................................................................................................... 64 Types of Cookies ...................................................................................................................................... 64 Testing Cookies ........................................................................................................................................ 65 Viewing and Editing Cookies .................................................................................................................... 65 10. SECURITY TESTING ─ HACKING WEB APPLICATIONS .............................................................67 Web Application - PenTesting Methodologies .........................................................................................