Skip to content

Commit

Permalink
honeynet#15 features added
Browse files Browse the repository at this point in the history
  • Loading branch information
greninja committed Dec 30, 2016
2 parents 664e802 + f862292 commit e214147
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions conf/cuckooml.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ compare_new_samples = true

# Set folder for samples to be compared against clustering
test_directory = sample_data/test

# Do plotting?
plotting = true
20 changes: 16 additions & 4 deletions modules/processing/cuckooml.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
from lib.cuckoo.common.constants import CUCKOO_ROOT
from math import log

if Config("cuckooml").cuckooml.plotting:
try:
import matplotlib.pyplot as plt
import seaborn as sns
except ImportError, e:
print >> sys.stderr, "Some error while importing"
print >> sys.stderr, e


try:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from hdbscan import HDBSCAN
from sklearn import metrics
from sklearn.cluster import DBSCAN
Expand Down Expand Up @@ -800,7 +807,10 @@ def detect_abnormal_behaviour(self, count_dataset=None, figures=True):

# Safety check for plotting
if not Config("cuckooml").cuckooml.plotting and figures:
print >> sys.stderr, "Warning: 'plotting' and 'figures' do not match. Plotting modules might not be imported."

print >> sys.stderr, "Warning: 'plotting' and 'figures' do not match. \
Plotting modules might not be imported."

figures = False


Expand Down Expand Up @@ -1143,7 +1153,9 @@ def clustering_label_distribution(self, clustering, labels, plot=False):

# Safety check for plotting
if not Config("cuckooml").cuckooml.plotting and plot:
print >> sys.stderr, "Warning: 'plotting' and 'plot' do not match. Plotting modules might not be imported."
print >> sys.stderr, "Warning: 'plotting' and 'plot' do not match.\
Plotting modules might not be imported."

plot = False


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ beautifulsoup4==4.4.1
cffi==1.2.1
chardet==2.3.0
cryptography==1.0
cython==0.25.2
Django==1.8.4
dpkt==1.8.6.2
ecdsa==0.13
Expand Down

0 comments on commit e214147

Please sign in to comment.