Book Image

Hands-On Enterprise Automation with Python

By : Bassem Aly
Book Image

Hands-On Enterprise Automation with Python

By: Bassem Aly

Overview of this book

Hands-On Enterprise Automation with Python starts by covering the set up of a Python environment to perform automation tasks, as well as the modules, libraries, and tools you will be using. We’ll explore examples of network automation tasks using simple Python programs and Ansible. Next, we will walk you through automating administration tasks with Python Fabric, where you will learn to perform server configuration and administration, along with system administration tasks such as user management, database management, and process management. As you progress through this book, you’ll automate several testing services with Python scripts and perform automation tasks on virtual machines and cloud infrastructure with Python. In the concluding chapters, you will cover Python-based offensive security tools and learn how to automate your security tasks. By the end of this book, you will have mastered the skills of automating several system administration tasks with Python.
Table of Contents (20 chapters)

Understanding Scapy

Scapy (https://scapy.net) is one of the powerful Python tools that is used to capture, sniff, analyze, and manipulate network packets. It can also build a packet structure of layered protocols and inject a wiuthib stream into the network. You can use it to build a wide number of protocols on top of each other and set the details of each field inside the protocol, or, better, let Scapy do its magic and choose the appropriate values so that each one can have a valid frame. Scapy will try to use the default values for packets if not overridden by users. The following values will be set automatically for each stream:

  • The IP source is chosen according to the destination and routing table
  • The checksum is automatically computed
  • The source Mac is chosen according to the output interface
  • The Ethernet type and IP protocol are determined by the upper layer

Scapy can...