Book Image

Mastering Machine Learning for Penetration Testing

By : Chiheb Chebbi
Book Image

Mastering Machine Learning for Penetration Testing

By: Chiheb Chebbi

Overview of this book

Cyber security is crucial for both businesses and individuals. As systems are getting smarter, we now see machine learning interrupting computer security. With the adoption of machine learning in upcoming security products, it’s important for pentesters and security researchers to understand how these systems work, and to breach them for testing purposes. This book begins with the basics of machine learning and the algorithms used to build robust systems. Once you’ve gained a fair understanding of how security products leverage machine learning, you'll dive into the core concepts of breaching such systems. Through practical use cases, you’ll see how to find loopholes and surpass a self-learning security system. As you make your way through the chapters, you’ll focus on topics such as network intrusion detection and AV and IDS evasion. We’ll also cover the best practices when identifying ambiguities, and extensive techniques to breach an intelligent system. By the end of this book, you will be well-versed with identifying loopholes in a self-learning security system and will be able to efficiently breach a machine learning system.
Table of Contents (13 chapters)

Deep learning model using PE headers

With the concepts we've learned, we are going to build a malware detector with artificial neural networks. Let's begin by identifying our dataset. By now, you are familiar with the steps required to build a machine learning models. For this model, we are going to use the Portable Executable (PE) files as feeding data. As you noticed in the previous chapter, we installed a Python library called pefile. It is time to use it in this model. Once we install pefile with the Python package installation manager PIP, we can start using pefile to extract information from any PE file. In order to gather information from a PE file, import the os and pefile libraries. The os library allows you to interface with the underlying operating system that Python is running on.

As a demonstration, we are going to download a malware PE file delivered by...