Book description
Gain a firm, practical understanding of securing your network and utilize Python’s packages to detect vulnerabilities in your application
Key Features
- Discover security techniques to protect your network and systems using Python
- Create scripts in Python to automate security and pentesting tasks
- Analyze traffic in a network and extract information using Python
Book Description
Python’s latest updates add numerous libraries that can be used to perform critical security-related missions, including detecting vulnerabilities in web applications, taking care of attacks, and helping to build secure and robust networks that are resilient to them. This fully updated third edition will show you how to make the most of them and improve your security posture.
The first part of this book will walk you through Python scripts and libraries that you’ll use throughout the book. Next, you’ll dive deep into the core networking tasks where you will learn how to check a network’s vulnerability using Python security scripting and understand how to check for vulnerabilities in your network – including tasks related to packet sniffing. You’ll also learn how to achieve endpoint protection by leveraging Python packages along with writing forensics scripts.
The next part of the book will show you a variety of modern techniques, libraries, and frameworks from the Python ecosystem that will help you extract data from servers and analyze the security in web applications. You’ll take your first steps in extracting data from a domain using OSINT tools and using Python tools to perform forensics tasks.
By the end of this book, you will be able to make the most of Python to test the security of your network and applications.
What you will learn
- Program your own tools in Python that can be used in a Network Security process
- Automate tasks of analysis and extraction of information from servers
- Detect server vulnerabilities and analyze security in web applications
- Automate security and pentesting tasks by creating scripts with Python
- Utilize the ssh-audit tool to check the security in SSH servers
- Explore WriteHat as a pentesting reports tool written in Python
- Automate the process of detecting vulnerabilities in applications with tools like Fuxploider
Who this book is for
This Python book is for network engineers, system administrators, and other security professionals looking to overcome common networking and security issues using Python. You will also find this book useful if you're an experienced programmer looking to explore Python’s full range of capabilities. A basic understanding of general programming structures as well as familiarity with the Python programming language is a prerequisite.
Table of contents
- Preface
- Section 1: Python Environment and System Programming Tools
-
Working with Python Scripting
- Technical requirements
- Learn about data structures and collections in Python
- Working with functions, classes, and objects in Python
- Working with files in Python
- Python modules and packages
- Managing dependencies and virtual environments
- Development environments for Python scripting
- Summary
- Questions
- Further reading
- System Programming Packages
- Section 2: Network Scripting and Packet Sniffing with Python
-
Socket Programming
- Technical requirements
- Understanding the socket package for network requests
- Port scanning with sockets
- Implementing a reverse shell with sockets
- Implementing a simple TCP client and TCP server
- Implementing a simple UDP client and UDP server
- Implementing an HTTP server in Python
- Implementing secure sockets with the TLS and SSL modules
- Summary
- Questions
- Further reading
-
HTTP Programming and Web Authentication
- Technical requirements
- Building an HTTP client with urllib.request
- Get request and response headers
- Building an HTTP client with requests
- Authentication mechanisms with Python
- Implementing OAuth clients in Python with the requests-oauthlib module
- Implementing a client with requests_oauthlib
- Implementing JSON Web Tokens (JWTs) in Python
- Summary
- Questions
- Further reading
- Analyzing Network Traffic and Packet Sniffing
- Section 3: Server Scripting and Port Scanning with Python
- Gathering Information from Servers with OSINT Tools
- Interacting with FTP, SFTP, and SSH Servers
- Working with Nmap Scanner
- Section 4: Server Vulnerabilities and Security in Web Applications
- Interacting with Vulnerability Scanners
-
Interacting with Server Vulnerabilities in Web Applications
- Technical requirements
- Understanding vulnerabilities in web applications with OWASP
- Analyzing and discovering vulnerabilities in CMS web applications
- Discovering vulnerabilities in Tomcat server applications
- Discovering SQL vulnerabilities with Python tools
- Automating the process of detecting vulnerabilities in web applications
- Summary
- Questions
- Further reading
- Obtain Information from Vulnerabilities Databases
- Section 5: Python Forensics
-
Extracting Geolocation and Metadata from Documents, Images, and Browsers
- Technical requirements
- Extracting geolocation information
- Python modules for extracting geolocation information
- Extracting metadata from images
- Extracting metadata from PDF documents
- Extracting metadata with PyPDF2
- Extracting metadata with PyMuPDF
- Identifying the technology used by a website
- Extracting metadata from web browsers
- Summary
- Questions
- Further reading
- Python Tools for Brute-Force Attacks
- Cryptography and Code Obfuscation
- Assessments – Answers to the End-of-Chapter Questions
- Other Books You May Enjoy
- Index
Product information
- Title: Python for Security and Networking - Third Edition
- Author(s):
- Release date: June 2023
- Publisher(s): Packt Publishing
- ISBN: 9781837637553
You might also like
book
Mastering Python for Networking and Security
Master Python scripting to build a network and perform security operations Key Features Learn to handle …
book
Mastering Python for Networking and Security - Second Edition
Tackle security and networking issues using Python libraries such as Nmap, requests, asyncio, and scapy Key …
book
Linux Basics for Hackers
If you’re getting started along the exciting path of hacking, cybersecurity, and pentesting, Linux Basics for …
book
Mastering Linux Security and Hardening - Third Edition
Gain a firm practical understanding of how to secure your Linux system from intruders, malware attacks, …