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