Skip to content

RF Sentinel (RFSentinel): free, open-source police detector app for Android. Spots police body cams, Flock ALPR cameras, AirTag trackers, Remote ID drones, smart glasses and fake cell towers from Bluetooth LE and WiFi. No root.

Home routers' Interworking element no longer makes them public hotspots: public only when the beacon says public, on an open or sign-in network

CIS-C09a28c3b89142
diff --git a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
index df9a309..f320513 100644
--- a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
+++ b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt
@@ -526,11 +526,19 @@ object DeviceIntel {
internal fun networkKind(w: Advert.WifiInfo?, ap: WifiFingerprint.ApInfo, macVendor: String?, hidden: Boolean = false): Pair<String, String>? {
if (w == null || w.client) return null
val ies = w.infoElements
- // Hotspot 2.0: the Interworking element (107) or the Wi-Fi Alliance HS2.0 indication (50:6F:9A type 0x10).
- val passpoint = ies.any { it.first == 107 } || ies.any { (id, d) ->
- id == 221 && d.size >= 4 && Bytes.u8(d, 0) == 0x50 && Bytes.u8(d, 1) == 0x6F && Bytes.u8(d, 2) == 0x9A && Bytes.u8(d, 3) == 0x10 }
- if (passpoint) return "Public WiFi hotspot (Passpoint)" to "Passpoint / Hotspot 2.0 elements in the beacon"
val enterprise = w.capabilities.contains("EAP")
+ val open = security(w.capabilities) == "Open (no password)"
+ // Public only when the beacon says so and nobody needs the owner's password. Home routers often carry an
+ // Interworking element (107) too, saying "private network": that alone means nothing.
+ // Passpoint: the Wi-Fi Alliance HS2.0 indication (50:6F:9A type 0x10), always with account sign-in.
+ val hs20 = ies.any { (id, d) ->
+ id == 221 && d.size >= 4 && Bytes.u8(d, 0) == 0x50 && Bytes.u8(d, 1) == 0x6F && Bytes.u8(d, 2) == 0x9A && Bytes.u8(d, 3) == 0x10 }
+ if (hs20 && enterprise) return "Public WiFi hotspot (Passpoint)" to "Passpoint / Hotspot 2.0 elements in the beacon"
+ // Interworking access network type (low 4 bits): 2 chargeable public, 3 free public.
+ val access = ies.firstOrNull { it.first == 107 && it.second.isNotEmpty() }?.let { Bytes.u8(it.second, 0) and 0x0F }
+ if ((access == 2 || access == 3) && (enterprise || open) && !hidden) {
+ return "Public WiFi hotspot" to "beacon's Interworking element: ${if (access == 2) "paid" else "free"} public network"
+ }
val business = maker(BUSINESS_AP_MAKERS, macVendor, *ap.ieVendors.toTypedArray())
if (enterprise) return "Business WiFi (account sign-in)" + (business?.let { " - $it" } ?: "") to
"WPA-Enterprise security: people sign in with an account (offices, schools, hotels)"
@@ -548,7 +556,7 @@ object DeviceIntel {
if (ap.deviceKind == "Router" || ap.deviceKind == "Gateway") {
return "Home router" + (ap.model?.let { " - $it" } ?: "") to "WPS device kind \"${ap.deviceKind}\""
}
- if (!hidden && security(w.capabilities) == "Open (no password)") return "Open WiFi (public or guest)" to "no password"
+ if (!hidden && open) return "Open WiFi (public or guest)" to "no password"
return null
}
diff --git a/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt b/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
index 7deda54..a60ed59 100644
--- a/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
+++ b/app/src/test/java/com/rfsentinel/app/detect/IdentifyMoreTest.kt
@@ -228,7 +228,13 @@ class IdentifyMoreTest {
assertEquals("Business access point - Ruckus", net("06:00:00:00:00:45", "Guest", ies = listOf(221 to byteArrayOf(0x00, 0x13, 0x92.toByte(), 0x01))))
// By security: account sign-in, Passpoint, open.
assertEquals("Business WiFi (account sign-in) - Cisco Meraki", net("00:18:0A:00:00:46", "corp", "[WPA2-EAP-CCMP]"))
- assertEquals("Public WiFi hotspot (Passpoint)", net("06:00:00:00:00:47", "plain", ies = listOf(107 to byteArrayOf(0x10))))
+ val hs20 = 221 to byteArrayOf(0x50, 0x6F, 0x9A.toByte(), 0x10, 0x00)
+ assertEquals("Public WiFi hotspot (Passpoint)", net("06:00:00:00:00:47", "plain", "[WPA2-EAP-CCMP]", listOf(hs20, 107 to byteArrayOf(0x12))))
+ assertEquals("Public WiFi hotspot", net("06:00:00:00:00:4C", "plain", "[ESS]", listOf(107 to byteArrayOf(0x03))))
+ // A home router's Interworking element ("private network") or a stray HS2.0 tag on a password network: still a router.
+ assertEquals("Home router (internet provider's) - Sagemcom", net("00:0E:59:00:00:4D", "Smith house", ies = listOf(107 to byteArrayOf(0x10))))
+ assertEquals("Home router (internet provider's) - Sagemcom", net("00:0E:59:00:00:4E", "Smith house", ies = listOf(hs20, 107 to byteArrayOf(0x03))))
+ assertEquals("WiFi access point", net("06:00:00:00:00:4F", "plain", ies = listOf(107 to byteArrayOf(0x00))))
assertEquals("Open WiFi (public or guest)", net("06:00:00:00:00:48", "plain", "[ESS]"))
// WPS "router" kind with no known maker.
assertEquals("Home router", net("06:00:00:00:00:49", "plain",
diff --git a/docs/SIGNATURES.md b/docs/SIGNATURES.md
index fa8810d..ef30679 100644
--- a/docs/SIGNATURES.md
+++ b/docs/SIGNATURES.md
@@ -158,8 +158,10 @@ The access point is identified from the first of these that answers:
**Kind of network.** When the name is hidden or says nothing (no ISP default,
chain or brand name), the beacon decides the kind, first match wins:
-1. Passpoint / Hotspot 2.0 (Interworking IE 107, or vendor IE `50:6F:9A`
- type `0x10`): public WiFi hotspot.
+1. Passpoint (vendor IE `50:6F:9A` type `0x10` on an account sign-in network),
+ or an Interworking IE 107 whose access network type is public (2 paid,
+ 3 free) on an open or sign-in network: public WiFi hotspot. Home routers
+ often carry IE 107 saying "private", so IE 107 alone counts for nothing.
2. WPA-Enterprise (EAP) security: business WiFi with account sign-in, plus the
business maker when known.
3. WPS model of a provider's router (Livebox, Freebox, Bbox, Speedport,