diff --git a/servers/script-server/conf/runners/administrative/wifi/list_devices_on_network.json b/servers/script-server/conf/runners/administrative/wifi/list_devices_on_network.json new file mode 100644 index 0000000..126380d --- /dev/null +++ b/servers/script-server/conf/runners/administrative/wifi/list_devices_on_network.json @@ -0,0 +1,20 @@ +{ + "name": "List devices", + "script_path": "./scripts/network/list_devices.py", + "description": "List the devices connected to the network we also are connected (you choose the network interface)", + "group": "\ud83d\udcf6Wifi Management", + "allowed_users": [ + "rudloff" + ], + "parameters": [ + { + "name": "interface", + "type": "list", + "required": true, + "param": "INTERFACE", + "env_var": "INTERFACE", + "description": "List of network interfaces to scan", + "values": { "script": "ls /sys/class/net | egrep -v '^br|^veth|^lo|^docker|^tun'", "shell": true } + } + ] +} \ No newline at end of file diff --git a/servers/script-server/scripts/network/list_devices.sh b/servers/script-server/scripts/network/list_devices.sh new file mode 100755 index 0000000..eb72241 --- /dev/null +++ b/servers/script-server/scripts/network/list_devices.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +INTERFACE_IP=$(/sbin/ifconfig $INTERFACE | egrep -o '([0-9]+[.]){3}[0-9]+' | head -n 1) +nmap -sn $INTERFACE_IP/24