IPNEIGH cleanup + attribution

This commit is contained in:
jokob-sk
2024-11-30 23:59:42 +11:00
parent 2baeef9179
commit 1b116ebced
3 changed files with 18 additions and 38 deletions

View File

@@ -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
### Other info
- Author : [KayJay7](https://github.com/KayJay7)
- Date : 31-Nov-2024 - version 1.0

View File

@@ -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",

View File

@@ -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)