|
|
|
@ -82,17 +82,29 @@ def login_done(res):
|
|
|
|
|
def blockdata_done(res):
|
|
|
|
|
global settings
|
|
|
|
|
fprint("FINISHED downloading block data")
|
|
|
|
|
tmpkill = settings["kill"]
|
|
|
|
|
settings["kill"] = False
|
|
|
|
|
#block_res = pool.apply_async(block.block_conn, (config, datafile, res, settings))
|
|
|
|
|
block_res = block.block_conn(config, datafile, res)
|
|
|
|
|
block_pids, block_ips = block.block_conn(config, datafile, res)
|
|
|
|
|
tmplist = settings["badapps"]
|
|
|
|
|
for x in block_res:
|
|
|
|
|
|
|
|
|
|
for x in block_pids:
|
|
|
|
|
fprint(x)
|
|
|
|
|
if not x in tmplist:
|
|
|
|
|
tmplist.append(x)
|
|
|
|
|
|
|
|
|
|
settings["badapps"] = tmplist
|
|
|
|
|
fprint(settings["badapps"])
|
|
|
|
|
|
|
|
|
|
tmplist = settings["badips"]
|
|
|
|
|
for x in block_ips:
|
|
|
|
|
fprint(x)
|
|
|
|
|
if not x in tmplist:
|
|
|
|
|
tmplist.append(x)
|
|
|
|
|
settings["badips"] = tmplist
|
|
|
|
|
fprint(settings["badips"])
|
|
|
|
|
|
|
|
|
|
settings["kill"] = tmpkill
|
|
|
|
|
|
|
|
|
|
def killall():
|
|
|
|
|
kids = active_children()
|
|
|
|
|
for kid in kids:
|
|
|
|
@ -152,10 +164,12 @@ def mainloop(pool):
|
|
|
|
|
settings["block"] = False
|
|
|
|
|
|
|
|
|
|
if settings["kill"] == True:
|
|
|
|
|
for x in settings["badapps"]:
|
|
|
|
|
kill(x)
|
|
|
|
|
tmplist = settings["badapps"]
|
|
|
|
|
settings["badapps"] = list()
|
|
|
|
|
|
|
|
|
|
for x in tmplist:
|
|
|
|
|
kill(x)
|
|
|
|
|
|
|
|
|
|
sleep(interval / (interval * config["core"]["clockspeed"]))
|
|
|
|
|
counter += 1
|
|
|
|
|
if counter == interval * config["core"]["clockspeed"]:
|
|
|
|
@ -202,6 +216,7 @@ if __name__ == '__main__':
|
|
|
|
|
settings["continueui"] = False
|
|
|
|
|
settings["killbox"] = list()
|
|
|
|
|
settings["badapps"] = list()
|
|
|
|
|
settings["badips"] = list()
|
|
|
|
|
settings["block"] = False
|
|
|
|
|
settings["kill"] = False
|
|
|
|
|
killme = manager.Value('d', 0)
|
|
|
|
|