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.
Kotlin airtagalprandroidandroid-autoanti-surveillancebluetooth-low-energybody-cameracounter-surveillancedrone-detectionflock-safetyimsi-catcher-detectorpolice-detectorpolice-scannerprivacyremote-idrtl-sdrsdrsurveillance-detectiontracker-detectionwifi
Ambulance gear, IP-camera setup networks, train WiFi and mesh radio nodes
CIS-C0e559c4cc960a
diff --git a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.ktindex 5c5157d..b693507 100644--- a/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/DeviceIntel.kt@@ -41,7 +41,25 @@ object DeviceIntel {0x0B to "Just used", 0x0D to "Driving", 0x0E to "On a call")+ /** Meshtastic's BLE service (Meshtastic firmware / app protocol docs). */+ private val MESHTASTIC_SERVICE = java.util.UUID.fromString("6ba1b218-15a8-461f-9fa8-5dcae273eafd")+ private const val MESH_NODE = "Mesh radio node (Meshtastic / MeshCore LoRa)"++ /** Passenger trains' onboard WiFi (Wardrive Go's rail list, plus Deutsche Bahn's ICE network). */+ internal val TRAIN_SSID = Regex("amtrak|brightline|eurostar|sncf|wifi_inoui|wifionice|via ?rail|^via[-_ ]?wi-?fi\$", RegexOption.IGNORE_CASE)++ /**+ * A train's WiFi rides along with you, and its router often comes from the same vehicle-router+ * makers police cars use (Cradlepoint, Sierra Wireless): those matches are dropped for it.+ */+ fun dropTrainRouter(hits: List<Hit>, a: Advert): List<Hit> {+ val ssid = a.name ?: return hits+ if (a.isBle || a.wifi?.client == true || !TRAIN_SSID.containsMatchIn(ssid)) return hits+ return hits.filterNot { it.category == Category.PUBLIC_SAFETY }+ }+private val NAME_TYPES = listOf(+ Regex("meshtastic|^meshcore", RegexOption.IGNORE_CASE) to MESH_NODE,Regex("airpods|beats|buds|earbud|headphone|headset|jbl|bose|sony w[hf]-|soundcore|jabra|sennheiser|skullcandy", RegexOption.IGNORE_CASE) to "Headphones / earbuds",Regex("watch|fitbit|garmin|amazfit|mi band|galaxy fit|whoop|polar|suunto|oura", RegexOption.IGNORE_CASE) to "Wearable",Regex("\\b(tv|bravia|roku|chromecast|fire ?tv|shield)\\b|\\[tv\\]", RegexOption.IGNORE_CASE) to "TV / streaming device",@@ -200,6 +218,9 @@ object DeviceIntel {if (desc != null && value ushr 6 != 0) decide(desc, "advertised appearance")}+ // LoRa mesh radios (after Wardrive Go): Meshtastic's own service, else the node's default name.+ if (MESHTASTIC_SERVICE in a.serviceUuids) decide(MESH_NODE, "Meshtastic service UUID")+// Standard services say what the device does (heart rate, HID, LE Audio...).shorts.firstNotNullOfOrNull { SERVICE_CLASSES[it] }?.let { decide(it, "advertised service") }@@ -252,6 +273,7 @@ object DeviceIntel {val type = when {w?.client == true -> "WiFi device (laptop, phone or camera on a network)"ssid.isNullOrEmpty() -> "Hidden WiFi network"+ TRAIN_SSID.containsMatchIn(ssid) -> "Train WiFi (passenger rail)"Regex("iphone|androidap|galaxy|pixel|hotspot|'s phone", RegexOption.IGNORE_CASE).containsMatchIn(ssid) -> "Phone hotspot"Regex("direct-|printer|hp-print|epson|canon", RegexOption.IGNORE_CASE).containsMatchIn(ssid) -> "WiFi Direct / printer"Regex("tesla|carplay|android auto|\\bcar\\b|bmw|mercedes|audi|toyota", RegexOption.IGNORE_CASE).containsMatchIn(ssid) -> "Vehicle WiFi"diff --git a/app/src/main/java/com/rfsentinel/app/detect/HackerWatch.kt b/app/src/main/java/com/rfsentinel/app/detect/HackerWatch.ktindex eb98b3b..8c04e48 100644--- a/app/src/main/java/com/rfsentinel/app/detect/HackerWatch.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/HackerWatch.kt@@ -40,13 +40,18 @@ object HackerWatch {* They broadcast these while unconfigured or in hotspot mode; once joined to a home* network they look like any other device. V380: "MV" + 8 digits; LookCam Pro:* DGK-XXXXXX-XXXXX; TinyCam Pro: AI_XXXXXXX; HDSmartIPC: AI + 12 characters- * (V380 setup guide; SpyGearGadgets setup notes).+ * (V380 setup guide; SpyGearGadgets setup notes); generic IP cameras: "IPC-" / "IPC_" + an ID+ * (Wardrive Go's hidden-camera list).*/+ private class SetupSsid(val ssid: Regex, val app: String, val confidence: Int, val source: String)+ private const val SPY_SETUP = "V380 setup guide; SpyGearGadgets setup notes"private val HIDDEN_CAMERA_SSIDS = listOf(- Regex("^MV\\d{8}$") to Pair("V380", 75),- Regex("^DGK-[A-Z0-9]{6}-[A-Z0-9]{5}$", RegexOption.IGNORE_CASE) to Pair("LookCam Pro", 80),- Regex("^AI_[A-Z0-9]{6,12}$", RegexOption.IGNORE_CASE) to Pair("TinyCam Pro", 60),- Regex("^AI[A-Z0-9]{12}$") to Pair("HDSmartIPC", 55)+ SetupSsid(Regex("^MV\\d{8}$"), "V380", 75, SPY_SETUP),+ SetupSsid(Regex("^DGK-[A-Z0-9]{6}-[A-Z0-9]{5}$", RegexOption.IGNORE_CASE), "LookCam Pro", 80, SPY_SETUP),+ SetupSsid(Regex("^AI_[A-Z0-9]{6,12}$", RegexOption.IGNORE_CASE), "TinyCam Pro", 60, SPY_SETUP),+ SetupSsid(Regex("^AI[A-Z0-9]{12}$"), "HDSmartIPC", 55, SPY_SETUP),+ SetupSsid(Regex("^IPC[-_][A-Z0-9]{4,12}$", RegexOption.IGNORE_CASE), "generic IP camera", 50,+ "Wardrive Go hidden-camera list (facts only)"))/** Default WiFi / Bluetooth names of action cameras whose makers use generic chips. */@@ -80,11 +85,10 @@ object HackerWatch {if (name.startsWith("GoPro", ignoreCase = true)) return Hit(Category.OTHER_CAMERA, "GoPro camera", 70,"Advertised name \"$name\"", reg)}- if (a.source == Advert.Source.WIFI) HIDDEN_CAMERA_SSIDS.firstOrNull { it.first.matches(name) }?.let { (_, app) ->- return Hit(Category.OTHER_CAMERA, "Hidden / spy camera (${app.first} type)", app.second,- "WiFi network \"$name\": the setup hotspot of cheap ${app.first} WiFi cameras, often sold hidden in clocks, " +- "chargers and smoke detectors. Some are ordinary indoor cameras - check the room.",- "V380 setup guide; SpyGearGadgets setup notes")+ if (a.source == Advert.Source.WIFI) HIDDEN_CAMERA_SSIDS.firstOrNull { it.ssid.matches(name) }?.let { c ->+ return Hit(Category.OTHER_CAMERA, "Hidden / spy camera (${c.app} type)", c.confidence,+ "WiFi network \"$name\": the setup hotspot of cheap ${c.app} WiFi cameras, often sold hidden in clocks, " ++ "chargers and smoke detectors. Some are ordinary indoor cameras - check the room.", c.source)}if (name.isNotEmpty()) ACTION_CAMERA_NAMES.firstOrNull { it.first.containsMatchIn(name) }?.let { (_, label) ->return Hit(Category.OTHER_CAMERA, label, 65, "${if (a.source == Advert.Source.WIFI) "WiFi network" else "Advertised name"} " +diff --git a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.ktindex 7b972a2..229a47c 100644--- a/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt+++ b/app/src/main/java/com/rfsentinel/app/detect/SignatureEngine.kt@@ -44,6 +44,7 @@ object SignatureEngine {private const val CID_ZEBRA = 0x01F1 // Zebra Technologies Corporationprivate const val CID_BROTHER = 0x0755 // Brother Industries, Ltdprivate const val CID_DRAEGER = 0x04BC // Draegerwerk AG & Co. KGaA+ private const val CID_STRYKER = 0x0A5F // Stryker (LIFEPAK maker since buying Physio-Control)// --- 16-bit service UUIDs ------------------------------------------------private val AXON_UUIDS = mapOf(0xFC81 to "Axon Enterprise", 0xFE6B to "TASER International", 0xFE6C to "TASER International")@@ -90,6 +91,11 @@ object SignatureEngine {private val ZEBRA_UUIDS = setOf(0xFE79, 0xFD66) // Zebra Technologies (FE79 = Link-OS printer BLE service)private val FORTIN_UUIDS = setOf(0xFDE1, 0xFDCA) // Fortin Electronic Systems (vehicle interface modules)private const val UUID_DRAEGER = 0xFCDA // Draeger+ private const val UUID_STRYKER = 0xFC6E // Stryker+ private val ZOLL_UUIDS = setOf(0xFE22, 0xFE23) // Zoll Medical Corporation++ /** Ambulance defibrillator / monitor makers by IEEE registration (Wardrive Go's EMS list, registrants checked). */+ private val EMS_PREFIXES = PrefixTable(mapOf("40BD9E" to "Physio-Control (LIFEPAK)", "000DD1" to "Stryker"))/** HeyCyan smart-glasses SDK service; must match all 16 bytes (Apple ANCS differs by 2 bytes). */private val HEYCYAN = UUID.fromString("7905fff0-b5ce-4e99-a40f-4b1e122d00d0")@@ -230,6 +236,18 @@ object SignatureEngine {"(Alcotest) and drug (DrugTest) screening devices police use, and hospital and gas-detection gear", SIG)}+ // ---- Ambulance (EMS) medical gear: often at the same scenes as police ----+ if (ZOLL_UUIDS.any { it in allShorts }) {+ hits += Hit(Category.PUBLIC_SAFETY, "ZOLL medical device (ambulance defibrillator / monitor)", 40,+ "Zoll Medical service UUID 0xFE22/0xFE23 - ZOLL X Series and AED monitors in ambulances, but also " ++ "hospital gear and the LifeVest a heart patient can wear", "$SIG; Wardrive Go's EMS list (facts only)")+ }+ if (CID_STRYKER in a.manufacturerData || UUID_STRYKER in allShorts) {+ hits += Hit(Category.PUBLIC_SAFETY, "Stryker medical device (LIFEPAK defibrillator, ambulance stretcher)", 35,+ "Stryker company ID 0x0A5F or service UUID 0xFC6E - LIFEPAK monitors and powered stretchers in ambulances, " ++ "and plenty of hospital equipment", "$SIG; Wardrive Go's EMS list (facts only)")+ }+// ---- Flock Safety ALPR + Raven --------------------------------------val xuntong = CID_XUNTONG in a.manufacturerDatawhen {@@ -506,6 +524,11 @@ object SignatureEngine {"WiFi address in $maker's registered block ${fmtPrefix(prefix)} - enforcement-camera maker, verify","$IEEE; $ACAB (alpr_candidates)")}+ EMS_PREFIXES.match(a.mac)?.let { (prefix, maker) ->+ hits += Hit(Category.PUBLIC_SAFETY, "$maker medical device (ambulance defibrillator / monitor)", 45,+ "WiFi address in $maker's registered block ${fmtPrefix(prefix)} - LIFEPAK monitors send their data " ++ "over WiFi from ambulances; hospitals use them too", "$IEEE; Wardrive Go's EMS list (facts only)")+ }}droneByPrefix(a)?.let { hits += it }return hitsdiff --git a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.ktindex d1ea2fd..6519e00 100644--- a/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt+++ b/app/src/main/java/com/rfsentinel/app/service/ScanForegroundService.kt@@ -707,7 +707,8 @@ class ScanForegroundService : Service() {probeHits[a.mac]?.takeIf { now - it.first < ESP_HIT_TTL_MS }?.second.orEmpty() +extraval noAirTags = Prefs.excludeAirTags(this)- val hits = EvidenceFusion.fuse(com.rfsentinel.app.detect.FlockNoise.filter(raw, a.name, OuiWatchlist.flockRegion).filter {+ val sifted = DeviceIntel.dropTrainRouter(com.rfsentinel.app.detect.FlockNoise.filter(raw, a.name, OuiWatchlist.flockRegion), a)+ val hits = EvidenceFusion.fuse(sifted.filter {Prefs.categoryEnabled(this, it.category) && !(noAirTags && SignatureEngine.isAppleFindMy(it))})return Classified(now, hits, identity, vendor)diff --git a/app/src/test/java/com/rfsentinel/app/detect/WardriveGoIdeasTest.kt b/app/src/test/java/com/rfsentinel/app/detect/WardriveGoIdeasTest.ktnew file mode 100644index 0000000..6399d85--- /dev/null+++ b/app/src/test/java/com/rfsentinel/app/detect/WardriveGoIdeasTest.kt@@ -0,0 +1,67 @@+package com.rfsentinel.app.detect++import org.junit.Assert.assertEquals+import org.junit.Assert.assertNotNull+import org.junit.Assert.assertNull+import org.junit.Assert.assertTrue+import org.junit.Before+import org.junit.BeforeClass+import org.junit.Test+import java.io.File+import java.util.UUID++/** Ideas from Wardrive Go (facts only): EMS gear, IP-camera setup networks, train WiFi, mesh radio nodes. */+class WardriveGoIdeasTest {++ companion object {+ @BeforeClass+ @JvmStatic+ fun loadVendors() {+ VendorDb.load { File("src/main/assets", it).inputStream() }+ }+ }++ @Before fun reset() = HackerWatch.reset()++ private fun ble(mac: String, name: String? = null, uuids: List<UUID> = emptyList()) =+ Advert(mac = mac, source = Advert.Source.BLE, rssi = -60, name = name, serviceUuids = uuids, timestamp = 0L)++ private fun ap(mac: String, ssid: String) =+ Advert(mac = mac, source = Advert.Source.WIFI, rssi = -60, name = ssid,+ wifi = Advert.WifiInfo(2437, "[WPA2-PSK-CCMP][ESS]", null, emptyList()), timestamp = 0L)++ @Test+ fun ambulanceGear() {+ val zoll = SignatureEngine.classify(ble("5a:11:22:33:44:55", uuids = listOf(Advert.uuid16(0xFE22))))+ assertEquals(Category.PUBLIC_SAFETY, zoll.first().category)+ assertTrue(zoll.first().label.startsWith("ZOLL"))+ val lifepak = SignatureEngine.classify(ap("40:BD:9E:12:34:56", "LP15-1234"))+ assertNotNull(lifepak.firstOrNull { it.label.startsWith("Physio-Control (LIFEPAK)") })+ }++ @Test+ fun ipCameraSetupNetwork() {+ val hit = SignatureEngine.classify(ap("02:12:34:56:78:9a", "IPC-8F3A21")).firstOrNull { it.category == Category.OTHER_CAMERA }+ assertNotNull(hit)+ assertEquals(50, hit!!.confidence)+ assertNull("an ordinary name", SignatureEngine.classify(ap("02:12:34:56:78:9a", "IPCC Office")).firstOrNull { it.category == Category.OTHER_CAMERA })+ }++ @Test+ fun trainWifiIsNotAPoliceCar() {+ val router = SignatureEngine.policeVehicleSsid("IBR900-3ab")!!+ val onTrain = ap("00:30:44:12:34:56", "AmtrakConnect")+ assertTrue(DeviceIntel.dropTrainRouter(listOf(router), onTrain).isEmpty())+ assertEquals(1, DeviceIntel.dropTrainRouter(listOf(router), ap("00:30:44:12:34:56", "IBR900-3ab")).size)+ assertEquals("Train WiFi (passenger rail)", DeviceIntel.identify(ap("02:00:00:00:00:01", "_SNCF_WIFI_INOUI"), null).type)+ assertEquals("Train WiFi (passenger rail)", DeviceIntel.identify(ap("02:00:00:00:00:01", "WIFIonICE"), null).type)+ }++ @Test+ fun meshRadioNodes() {+ assertTrue(DeviceIntel.identify(ble("5a:00:00:00:00:01", "Meshtastic_1a2b"), null).type.startsWith("Mesh radio node"))+ assertTrue(DeviceIntel.identify(ble("5a:00:00:00:00:02", "MeshCore-ab12cd"), null).type.startsWith("Mesh radio node"))+ val byService = ble("5a:00:00:00:00:03", uuids = listOf(UUID.fromString("6ba1b218-15a8-461f-9fa8-5dcae273eafd")))+ assertTrue(DeviceIntel.identify(byService, null).type.startsWith("Mesh radio node"))+ }+}diff --git a/docs/SIGNATURES.md b/docs/SIGNATURES.mdindex 56e02f4..7b4990f 100644--- a/docs/SIGNATURES.md+++ b/docs/SIGNATURES.md@@ -39,6 +39,9 @@ Before shipping, the identifiers were checked against these registries:| Public safety | Company ID `0x0755` (Brother Industries) | 20 | SIG; RuggedJet / PocketJet in-car printers, mostly home and office printers || Public safety | UUID `0xFDE1` / `0xFDCA` (Fortin Electronic Systems) | 20 | SIG; vehicle interface modules used in police upfits, also civilian remote starters || Public safety | Company ID `0x04BC` or UUID `0xFCDA` (Dräger) | 35 | SIG; roadside breath / drug screening devices, also hospital and gas-detection gear |+| Public safety | UUID `0xFE22` / `0xFE23` (Zoll Medical) | 40 | SIG, after Wardrive Go's EMS list; ambulance defibrillators and monitors, also hospital gear and the LifeVest a patient can wear |+| Public safety | Company ID `0x0A5F` or UUID `0xFC6E` (Stryker) | 35 | SIG, after Wardrive Go's EMS list; LIFEPAK monitors and ambulance stretchers, plenty of hospital equipment |+| Public safety | WiFi address in Physio-Control's `40:BD:9E` or Stryker's `00:0D:D1` block | 45 | IEEE, after Wardrive Go's EMS list; LIFEPAK monitors send their data over WiFi from ambulances || ALPR | WiFi SSID starting with `Flock-` | 88 | ACAB (ryanohoro, GainSec) || ALPR | BLE name `FS Ext Battery` | 80 | ACAB || ALPR | BLE name `Penguin-<digits>` or `FS-<hex>` | 70, or 80 with company ID `0x09C8` | ACAB |@@ -62,6 +65,13 @@ Before shipping, the identifiers were checked against these registries:| Network camera (off by default) | SSID starting with `ARLO_VMB_` or `NTGR_VMB_` | 88 | ACAB || Network camera (off by default) | Arlo, Blink, Ezviz, Uniview, Amcrest, Wyze, Swann, Night Owl, SkyBell or WUUK blocks (WiFi only) | 65 | IEEE / ACAB |+A WiFi network named after a passenger rail operator (Amtrak, Brightline, Eurostar, SNCF `_WIFI_INOUI`,+VIA Rail, Deutsche Bahn `WIFIonICE`; Wardrive Go's rail list) is shown as **Train WiFi** and its+public-safety matches are dropped: its router often comes from the vehicle-router makers police+cars use, and it rides along with you. BLE nodes named `Meshtastic_…` / `MeshCore-…` or advertising+Meshtastic's service are shown as **Mesh radio node**, without an alert. Hidden-camera setup networks+(`detect/HackerWatch.kt`) also cover generic IP cameras' `IPC-` / `IPC_` + ID networks (50, Wardrive Go).+Deliberately **not** matched, following ACAB:- A bare 10-digit BLE name. It false-positived on a phone.@@ -320,7 +330,7 @@ candidate's IEEE registrant was checked against the maker the project names.|---|---|| [Flock You](https://github.com/colonelpanichacks/flock-you) (list by @NitekryDPaul, [nite-oui-collection](https://github.com/nitekry/nite-oui-collection); 82:6B:F2 by DeflockJoplin) | 31 radio-module prefixes seen on Flock cameras, as **weak** ALPR entries (score 35) || [OUI-Spy](https://github.com/colonelpanichacks/oui-spy-unified-blue) | 11 Ring (Amazon) blocks, as home cameras (off by default) |-| [Wardrive Go](https://github.com/RocketGod-git/wardrive-go) | Same Flock list; its traffic-camera and drone blocks were already here |+| [Wardrive Go](https://github.com/RocketGod-git/wardrive-go) | Same Flock list; its traffic-camera and drone blocks were already here. Later (3.1.165): EMS gear, IP-camera setup networks, train WiFi and mesh radio nodes, above || [Flock-You-Android](https://github.com/MaxwellDPS/Flock-You-Android) | Hikvision, Dahua, Axis, Vivotek, Amcrest, Reolink, Wyze, TVT, Reecam camera blocks; Sierra Wireless and Digi fleet gateways || [Fieldwatch](https://github.com/OffGridPete/Fieldwatch) | BlueTOAD (Iteris) and BlipTrack roadside travel-time sensors; Flock-pole battery radios (weak); Hanwha, Uniview, Rhombus cameras; Sierra AirLink, Compex and Inseego (Novatel) vehicle radios |diff --git a/tools/gen_assets.py b/tools/gen_assets.pyindex 1334625..0859a36 100644--- a/tools/gen_assets.py+++ b/tools/gen_assets.py@@ -124,6 +124,8 @@ CODE_PREFIXES = {'0015FF': 'Inseego', '18EE86': 'Inseego', '780C71': 'Inseego', 'E08614': 'Inseego','4C364E': 'Panasonic', 'B8208E': 'Panasonic', 'BC3E0B': 'Panasonic','00A0D5': 'Sierra', '28A331': 'Sierra', '50139D': 'Sierra', '64CE6E': 'Sierra', '84DB2F': 'Sierra', 'CC934A': 'Sierra',+ # Ambulance (EMS) medical gear (after Wardrive Go's EMS list)+ '40BD9E': 'Physio-Control', '000DD1': 'Stryker',}bad = 0for p, expect in CODE_PREFIXES.items():