Book Image

Python Penetration Testing Essentials - Second Edition

By : Mohit Raj
Book Image

Python Penetration Testing Essentials - Second Edition

By: Mohit Raj

Overview of this book

This book gives you the skills you need to use Python for penetration testing (pentesting), with the help of detailed code examples. We start by exploring the basics of networking with Python and then proceed to network hacking. Then, you will delve into exploring Python libraries to perform various types of pentesting and ethical hacking techniques. Next, we delve into hacking the application layer, where we start by gathering information from a website. We then move on to concepts related to website hacking—such as parameter tampering, DDoS, XSS, and SQL injection. By reading this book, you will learn different techniques and methodologies that will familiarize you with Python pentesting techniques, how to protect yourself, and how to create automated programs to find the admin console, SQL injection, and XSS attacks.
Table of Contents (11 chapters)

Pentesting SQL and XSS

In this chapter, we will discuss some serious attacks on a web application. You must have heard about incidents such as data theft, the cracking of usernames and passwords, the defacement of websites, and so on. These are known to occur mainly due to the vulnerabilities that exist in web applications, which are usually performed with SQL injection and XSS attacks. In Chapter 7, Foot Printing a Web Server and a Web Application, you learned how to see which database software is being used and which OS is running on the web server. Now, we will proceed with our attacks one by one. In this chapter, we will cover the following topics:

  • The SQL injection attack
  • Types of SQL injection attacks
  • An SQL injection attack by Python script
  • A cross-site scripting attack
  • Types of XSS
  • An XSS attack by Python script