From 2c27248aa1418014b0913c5eaa81287420b5db6d Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Fri, 27 Jan 2023 00:07:34 +1100 Subject: [PATCH] Addd subprocess timeout into Pholus 0.2 --- front/devices.php | 7 +------ pholus/pholus3.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/front/devices.php b/front/devices.php index ff4ab940..67af8d2f 100755 --- a/front/devices.php +++ b/front/devices.php @@ -344,15 +344,10 @@ function initializeDatatable () { $(td).html (''+ cellData +''); } }, - // Connected Devices - // - // '.$idParentMac.' - // + // Connected Devices {targets: [mapIndx(15)], 'createdCell': function (td, cellData, rowData, row, col) { $(td).html (''+ cellData +''); - // $(td).find("b").attr('onclick', "setCache('activeNetworkTab','"+rowData[mapIndx(11)]+"_id')" ); - } }, // Icon diff --git a/pholus/pholus3.py b/pholus/pholus3.py index f3a1ce9d..eb1ea230 100755 --- a/pholus/pholus3.py +++ b/pholus/pholus3.py @@ -864,7 +864,9 @@ def main(): file_print_pr("[DEBUG] Timestamp 34: ", timeNow()) pr = multiprocessing.Process(target=Sniffer_Offline, args=(values.interface,q,values.show_ttl,values.d4, values.d6, values.target_mac, values.auto_fake_responses,values.source6,values.source4,values.target_mac,values.target_mac,values.source_mac,values.hlimit)) pr.start() - pr.join() + pr.join(15) + if pr.is_alive(): + file_print("SUB-PROCESS KILLED TIMESTAMP: ", timeNow()) file_print_pr("[DEBUG] Timestamp 35: ", timeNow()) results=[] while not q.empty(): @@ -1118,7 +1120,9 @@ def main(): file_print_pr("[DEBUG] Timestamp 56: ", timeNow()) try: file_print_pr("[DEBUG] Timestamp 57: ", timeNow()) - pr2.join() + pr2.join(15) + if pr.is_alive(): + file_print("SUB-PROCESS KILLED TIMESTAMP: ", timeNow()) file_print_pr("[DEBUG] Timestamp 58: ", timeNow()) except KeyboardInterrupt: file_print("Exiting on user's request 3") @@ -1143,7 +1147,9 @@ def main(): if pr2: try: file_print_pr("[DEBUG] Timestamp 61: ", timeNow()) - pr2.join() + pr2.join(15) + if pr.is_alive(): + file_print("SUB-PROCESS KILLED TIMESTAMP: ", timeNow()) file_print_pr("[DEBUG] Timestamp 62: ", timeNow()) except KeyboardInterrupt: file_print("Exiting on user's request 4") @@ -1170,7 +1176,9 @@ def main(): if pr3: try: file_print_pr("[DEBUG] Timestamp 65: ", timeNow()) - pr3.join() + pr3.join(15) + if pr.is_alive(): + file_print("SUB-PROCESS KILLED TIMESTAMP: ", timeNow()) file_print_pr("[DEBUG] Timestamp 66: ", timeNow()) except KeyboardInterrupt: file_print("Exiting on user's request 5")