Rename work 🏗

This commit is contained in:
jokob-sk
2024-04-12 19:44:29 +10:00
parent b003df323d
commit 5cb7553ed5
151 changed files with 2070 additions and 1735 deletions

View File

@@ -106,7 +106,7 @@
{
"function": "CMD",
"type": "readonly",
"default_value": "python3 /home/pi/pialert/front/plugins/pholus_scan/script.py userSubnets={subnets} timeoutSec={timeout}",
"default_value": "python3 /app/front/plugins/pholus_scan/script.py userSubnets={subnets} timeoutSec={timeout}",
"options": [],
"localized": [
"name",
@@ -219,7 +219,7 @@
},
{
"language_code": "es_es",
"string": "Cuántos días de entradas de escaneo de Pholus deben conservarse (globalmente, ¡no específico del dispositivo!). El archivo <a href=\"/maintenance.php#tab_Logging\">pialert_pholus.log</a> no se modifica. Introduzca <code>0</code> para desactivar."
"string": "Cuántos días de entradas de escaneo de Pholus deben conservarse (globalmente, ¡no específico del dispositivo!). Introduzca <code>0</code> para desactivar."
}
]
},

View File

@@ -18,7 +18,7 @@ from scapy.utils import PcapWriter
sys.setrecursionlimit(30000)
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)#supress Scapy warnings`
logPath = '/home/pi/pialert/front/log'
logPath = '/app/front/log'
# DEBUG
isDebug = False
@@ -43,13 +43,13 @@ def write_file (pPath, pText):
file.close()
# Empty the last run log file
write_file(logPath + "/pialert_pholus_lastrun.log", "")
write_file(logPath + "/pholus_lastrun.log", "")
def file_print(*args):
result = ''
file = open(logPath + "/pialert_pholus_lastrun.log", "a")
file = open(logPath + "/pholus_lastrun.log", "a")
for arg in args:
result += str(arg)
print(result)
@@ -57,7 +57,7 @@ def file_print(*args):
file.close()
# Empty the last run log file
write_file(logPath + "/pialert_pholus_subp_pr.log", "")
write_file(logPath + "/pholus_subp_pr.log", "")
# For separate logging of the multiprocess subprocess
def file_print_pr(*args):
@@ -66,7 +66,7 @@ def file_print_pr(*args):
result = ''
file = open(logPath + "/pialert_pholus_subp_pr.log", "a")
file = open(logPath + "/pholus_subp_pr.log", "a")
for arg in args:
result += str(arg)
print(result)

View File

@@ -10,8 +10,9 @@ import subprocess
from time import strftime
sys.path.append("/home/pi/pialert/front/plugins")
sys.path.append('/home/pi/pialert/netalertx')
# Register NetAlertX directories
INSTALL_PATH="/app"
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
from logger import mylog
from plugin_helper import Plugin_Object, Plugin_Objects
@@ -135,7 +136,7 @@ def execute_pholus_on_interface(interface, timeoutSec, mask):
# the scan always lasts 2x as long, so the desired user time from settings needs to be halved
adjustedTimeout = str(round(int(timeoutSec) / 2, 0))
# python3 -m trace --trace /home/pi/pialert/pholus/pholus3.py eth1 -rdns_scanning 192.168.1.0/24 -stimeout 600
# python3 -m trace --trace /app/pholus/pholus3.py eth1 -rdns_scanning 192.168.1.0/24 -stimeout 600
pholus_args = ['python3', fullPholusPath, interface, "-rdns_scanning", mask, "-stimeout", adjustedTimeout]
# Execute command
@@ -157,7 +158,7 @@ def execute_pholus_on_interface(interface, timeoutSec, mask):
mylog('verbose', [f'[{pluginName}] Scan: Pholus SUCCESS'])
# check the last run output
f = open(logPath + '/pialert_pholus_lastrun.log', 'r+')
f = open(logPath + '/pholus_lastrun.log', 'r+')
newLines = f.read().split('\n')
f.close()