August 2019
Intermediate to advanced
342 pages
9h 35m
English
We have already met decision trees before, when we addressed the topic of phishing detection. Obviously, we can also use decision trees to perform malware detection.
In our example, we will use the AddressOfEntryPoint and DllCharacteristics fields as potentially distinctive features for detecting the suspect .exe:
import pandas as pdimport numpy as npfrom sklearn import *from sklearn.metrics import accuracy_scoremalware_dataset = pd.read_csv('../datasets/MalwareArtifacts.csv', delimiter=',')# Extracting artifacts samples fields "AddressOfEntryPoint" and# "DllCharacteristics"samples = malware_dataset.iloc[:, [0, 4]].valuestargets = malware_dataset.iloc[:, 8].valuesfrom sklearn.model_selection import train_test_split ...Read now
Unlock full access