fix macos invalid data temporarily

testing
Cole Deck 2 years ago
parent f6cc6b6fef
commit 86eeb716ac

@ -57,7 +57,9 @@ def block_conn(config, datafile, res):
continue continue
srcip = line[2].split(":")[0] srcip = line[2].split(":")[0]
srcport = line[2].split(":")[1]
destip = line[3].split(":")[0] destip = line[3].split(":")[0]
destport = line[3].split(":")[1]
pid = line[5] pid = line[5]
try: try:
pid = int(pid) pid = int(pid)
@ -67,10 +69,12 @@ def block_conn(config, datafile, res):
for line in baddata: for line in baddata:
#fprint(destip + " " + line[4]) #fprint(destip + " " + line[4])
badsrcip = line[2] badsrcip = line[2]
badsrcport = line[3]
baddestip = line[4] baddestip = line[4]
baddestport = line[5]
badpid = line[11] badpid = line[11]
if srcip == badsrcip or destip == baddestip and not pid in badapps: if ((srcip == badsrcip and srcport == badsrcport) or (destip == baddestip and destport == baddestport)) and not pid in badapps:
found = True found = True
fprint("FLAG " + srcip + " " + destip + " " + str(pid)) fprint("FLAG " + srcip + " " + destip + " " + str(pid))
badapps.append(pid) badapps.append(pid)

@ -2,7 +2,7 @@ core:
autostart: true autostart: true
clockspeed: 20 clockspeed: 20
interval: 5 interval: 5
level: 3 level: 2
localadmin: true localadmin: true
sftp: sftp:
filepath: filepath:

@ -276,10 +276,11 @@ class ServerPanel(wx.Panel):
if str(TEST_FILE.iloc[i, 4]).find("TIME_WAIT") >= 0 or str(TEST_FILE.iloc[i, 4]).find("FIN_WAIT_2") >= 0: if str(TEST_FILE.iloc[i, 4]).find("TIME_WAIT") >= 0 or str(TEST_FILE.iloc[i, 4]).find("FIN_WAIT_2") >= 0:
continue continue
idx = 0 idx = 0
for ip in settings["badips"]: for app in settings["badapps"]:
#fprint(pid) #fprint(pid)
idx = i idx = i
if str(TEST_FILE.iloc[i, 3]).find(ip) >= 0 and str(TEST_FILE.iloc[i, 4]).find("TIME_WAIT") < 0: # "bad" pid, highlight in red at the top if TEST_FILE.iloc[i, 5] == app: # "bad" pid, highlight in red at the top
fprint("BAD APP UI: " + str(app))
idx = self.list_ctrl.InsertItem(0, TEST_FILE.iloc[i, 0]) idx = self.list_ctrl.InsertItem(0, TEST_FILE.iloc[i, 0])
self.list_ctrl.SetItemBackgroundColour(idx, wx.Colour(200, 51, 51)) self.list_ctrl.SetItemBackgroundColour(idx, wx.Colour(200, 51, 51))
break break

@ -3,11 +3,13 @@ from fabric import Connection
from util import find_data_file from util import find_data_file
from util import setup_child from util import setup_child
from util import fprint from util import fprint
from util import macos
from invoke import exceptions from invoke import exceptions
import sys import sys
def sftp_send_data(config, filename, filetype): def sftp_send_data(config, filename, filetype):
setup_child() setup_child()
if not macos:
fprint("Connecting over SSH to " + config['sftp']['host']) fprint("Connecting over SSH to " + config['sftp']['host'])
c = Connection(host=config['sftp']['host'], user=config['sftp']['user'], port=config['sftp']['port'], connect_kwargs={"key_filename": find_data_file(config['sftp']['keyfile']),}) c = Connection(host=config['sftp']['host'], user=config['sftp']['user'], port=config['sftp']['port'], connect_kwargs={"key_filename": find_data_file(config['sftp']['keyfile']),})
fprint("Sending data over SFTP: " + filename) fprint("Sending data over SFTP: " + filename)

Loading…
Cancel
Save