jokob-sk / NetAlertX

πŸ–§πŸ” WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.15k stars 186 forks source link

[Help needed] Freebox device scanner #799

Open jokob-sk opened 2 months ago

jokob-sk commented 2 months ago

It would be amazing if someone from the community could add a Freebox plugin.

The API (https://dev.freebox.fr/sdk/os/) seems to be documented, but unsure if devices and their status is available.

You can check the UNIFI plugin to get inspired/as a starting point: https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/unifi_import

There is also a 15-minute video on how to create a plugin: https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md

Thanks in adbvance for your help!

Users who would benefit from this: @azertylr

azertylr commented 2 months ago

Hello, The connected devices seem to be available here : https://dev.freebox.fr/sdk/os/lan/#lan-browser

leiweibau commented 2 months ago

A Freebox appears to have several interfaces. You would first have to determine the list of interfaces with β€œ/api/v4/lan/browser/interfaces/” and then query the list of hosts per interface via β€œ/api/v4/lan/browser/{interface}/”. At least that's what the API documentation leads me to believe.

I cannot say whether the β€œuid” is sufficient for authentication or whether it is necessary for all things. In case of doubt, you would first have to determine this via β€œ/api_version”. If authentication is necessary, which I can well imagine in the case of the Lan browser, then the first step is to log in via β€œ/api/v4/login/authorize/”.

At the end, I would also recommend logging out, otherwise you may reach the session limit of the Freebox.

Why can I say so much about this topic? I've been struggling with the Pi-hole 6 API for days πŸ˜‰

jokob-sk commented 2 months ago

Thanks a lot for the details @leiweibau - figuring put APIs can be FUN - let's see if someone from the community can help πŸ™