diff --git a/front/plugins/ipneigh/README.md b/front/plugins/ipneigh/README.md index 715ccce94..ac205b7f7 100755 --- a/front/plugins/ipneigh/README.md +++ b/front/plugins/ipneigh/README.md @@ -13,10 +13,15 @@ To set up the plugin correctly, make sure to add in the plugin settings the name ### Usage -- Head to **Settings** > **IP Neigh** to add the interfaces you want to scan to the `IPNEIGH_interfaces` option -- The interface list must be formatted without whitespaces and comma separated e.g. `eth0,wl1,tap0` +- Head to **Settings** > **IP Neigh** to adjust teh settings +- Interfaces are extracted from the `SCAN_SUBNETS` setting (make sure you add interfaces in the prescribed format, e.g. `192.168.1.0/24 --interface=eth1`) ### Notes - `ARPSCAN` does a better job at discovering IPv4 devices because it explicitly sends arp requests -- IPv6 devices will often have multiple addresses, but the ping answer will contain only one. This means that in general this plugin will not discover every address but only those who answer \ No newline at end of file +- IPv6 devices will often have multiple addresses, but the ping answer will contain only one. This means that in general this plugin will not discover every address but only those who answer + +### Other info + +- Author : [KayJay7](https://github.com/KayJay7) +- Date : 31-Nov-2024 - version 1.0 diff --git a/front/plugins/ipneigh/config.json b/front/plugins/ipneigh/config.json index 93c2059e3..94c379b80 100755 --- a/front/plugins/ipneigh/config.json +++ b/front/plugins/ipneigh/config.json @@ -113,38 +113,6 @@ } ] }, - { - "function": "interfaces", - "type": { - "dataType": "string", - "elements": [ - { - "elementType": "input", - "elementOptions": [], - "transformers": [] - } - ] - }, - "maxLength": 150, - "default_value": "eth0", - "options": [], - "localized": [ - "name", - "description" - ], - "name": [ - { - "language_code": "en_us", - "string": "Interfaces to scan" - } - ], - "description": [ - { - "language_code": "en_us", - "string": "The plugin will scan these comma separated interfaces" - } - ] - }, { "function": "CMD", "type": { @@ -161,7 +129,7 @@ } ] }, - "default_value": "python3 /app/front/plugins/ipneigh/ipneigh.py ipneigh_interfaces={IPNEIGH_interfaces}", + "default_value": "python3 /app/front/plugins/ipneigh/ipneigh.py", "options": [], "localized": [ "name", diff --git a/front/plugins/ipneigh/ipneigh.py b/front/plugins/ipneigh/ipneigh.py index 467da993f..fa3da7756 100755 --- a/front/plugins/ipneigh/ipneigh.py +++ b/front/plugins/ipneigh/ipneigh.py @@ -39,9 +39,16 @@ def main(): mylog('verbose', [f'[{pluginName}] In script']) # Retrieve configuration settings - interfaces = get_setting_value('IPNEIGH_interfaces') + SCAN_SUBNETS = get_setting_value('SCAN_SUBNETS') - mylog('verbose', [f'[{pluginName}] Interfaces value: {interfaces}']) + mylog('verbose', [f'[{pluginName}] SCAN_SUBNETS value: {SCAN_SUBNETS}']) + + # Extract interfaces from SCAN_SUBNETS + interfaces = ','.join( + entry.split('--interface=')[-1].strip() for entry in SCAN_SUBNETS if '--interface=' in entry + ) + + mylog('verbose', [f'[{pluginName}] Interfaces value: "{interfaces}"']) # retrieve data raw_neighbors = get_neighbors(interfaces)