fix bugs that were discovered thanks to backend changes

testing 1669777349
Cole Deck 2 years ago
parent a5cb840a61
commit f759f8ed86

@ -15,7 +15,10 @@ def get_blocklist(config, settings):
appendbad = settings["appendbad"]
whitelist = settings["whitelist"]
fprint("Downloading deny list from server")
data = ssh.check_for_file(config, "BadIPs.csv", "receive")
try:
data = ssh.check_for_file(config, "BadIPs.csv", "receive")
except:
data = list()
#fprint(data.stdout)
csvreader = csv.reader(data.stdout.split("\n"), delimiter=',', quotechar='|')
data2 = list()

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

@ -218,7 +218,7 @@ def mainloop(pool):
tmplist = settings["badapps"]
settings["badapps"] = list()
for x in tmplist:
if x > 0:
if x > 4:
send_notification("Killing PID " + str(x))
kill(x)
@ -237,14 +237,14 @@ def mainloop(pool):
if (badip, badport) not in history:
fprint("Firewalling " + badip + ":" + str(badport), settings)
send_notification("Firewalling " + badip + ":" + str(badport))
history.append((badip, badport))
if win32:
cmd = 'New-NetFirewallRule -DisplayName "IPPigeon Security Rule ' + badip + ':' + str(badport) + '" -Group "IPPigeon" -Direction Outbound -LocalPort Any -Protocol ' + badproto + ' -Action Block -RemoteAddress ' + badip + ' -RemotePort ' + str(badport)
run_cmd(cmd)
if linux:
cmd = "nft add rule ip ippigeon output ip daddr " + badip + " " + badproto.lower() + " dport " + str(badport) + " drop"
run_cmd(cmd)
else:
history.append((badip, badport))
settings["badapps"] = list()

@ -89,8 +89,8 @@ class LoginPanel(wx.Panel):
vbox.Add(pwdText, 0, wx.ALIGN_CENTER | 100, 5)
login_button = wx.Button(self, label='Login')
login_button.Bind(wx.EVT_BUTTON, self.on_login)
help_button = wx.Button(self, label='Help')
help_button.Bind(wx.EVT_BUTTON, self.on_help)
#help_button = wx.Button(self, label='Help')
#help_button.Bind(wx.EVT_BUTTON, self.on_help)
# signup_button = wx.Button(self, label='Sign Up')
hbox.Add(login_button, 0, wx.ALL | 200, 20)
# hbox.Add(signup_button, 0, wx.ALL | 200, 20)

@ -47,10 +47,13 @@ def time():
def kill(pid):
setup_child()
if pid > 0:
fprint("Killing PID " + str(pid), settings)
os.kill(int(pid), 9)
fprint("Signal 9 sent to PID " + str(pid), settings)
try:
if pid > 4:
fprint("Killing PID " + str(pid), settings)
os.kill(int(pid), 9)
fprint("Signal 9 sent to PID " + str(pid), settings)
except:
fprint("Unable to kill " + str(pid), settings)
def fprint(msg, settings = None):
#if not getattr(sys, "frozen", False):

Loading…
Cancel
Save