ah ben alors ? pourquoi pas chez moi ? sudo ./nmap -v -sn 192.168.1.1/24
Starting Nmap 7.80 ( https://nmap.org ) at 2019-08-27 07:58 CEST
Initiating ARP Ping Scan at 07:58
Scanning 255 hosts [1 port/host]
Completed ARP Ping Scan at 07:58, 1.75s elapsed (255 total hosts)
Initiating Parallel DNS resolution of 255 hosts. at 07:58
Completed Parallel DNS resolution of 255 hosts. at 07:58, 0.01s elapsed
Nmap scan report for 192.168.1.0 [host down]
...
Nmap scan report for 192.168.1.19
Host is up (0.019s latency).
MAC Address: E4:9E:12:5C:02:1E (Freebox SAS)
...
Nmap scan report for 192.168.1.34
Host is up (0.039s latency).
MAC Address: CA:7C:3F:35:3F:0F (Unknown)
...
Nmap scan report for 192.168.1.254
Host is up (0.084s latency).
MAC Address: F4:CA:E5:5B:D0:B2 (Freebox SAS)
Nmap scan report for 192.168.1.255 [host down]
Initiating Parallel DNS resolution of 1 host. at 07:58
Completed Parallel DNS resolution of 1 host. at 07:58, 0.00s elapsed
Nmap scan report for 192.168.1.49
Host is up.
Read data files from: /run/media/bul/ext/Exec/nmap/exec/bin/../share/nmap
Nmap done: 256 IP addresses (4 hosts up) scanned in 1.89 seconds
Raw packets sent: 507 (14.196KB) | Rcvd: 3 (84B)
du à la version ( 7.80 pour moi ) ? à la compilation depuis les sources ?
à ma config ? à une bétise de ma part ?
@+
°_Lenovo ideapad 110-15ACL - ram 4go - cpu : AMD A4-7210 - DD 1 To
carte graphique/son : [AMD/ATI] Mullins [Radeon R3 Graphics]
Manjaro-Xfce x86_64 uefi - seul os
°_Toshiba Satellite C55-A - ram 4go - cpu : Intel Celeron
DD 320Go externe - carte graphique/son : Intel Atom
Manjaro-Xfce x86_64 uefi - seul os
Déterrage (mais j'avais envie de faire mumuse avec ma box)
Seule solution c'est d'écrire une application freebox
J'ai donc trouvé un bibliothèque python qui permet de créer son application (c'était le plus difficile!)...
Aller dans le répertoire et créer son programme (ici fichier free-distant):
cd aiofreepybox
touch free-distant
chmod +x free-distant
Il ne reste plus qu'a écrire du code dans ce fichier (free-distant):
#!/usr/bin/env python
import asyncio
from aiofreepybox import Freepybox
from urllib import request
import json
async def demo():
with request.urlopen('http://mafreebox.freebox.fr/api_version') as f_url:
req = f_url.read()
datas = json.loads(req)
fbx = Freepybox(api_version="v5")
#print("\nfreeboxapp:", fbx.app_desc)
# lire datas à l'adresse http://mafreebox.freebox.fr/api_version
# Connect to the freebox
# Be ready to authorize the application on the Freebox if you use this script for the first time
await fbx.open(host=datas['api_domain'], port=datas['https_port'])
fbx_lan_hosts = await fbx.lan.get_hosts_list()
hosts = [h['names'] for h in fbx_lan_hosts if h['active']]
liste = [[c['name'] for c in h] for h in hosts]
for h in liste:
print("Connecté: ", set(h))
await fbx.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(demo())
loop.close()
Ici, les datas des connectés sont un peu brute, mais il est facile de faire plus propre... Ici il n'y a que le nom mais nous avons beaucoup plus comme l'heure de connection, le type de matériel, vendor_name, les adresses ip et mac ...
avec un seul connecté, j'ai le nom de ma machine et mon alias ; et si j'allume mon player j'en ai un de plus :
Chaque box a son propre nom de domaine (au format XXXXXXXX.fbxos.fr), donc il faut le trouver à l'adresse : http://mafreebox.freebox.fr/api_version. Ici le programme fait une auto-détection.
Chaque application freebox a besoin d'une autorisation pour ce connecter la première fois à la box. Donc au premier lancement, la box serveur va demander l'autorisation sur l'écran led.
Ensuite tout roule ...
---
Toute la documentation sur l'api car on peut faire beaucoup plus...
ah ben : merci beaucoup
un déterrage ? vaut mieux "tard" que jamais
si en plus il ne me reste qu'à faire du copier coller !!!
dommage pour ceux qui n'ont pas de freebox
je regarde tout ça de très près
@+
°_Lenovo ideapad 110-15ACL - ram 4go - cpu : AMD A4-7210 - DD 1 To
carte graphique/son : [AMD/ATI] Mullins [Radeon R3 Graphics]
Manjaro-Xfce x86_64 uefi - seul os
°_Toshiba Satellite C55-A - ram 4go - cpu : Intel Celeron
DD 320Go externe - carte graphique/son : Intel Atom
Manjaro-Xfce x86_64 uefi - seul os