NMAP plugin conversion v0.2

This commit is contained in:
Jokob-sk
2023-08-27 19:11:59 +10:00
parent 1d8beb9222
commit c4adb03c50
3 changed files with 34 additions and 23 deletions

View File

@@ -1,5 +1,7 @@
from time import strftime
import pytz
import sys
import base64
from datetime import datetime
sys.path.append("/home/pi/pialert/front/plugins")
@@ -32,15 +34,16 @@ timeZoneSetting = pialertConfigFile['TIMEZONE']
timeZone = pytz.timezone(timeZoneSetting)
# -------------------------------------------------------------------
def decodeBase64(input):
def decodeBase64(inputParamBase64):
# Printing the input list to check its content.
mylog('debug', ['[Plugins] Helper base64 input: ', input])
print('[Plugins] Helper base64 input: ')
print(input)
# Extract the base64-encoded subnet information from the first element
# The format of the element is assumed to be like 'param=b<base64-encoded-data>'.
inputParamBase64 = input.split('=b')[1]
# The format of the element is assumed to be like 'param=b<base64-encoded-data>'.
# Printing the extracted base64-encoded information.
mylog('debug', ['[Plugins] Helper base64 inputParamBase64: ', inputParamBase64])