Book Review: Mastering Python for Networking and Security.Leverage Python scripts and libraries to overcome
networking and security issues

José Manuel Ortega
5 min readNov 12, 2018

It’s becoming more and more apparent that security is a critical aspect of IT infrastructure. A data breach is a major security incident, usually carried out by just hacking a simple network line. Increasing your network’s security helps step up your defenses against cyber attacks. Meanwhile, Python is being used for increasingly advanced tasks, with the latest update introducing many new packages. This book focuses on leveraging these updated packages to build a secure network with the help of Python scripting.

This book covers the following exciting features:

  • Develop Python scripts for automating security and pentesting tasks
  • Discover the Python standard library’s main modules used for performing security-related tasks
  • Automate analytical tasks and the extraction of information from servers
  • Explore processes for detecting and exploiting vulnerabilities in servers
  • Use network software for Python programming
  • Perform server scripting and port scanning with Python
  • Identify vulnerabilities in web applications with Python Use Python to extract metadata and forensics.

Who this book is for

This book would be ideal for network engineers, system administrators, and any security professional looking at tackling networking and security challenges. Security researchers and developers interested in going deeper into Python and its networking and security packages also would make the most of this book.

What this book covers

Chapter 1, Working with Python Scripting, introduces you to the Python language, object-oriented programming, data structures, a methodology for developing with Python, and development environments.

Chapter 2, System Programming Packages, teaches you about the main Python modules for system programming, looking at topics inclusing reading and writing files, threads, sockets, multithreading, and concurrency.

Chapter 3, Sockets Programming, gives you some basics on Python networking using the socket module. The socket module exposes all of the necessary pieces to quickly write TCP and UDP clients, as well as servers for writing low-level network applications.

Chapter 4, HTTP Programming, covers the HTTP protocol and the main Python modules, such as the urllib standard library and the requests package. We also cover HTTP authentication mechanisms and how we can manage them with the requests module.

Chapter 5, Analyzing Network Traffic, gives you some basics on analyzing network traffic in Python using Scapy. An investigator can write Scapy scripts to investigate either real-time traffic by sniffing a promiscuous network interface, or load previously captured pcap files.

Chapter 6, Gathering Information from Servers, explores the modules that allow the extraction of information that the servers publicly expose, such as Shodan. We also look at getting servers banners and information on DNS servers, and introduce you to fuzzing processing.

Chapter 7, Interacting with FTP, SSH, and SNMP Servers, details the Python modules that allow us to interact with FTP, SSH, and SNMP servers.

Chapter 8, Working with Nmap Scanner, introduces Nmap as port scanner and covers how to implement network scanning with Python and Nmap to gather information on a network, a specific host, and the services that are running on that host. Also, we cover the programming of routines to find possible vulnerabilities in a given network with Nmap scripts.

Chapter 9, Connecting with the Metasploit Framework, covers the Metasploit Framework as a tool to exploit vulnerabilities, and explores how to use the python-msfprc and pymetasploit modules.

Chapter 10, Interacting with Vulnerability Scanners, gets into Nessus and Nexpose as vulnerability scanners and gives you reporting tools for the main vulnerabilities that can be found in servers and web applications with them. Also, we cover how to use them programmatically from Python with the nessrest and Pynexpose modules.

Chapter 11, Identifying Server Vulnerabilities in Web Applications, covers the main vulnerabilities in web applications with OWASP methodology and the tools we can find in the Python ecosystem for vulnerability scanning in web applications. We also we cover testing openSSL vulnerabilities in servers.

Chapter 12, Extracting Geolocation and Metadata from Documents, Images, and Browsers, explores the main modules we have in Python for extracting information about geolocation and metadata from images and documents, identifying web technologies, and extracting metadata from Chrome and Firefox.

Chapter 13, Cryptography and Steganography, dives into the main modules we have in Python for encrypting and decrypting information, such as pycrypto and cryptography. Also, we cover steganography techniques and how to hide information in images with the stepic module.

This is the main github repository for examples.

The book is also available in amazon:

https://www.amazon.com/gp/product/B07DTBD1YL

--

--

José Manuel Ortega

Soy Ingeniero de Software centrado en nuevas tecnologías, open source y seguridad.Actualmente investigando en herramientas de machine learning con python