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)

What this book covers

Chapter 1, Python with Penetration Testing and Networking, goes through the prerequisites of the following chapters. This chapter also discusses the socket and its methods. The server socket's method defines how to create a simple server.

Chapter 2, Scanning Pentesting, covers how to perform network scanning to gather information on a network, host, and the services that are running on the hosts. You will see a very fast and efficient IP scanner.

Chapter 3, Sniffing and Penetration Testing, teaches how to perform active sniffing and how to create a Transport layer sniffer. You will learn special kinds of scanning.

Chapter 4, Network Attacks and Prevention, outlines different types of network attacks, such as DHCP starvation and switch mac flooding. You will learn how to detect a torrent on the client side.

Chapter 5, Wireless Pentesting, goes through wireless frames and explains how to obtain information such as SSID, BSSID, and the channel number from a wireless frame using a Python script. In this type of attack, you will learn how to perform pentesting attacks on the AP.

Chapter 6, Honeypot – Building Traps for Attackers, focuses on how to build a trap for attackers. You will learn how to bulid code from TCP layer 2 to TCP layer 4.

Chapter 7, Foot Printing a Web Server and a Web Application, dives into the importance of a web server signature, email gathering, and why knowing the server signature is the first step in hacking.

Chapter 8, Client-Side and DDoS Attacks, explores client-side validation and how to bypass client-side validation. This chapter covers the implantation of four types of DDoS attacks.

Chapter 9, Pentesting SQL and XSS, discusses two major web attacks: SQL injection and XSS. In SQL injection, you will learn how to find the admin login page using a Python script.