fix bugs that were discovered thanks to backend changes
This commit is contained in:
parent
a5cb840a61
commit
f759f8ed86
5
block.py
5
block.py
@ -15,7 +15,10 @@ def get_blocklist(config, settings):
|
|||||||
appendbad = settings["appendbad"]
|
appendbad = settings["appendbad"]
|
||||||
whitelist = settings["whitelist"]
|
whitelist = settings["whitelist"]
|
||||||
fprint("Downloading deny list from server")
|
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)
|
#fprint(data.stdout)
|
||||||
csvreader = csv.reader(data.stdout.split("\n"), delimiter=',', quotechar='|')
|
csvreader = csv.reader(data.stdout.split("\n"), delimiter=',', quotechar='|')
|
||||||
data2 = list()
|
data2 = list()
|
||||||
|
@ -2,7 +2,7 @@ core:
|
|||||||
autostart: true
|
autostart: true
|
||||||
clockspeed: 20
|
clockspeed: 20
|
||||||
interval: 10
|
interval: 10
|
||||||
level: 3
|
level: 2
|
||||||
localadmin: true
|
localadmin: true
|
||||||
sftp:
|
sftp:
|
||||||
filepath:
|
filepath:
|
||||||
|
@ -218,7 +218,7 @@ def mainloop(pool):
|
|||||||
tmplist = settings["badapps"]
|
tmplist = settings["badapps"]
|
||||||
settings["badapps"] = list()
|
settings["badapps"] = list()
|
||||||
for x in tmplist:
|
for x in tmplist:
|
||||||
if x > 0:
|
if x > 4:
|
||||||
send_notification("Killing PID " + str(x))
|
send_notification("Killing PID " + str(x))
|
||||||
kill(x)
|
kill(x)
|
||||||
|
|
||||||
@ -237,14 +237,14 @@ def mainloop(pool):
|
|||||||
if (badip, badport) not in history:
|
if (badip, badport) not in history:
|
||||||
fprint("Firewalling " + badip + ":" + str(badport), settings)
|
fprint("Firewalling " + badip + ":" + str(badport), settings)
|
||||||
send_notification("Firewalling " + badip + ":" + str(badport))
|
send_notification("Firewalling " + badip + ":" + str(badport))
|
||||||
|
history.append((badip, badport))
|
||||||
if win32:
|
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)
|
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)
|
run_cmd(cmd)
|
||||||
if linux:
|
if linux:
|
||||||
cmd = "nft add rule ip ippigeon output ip daddr " + badip + " " + badproto.lower() + " dport " + str(badport) + " drop"
|
cmd = "nft add rule ip ippigeon output ip daddr " + badip + " " + badproto.lower() + " dport " + str(badport) + " drop"
|
||||||
run_cmd(cmd)
|
run_cmd(cmd)
|
||||||
else:
|
|
||||||
history.append((badip, badport))
|
|
||||||
settings["badapps"] = list()
|
settings["badapps"] = list()
|
||||||
|
|
||||||
|
|
||||||
|
4
panel.py
4
panel.py
@ -89,8 +89,8 @@ class LoginPanel(wx.Panel):
|
|||||||
vbox.Add(pwdText, 0, wx.ALIGN_CENTER | 100, 5)
|
vbox.Add(pwdText, 0, wx.ALIGN_CENTER | 100, 5)
|
||||||
login_button = wx.Button(self, label='Login')
|
login_button = wx.Button(self, label='Login')
|
||||||
login_button.Bind(wx.EVT_BUTTON, self.on_login)
|
login_button.Bind(wx.EVT_BUTTON, self.on_login)
|
||||||
help_button = wx.Button(self, label='Help')
|
#help_button = wx.Button(self, label='Help')
|
||||||
help_button.Bind(wx.EVT_BUTTON, self.on_help)
|
#help_button.Bind(wx.EVT_BUTTON, self.on_help)
|
||||||
# signup_button = wx.Button(self, label='Sign Up')
|
# signup_button = wx.Button(self, label='Sign Up')
|
||||||
hbox.Add(login_button, 0, wx.ALL | 200, 20)
|
hbox.Add(login_button, 0, wx.ALL | 200, 20)
|
||||||
# hbox.Add(signup_button, 0, wx.ALL | 200, 20)
|
# hbox.Add(signup_button, 0, wx.ALL | 200, 20)
|
||||||
|
11
util.py
11
util.py
@ -47,10 +47,13 @@ def time():
|
|||||||
|
|
||||||
def kill(pid):
|
def kill(pid):
|
||||||
setup_child()
|
setup_child()
|
||||||
if pid > 0:
|
try:
|
||||||
fprint("Killing PID " + str(pid), settings)
|
if pid > 4:
|
||||||
os.kill(int(pid), 9)
|
fprint("Killing PID " + str(pid), settings)
|
||||||
fprint("Signal 9 sent to 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):
|
def fprint(msg, settings = None):
|
||||||
#if not getattr(sys, "frozen", False):
|
#if not getattr(sys, "frozen", False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user