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