|
|
|
@ -10,7 +10,8 @@ from util import find_data_file
|
|
|
|
|
|
|
|
|
|
BG_IMG = 'icon.png'
|
|
|
|
|
filename = sysid + "gendata.csv"
|
|
|
|
|
COLUMN_NAMES = np.flip(['Executable', 'Protocol', 'Source IP', 'Destination IP', 'Status', 'PID'])
|
|
|
|
|
COLUMN_NAMES = np.flip(['Executable', 'Proto', 'Source IP', 'Destination IP', 'Status', 'PID'])
|
|
|
|
|
COLUMN_SIZES = np.flip([150, 50, 200, 200, 110, 65])
|
|
|
|
|
TEST_FILE = None
|
|
|
|
|
|
|
|
|
|
displaydata = None
|
|
|
|
@ -81,7 +82,7 @@ class LoginPanel(wx.Panel):
|
|
|
|
|
settings["username"] = basicText.GetValue()
|
|
|
|
|
settings["password"] = pwdText.GetValue()
|
|
|
|
|
settings["login"] = True
|
|
|
|
|
OtherFrame()
|
|
|
|
|
#OtherFrame()
|
|
|
|
|
|
|
|
|
|
def on_help(self, event):
|
|
|
|
|
HelpFrame()
|
|
|
|
@ -120,7 +121,7 @@ class HelpPanel(wx.Panel):
|
|
|
|
|
class ServerPanel(wx.Panel):
|
|
|
|
|
def __init__(self, parent):
|
|
|
|
|
super().__init__(parent, size=(500, 500))
|
|
|
|
|
self.SetBackgroundColour((44, 51, 51))
|
|
|
|
|
#self.SetBackgroundColour((44, 51, 51))
|
|
|
|
|
|
|
|
|
|
main_sizer = wx.BoxSizer(wx.VERTICAL)
|
|
|
|
|
secondary_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
|
|
|
@ -131,16 +132,29 @@ class ServerPanel(wx.Panel):
|
|
|
|
|
)
|
|
|
|
|
tb = wx.ToolBar( self, -1)
|
|
|
|
|
self.ToolBar = tb
|
|
|
|
|
tb.SetToolBitmapSize(wx.Size(30, 3))
|
|
|
|
|
tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("WXPython_30x30.png")),)
|
|
|
|
|
tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("settings_30x30.png")))
|
|
|
|
|
tb.Realize()
|
|
|
|
|
main_sizer.Add(tb)
|
|
|
|
|
#main_sizer.SetBackgroundColour((44, 51, 51))
|
|
|
|
|
# self.pnl1.SetBackgroundColour(wx.BLACK)
|
|
|
|
|
self.handle_columns()
|
|
|
|
|
global settings
|
|
|
|
|
for i in range(len(TEST_FILE)):
|
|
|
|
|
self.list_ctrl.InsertItem(i, TEST_FILE.iloc[i, 0])
|
|
|
|
|
#fprint(TEST_FILE.iloc[i, 5] + " in " + str(settings["badapps"]))
|
|
|
|
|
#if TEST_FILE.iloc[i, 5] in settings["badapps"]:
|
|
|
|
|
for pid in settings["badapps"]:
|
|
|
|
|
#fprint(pid)
|
|
|
|
|
if str(TEST_FILE.iloc[i, 5]) == str(pid):
|
|
|
|
|
#fprint("Got " + TEST_FILE.iloc[i, 5])
|
|
|
|
|
settings["killbox"].append(pid)
|
|
|
|
|
fprint(settings["killbox"])
|
|
|
|
|
self.list_ctrl.SetItemBackgroundColour(i, wx.Colour(200, 51, 51))
|
|
|
|
|
for j in range(1, 6):
|
|
|
|
|
self.list_ctrl.SetItem(i, j, str(TEST_FILE.iloc[i, j]))
|
|
|
|
|
|
|
|
|
|
#fprint(i, j, TEST_FILE.iloc[i, j])
|
|
|
|
|
|
|
|
|
|
main_sizer.Add(self.list_ctrl, 0, wx.ALL | wx.EXPAND, 20)
|
|
|
|
@ -156,13 +170,13 @@ class ServerPanel(wx.Panel):
|
|
|
|
|
# wx.BORDER(stop_button, wx.BORDER_NONE)
|
|
|
|
|
stop_button.Bind(wx.EVT_BUTTON, self.on_edit)
|
|
|
|
|
main_sizer.Add(start_button, 0, wx.CENTER | wx.ALL | 100, 5)
|
|
|
|
|
main_sizer.Add(stop_button, 0, wx.CENTER | 100, 5)
|
|
|
|
|
main_sizer.Add(secondary_frame_button, 0, wx.CENTER | 100, 5)
|
|
|
|
|
main_sizer.Add(stop_button, 0, wx.CENTER | wx.ALL | 100, 5)
|
|
|
|
|
main_sizer.Add(secondary_frame_button, 0, wx.CENTER | wx.ALL | 100, 5)
|
|
|
|
|
self.SetSizer(main_sizer)
|
|
|
|
|
|
|
|
|
|
def handle_columns(self):
|
|
|
|
|
for col in COLUMN_NAMES:
|
|
|
|
|
self.list_ctrl.InsertColumn(0, col, width=200)
|
|
|
|
|
for col in range(len(COLUMN_NAMES)):
|
|
|
|
|
self.list_ctrl.InsertColumn(0, COLUMN_NAMES[col], width=COLUMN_SIZES[col])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|