mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
⚙️ Make Rogue DHCP timeout configurable #851
This commit is contained in:
@@ -424,7 +424,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": 10,
|
||||
"default_value": 20,
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
|
||||
@@ -27,7 +27,7 @@ def main():
|
||||
last_run_logfile.write("")
|
||||
|
||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||
timeoutSec = 10
|
||||
timeoutSec = get_setting_value('DHCPSRVS_RUN_TIMEOUT')
|
||||
|
||||
nmapArgs = ['sudo', 'nmap', '--script', 'broadcast-dhcp-discover']
|
||||
|
||||
@@ -42,6 +42,9 @@ def main():
|
||||
newEntries = []
|
||||
|
||||
for line in newLines:
|
||||
|
||||
mylog('verbose', [f'[DHCPSRVS] Processing line: {line} '])
|
||||
|
||||
if 'Response ' in line and ' of ' in line:
|
||||
newEntries.append(Plugin_Object())
|
||||
elif 'Server Identifier' in line:
|
||||
@@ -67,6 +70,7 @@ def main():
|
||||
newEntries[-1].extra += ',' + newVal
|
||||
|
||||
for e in newEntries:
|
||||
|
||||
plugin_objects.add_object(
|
||||
primaryId=e.primaryId,
|
||||
secondaryId=e.secondaryId,
|
||||
@@ -80,7 +84,7 @@ def main():
|
||||
|
||||
plugin_objects.write_result_file()
|
||||
except Exception as e:
|
||||
mylog('none', ['Error in main:', str(e)])
|
||||
mylog('verbose', ['[DHCPSRVS] Error in main:', str(e)])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user