NMAPDEV plugin work v0.6 #645 🆕🔎

This commit is contained in:
jokob-sk
2024-04-27 10:30:40 +10:00
parent fbbe4dc64b
commit 87b114604c
6 changed files with 19 additions and 21 deletions

View File

@@ -38,15 +38,17 @@ timeZoneSetting = configFile['TIMEZONE']
timeZone = pytz.timezone(timeZoneSetting)
# -------------------------------------------------------------------
# Sanitizes plugin output
def handleEmpty(input):
if input == '' or None:
if not input:
return 'null'
else:
# Validate and sanitize message content
# Remove potentially problematic characters if string
if isinstance(input, str):
if isinstance(input, str):
input = re.sub(r'[^\x00-\x7F]+', ' ', input)
return input
input = input.replace('\n', '') # Removing new lines
return input
# -------------------------------------------------------------------
# Check if a valid MAC address