Compare commits

..

No commits in common. "f759f8ed86276e86114efd322ce14ab8be03e6b8" and "d5f85fb62a219660d7eaedcde91d3e76a063a7b7" have entirely different histories.

6 changed files with 13 additions and 20 deletions

View File

@ -15,10 +15,7 @@ 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")
try: data = ssh.check_for_file(config, "BadIPs.csv", "receive")
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()

View File

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

View File

@ -218,9 +218,8 @@ 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 > 4: send_notification("Killing PID " + str(x))
send_notification("Killing PID " + str(x)) kill(x)
kill(x)
if settings["fwll"] == True: if settings["fwll"] == True:
global history global history
@ -237,14 +236,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()

View File

@ -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)

View File

@ -7,4 +7,4 @@ pyyaml
numpy numpy
bcrypt bcrypt
plyer plyer
playsound==1.2.2 playsound

11
util.py
View File

@ -47,13 +47,10 @@ def time():
def kill(pid): def kill(pid):
setup_child() setup_child()
try: if pid > 0:
if pid > 4: fprint("Killing PID " + str(pid), settings)
fprint("Killing PID " + str(pid), settings) os.kill(int(pid), 9)
os.kill(int(pid), 9) fprint("Signal 9 sent to PID " + str(pid), settings)
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):