|
|
|
@ -10,6 +10,7 @@ from util import find_data_file
|
|
|
|
|
from util import fprint
|
|
|
|
|
from util import kill
|
|
|
|
|
from util import run_cmd
|
|
|
|
|
from notification import send_notification
|
|
|
|
|
import taskbartool
|
|
|
|
|
import util
|
|
|
|
|
import netstat
|
|
|
|
@ -18,6 +19,7 @@ import auth
|
|
|
|
|
import panel
|
|
|
|
|
import block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
history = list()
|
|
|
|
|
displaydata = None
|
|
|
|
|
settings = None
|
|
|
|
@ -215,9 +217,11 @@ def mainloop(pool):
|
|
|
|
|
tmplist = settings["badapps"]
|
|
|
|
|
settings["badapps"] = list()
|
|
|
|
|
for x in tmplist:
|
|
|
|
|
send_notification("Killing PID " + str(x))
|
|
|
|
|
kill(x)
|
|
|
|
|
|
|
|
|
|
if settings["fwll"] == True:
|
|
|
|
|
global history
|
|
|
|
|
tmplist = settings["badlines"]
|
|
|
|
|
tmpstat = settings["stats"]
|
|
|
|
|
tmpstat[0] += len(tmplist)
|
|
|
|
@ -227,8 +231,10 @@ def mainloop(pool):
|
|
|
|
|
badproto = line[1]
|
|
|
|
|
badip = line[4]
|
|
|
|
|
badport = line[5]
|
|
|
|
|
fprint("Firewalling " + badip + ":" + str(badport))
|
|
|
|
|
|
|
|
|
|
if (badip, badport) not in history:
|
|
|
|
|
fprint("Firewalling " + badip + ":" + str(badport))
|
|
|
|
|
send_notification("Firewalling " + badip + ":" + str(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)
|
|
|
|
@ -237,6 +243,7 @@ def mainloop(pool):
|
|
|
|
|
run_cmd(cmd)
|
|
|
|
|
else:
|
|
|
|
|
history.append((badip, badport))
|
|
|
|
|
settings["badapps"] = list()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if settings["applyconfig"] == True:
|
|
|
|
|