Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sdk:wifiprobingclients [2020/05/22 07:52] (current)
fachet created
Line 1: Line 1:
 +<code c wifiprobingclients.are>​
 +/* DESC: This script shows WiFi probing clients and works with 2 WiFi cards.
 + * Copyright (C) 2020 NetModule AG, Switzerland
 + */
  
 +
 +while (1) {
 + sleep(3);
 + for (card = 1; card <= 2; card++) {
 + IFC=sprintf("​WLAN%d",​ card);
 + tracks = nb_wlan_tracking(IFC);​
 +
 + count = sprintf("​%s_STATION_COUNT",​ IFC);
 + nr_tracks = struct_get(tracks,​ count);
 + 
 + if (is_void(nr_tracks) || nr_tracks < 1) {
 +   ​ nb_syslog("​no tracks found on %s", IFC);
 +   ​ continue;​
 + }
 +
 + nb_syslog("​%s:​ stations tracked (%d)", IFC, nr_tracks);
 + 
 + /* lookup WLAN networks */
 + for (i = 1; i <= nr_tracks; i++) {
 +    k = sprintf("​%s_STATION%d_MAC",​ IFC, i);
 + mac = struct_get(tracks,​ k);
 +    k = sprintf("​%s_STATION%d_LAST_SEEN",​ IFC, i);
 +    lseen = (int)struct_get(tracks,​ k);
 +    k = sprintf("​%s_STATION%d_SIGNAL",​ IFC, i);
 +    signal = (int)struct_get(tracks,​ k);
 + 
 + if (strlen(mac) == 0) continue;
 +  nb_syslog("​detected on %s: Client '​%s'​ (signal %d) (seen %d)", IFC, mac, signal, lseen);
 + }
 +  }
 +}
 +
 +exit(0);
 +
 +</​code>​