Book Image

Kali Linux Web Penetration Testing Cookbook

By : Gilberto Najera-Gutierrez
Book Image

Kali Linux Web Penetration Testing Cookbook

By: Gilberto Najera-Gutierrez

Overview of this book

Web applications are a huge point of attack for malicious hackers and a critical area for security professionals and penetration testers to lock down and secure. Kali Linux is a Linux-based penetration testing platform and operating system that provides a huge array of testing tools, many of which can be used specifically to execute web penetration testing. This book will teach you, in the form step-by-step recipes, how to detect a wide array of vulnerabilities, exploit them to analyze their consequences, and ultimately buffer attackable surfaces so applications are more secure, for you and your users. Starting from the setup of a testing laboratory, this book will give you the skills you need to cover every stage of a penetration test: from gathering information about the system and the application to identifying vulnerabilities through manual testing and the use of vulnerability scanners to both basic and advanced exploitation techniques that may lead to a full system compromise. Finally, we will put this into the context of OWASP and the top 10 web application vulnerabilities you are most likely to encounter, equipping you with the ability to combat them effectively. By the end of the book, you will have the required skills to identify, exploit, and prevent web application vulnerabilities.
Table of Contents (17 chapters)
Kali Linux Web Penetration Testing Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Step by step basic SQL Injection


We saw in Chapter 4, Finding Vulnerabilities, how to detect an SQL Injection. In this recipe, we will exploit an injection and use it to extract information from the database.

How to do it...

  1. We already know that DVWA is vulnerable to SQL Injection, so let's login using OWASP-Mantra and go to http://192.168.56.102/dvwa/vulnerabilities/sqli/.

  2. After detecting that an SQLi exists, the next step is to get to know the query, more precisely, the number of columns its result has. Enter any number in the ID box and click Submit.

  3. Now, open the HackBar (hit F9) and click Load URL. The URL in the address bar should now appear in the HackBar.

  4. In the HackBar, we replace the value of the id parameter with 1' order by 1 -- ' and click on Execute.

  5. We keep increasing the number after order by and executing the requests until we get an error. In this example, it happens when ordering by 3.

  6. Now, we know that the query has two columns. Let's try if we can use the UNION statement to...