Skip to content

Commit

Permalink
IPNEIGH cleanup + attribution
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Nov 30, 2024
1 parent 2baeef9 commit 1b116eb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 38 deletions.
11 changes: 8 additions & 3 deletions front/plugins/ipneigh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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
34 changes: 1 addition & 33 deletions front/plugins/ipneigh/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions front/plugins/ipneigh/ipneigh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1b116eb

Please sign in to comment.