November 2019
Intermediate to advanced
346 pages
9h 36m
English
In the following steps, we will demonstrate how a binary classifier can detect obfuscated JavaScript files:
import osfrom sklearn.feature_extraction.text import HashingVectorizer, TfidfTransformerfrom sklearn.ensemble import RandomForestClassifierfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_score, confusion_matrixfrom sklearn.pipeline import Pipeline
js_path = "path\\to\\JavascriptSamples" ...