mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
NMAPDEV plugin work v0.6 #645 🆕🔎
This commit is contained in:
@@ -300,7 +300,7 @@
|
||||
{
|
||||
"function": "ARGS",
|
||||
"type": "text",
|
||||
"default_value": "sudo nmap -sn ",
|
||||
"default_value": "sudo nmap -sn -PR -n ",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name",
|
||||
@@ -315,7 +315,7 @@
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Arguments to run nmap-scan with. Recommended and tested only with the setting: <br/> <code>sudo nmap -sn </code>."
|
||||
"string": "Arguments to run nmap-scan with. Recommended and tested only with the setting: <br/> <code>sudo nmap -sn </code>. <br/><br/> Note: The plugin attaches the interface and network mask, for example <code> -e eth1 192.168.1.0/24</code> and performs a separate scan for each interface specified in the <a onclick=\"toggleAllSettings()\" href=\"#SCAN_SUBNETS\"><code>SCAN_SUBNETS</code> setting</a>."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -83,9 +83,10 @@ def execute_scan (subnets_list, timeout):
|
||||
devices_list = []
|
||||
|
||||
# scan each interface
|
||||
|
||||
for interface in subnets_list:
|
||||
|
||||
nmap_output = execute_scan_on_interface(interface, timeout)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] nmap_output: ', nmap_output])
|
||||
|
||||
if nmap_output is not None:
|
||||
@@ -124,7 +125,7 @@ def execute_scan (subnets_list, timeout):
|
||||
|
||||
def execute_scan_on_interface (interface, timeout):
|
||||
# Prepare command arguments
|
||||
scan_args = get_setting_value('NMAPDEV_ARGS').split() + [interface.split()[0]]
|
||||
scan_args = get_setting_value('NMAPDEV_ARGS').split() + interface.replace('--interface=','-e ').split()
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] scan_args: ', scan_args])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user