Skip to Content
Machine Learning for Cybersecurity Cookbook
book

Machine Learning for Cybersecurity Cookbook

by Emmanuel Tsukerman
November 2019
Intermediate to advanced content levelIntermediate to advanced
346 pages
9h 36m
English
Packt Publishing
Content preview from Machine Learning for Cybersecurity Cookbook

How to do it...

In this recipe, you will learn how to create adversarial malware:

  1.  Begin by importing the code for MalGAN, as well as some utility libraries.
import osimport pandas as pdfrom keras.models import load_modelimport MalGAN_utilsimport MalGAN_gen_adv_examples
  1. Specify the input and output paths:
save_path = "MalGAN_output"model_path = "MalGAN_input/malconv.h5"log_path = "MalGAN_output/adversarial_log.csv"pad_percent = 0.1threshold = 0.6step_size = 0.01limit = 0.input_samples = "MalGAN_input/samplesIn.csv"
  1. Set whether you'd like to use a GPU for adversarial sample generation:
MalGAN_utils.limit_gpu_memory(limit)
  1. Read in the csv file containing the names and labels of your samples into a data frame:
df = pd.read_csv(input_samples, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Machine Learning for Cybersecurity

Hands-On Machine Learning for Cybersecurity

Soma Halder, Sinan Ozdemir
Machine Learning on Kubernetes

Machine Learning on Kubernetes

Faisal Masood, Ross Brigoli

Publisher Resources

ISBN: 9781789614671Supplemental Content