NMAP plugin conversion v0.2

This commit is contained in:
Jokob-sk
2023-08-28 06:44:19 +10:00
parent c4adb03c50
commit a1b17a238b
2 changed files with 7 additions and 6 deletions

View File

@@ -389,7 +389,7 @@
{
"function": "RUN_TIMEOUT",
"type": "integer",
"default_value": 300,
"default_value": 30,
"options": [],
"localized": ["name", "description"],
"name": [

View File

@@ -156,7 +156,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
# handle missing "function":"CMD" setting
if set == None:
return
return pluginsState
set_CMD = set["value"]
@@ -168,7 +168,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
else:
set_RUN_TIMEOUT = set["value"]
mylog('debug', ['[Plugins] Timeout: ', set_RUN_TIMEOUT])
# Prepare custom params
params = []
@@ -191,7 +191,8 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
mylog('debug', [f'[Plugins] The parameter "name":"{param["name"]}" will multiply the timeout {tempParam.paramValuesCount} times. Total timeout: {set_RUN_TIMEOUT}s'])
mylog('debug', ['[Plugins] Timeout: ', set_RUN_TIMEOUT])
# build SQL query parameters to insert into the DB
sqlParams = []
@@ -316,7 +317,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
# handle missing "function":"DB_PATH" setting
if set == None:
mylog('none', ['[Plugins] Error: DB_PATH setting for plugin type sqlite-db-query missing.'])
return
return pluginsState
fullSqlitePath = set["value"]
@@ -356,7 +357,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
# check if the subprocess / SQL query failed / there was no valid output
if len(sqlParams) == 0:
mylog('none', ['[Plugins] No output received from the plugin ', plugin["unique_prefix"], ' - enable LOG_LEVEL=debug and check logs'])
return
return pluginsState
else:
mylog('verbose', ['[Plugins] SUCCESS, received ', len(sqlParams), ' entries'])