From ad5c3740cb10906eaa2ce19f8819c5f65ba322de Mon Sep 17 00:00:00 2001 From: jjshoots Date: Thu, 22 Jun 2023 19:51:33 +0100 Subject: [PATCH 1/5] first dev --- RemoteIDSpoofer/id_open_esp8266.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/RemoteIDSpoofer/id_open_esp8266.cpp b/RemoteIDSpoofer/id_open_esp8266.cpp index b441323..2356bda 100644 --- a/RemoteIDSpoofer/id_open_esp8266.cpp +++ b/RemoteIDSpoofer/id_open_esp8266.cpp @@ -68,6 +68,13 @@ void init2(char *ssid,int ssid_length,uint8_t *WiFi_mac_addr,uint8_t wifi_channe WiFi.mode(WIFI_OFF); WiFi.macAddress(WiFi_mac_addr); + Serial.begin(115200); + Serial.print(WiFi_mac_addr[0]); + Serial.print(WiFi_mac_addr[1]); + Serial.print(WiFi_mac_addr[2]); + Serial.print(WiFi_mac_addr[3]); + Serial.print(WiFi_mac_addr[4]); + Serial.println(WiFi_mac_addr[5]); WiFi.softAP(ssid,NULL,wifi_channel,false,0); WiFi.setOutputPower(20.0); From 3e0d06b83780c7480a58c564871f2281401bde4f Mon Sep 17 00:00:00 2001 From: jjshoots Date: Thu, 22 Jun 2023 20:20:56 +0100 Subject: [PATCH 2/5] remove print --- RemoteIDSpoofer/id_open_esp8266.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/RemoteIDSpoofer/id_open_esp8266.cpp b/RemoteIDSpoofer/id_open_esp8266.cpp index 2356bda..b441323 100644 --- a/RemoteIDSpoofer/id_open_esp8266.cpp +++ b/RemoteIDSpoofer/id_open_esp8266.cpp @@ -68,13 +68,6 @@ void init2(char *ssid,int ssid_length,uint8_t *WiFi_mac_addr,uint8_t wifi_channe WiFi.mode(WIFI_OFF); WiFi.macAddress(WiFi_mac_addr); - Serial.begin(115200); - Serial.print(WiFi_mac_addr[0]); - Serial.print(WiFi_mac_addr[1]); - Serial.print(WiFi_mac_addr[2]); - Serial.print(WiFi_mac_addr[3]); - Serial.print(WiFi_mac_addr[4]); - Serial.println(WiFi_mac_addr[5]); WiFi.softAP(ssid,NULL,wifi_channel,false,0); WiFi.setOutputPower(20.0); From 8f5a093317e00432202349d2c679131262ff7855 Mon Sep 17 00:00:00 2001 From: jjshoots Date: Thu, 22 Jun 2023 20:26:01 +0100 Subject: [PATCH 3/5] seed randomizer --- RemoteIDSpoofer/RemoteIDSpoofer.ino | 2 +- RemoteIDSpoofer/spoofer.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RemoteIDSpoofer/RemoteIDSpoofer.ino b/RemoteIDSpoofer/RemoteIDSpoofer.ino index 45d7288..40098af 100644 --- a/RemoteIDSpoofer/RemoteIDSpoofer.ino +++ b/RemoteIDSpoofer/RemoteIDSpoofer.ino @@ -17,4 +17,4 @@ void loop() { for (int i = 0; i < num_spoofers; i++) { spoofers[i].update(); } -} \ No newline at end of file +} diff --git a/RemoteIDSpoofer/spoofer.cpp b/RemoteIDSpoofer/spoofer.cpp index e12c877..720d7ef 100644 --- a/RemoteIDSpoofer/spoofer.cpp +++ b/RemoteIDSpoofer/spoofer.cpp @@ -23,7 +23,7 @@ Spoofer::Spoofer() { // define location // 52° 24' 24.4404" -1° 29' 36.564"W - lat_d = + lat_d = utm_data.latitude_d = utm_data.base_latitude = 52.0 + (24.0 / 60.0) + (24.4404 / 3600.0); long_d = @@ -69,6 +69,7 @@ void Spoofer::update() { } String Spoofer::getID() { + srand(micros()) String characters = String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); String ID = ""; for (int i = 0; i < 16; i++) @@ -76,4 +77,4 @@ String Spoofer::getID() { ID.concat(characters[(rand() % characters.length())]); } return ID; -} \ No newline at end of file +} From 540fed72e526865d82ee3fa7b54a56601277419e Mon Sep 17 00:00:00 2001 From: Jet Date: Thu, 22 Jun 2023 21:29:25 +0100 Subject: [PATCH 4/5] enable independent mac address --- RemoteIDSpoofer/RemoteIDSpoofer.ino | 3 ++- RemoteIDSpoofer/id_open.cpp | 16 ++++++---------- RemoteIDSpoofer/id_open.h | 1 + RemoteIDSpoofer/id_open_esp32.cpp | 3 ++- RemoteIDSpoofer/id_open_esp8266.cpp | 3 +-- RemoteIDSpoofer/spoofer.cpp | 3 --- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/RemoteIDSpoofer/RemoteIDSpoofer.ino b/RemoteIDSpoofer/RemoteIDSpoofer.ino index 40098af..637103c 100644 --- a/RemoteIDSpoofer/RemoteIDSpoofer.ino +++ b/RemoteIDSpoofer/RemoteIDSpoofer.ino @@ -5,6 +5,7 @@ #include #include "spoofer.h" +// we are limited by how fast we can broadcast things const int num_spoofers = 16; static Spoofer spoofers[num_spoofers]; @@ -13,8 +14,8 @@ void setup() { } void loop() { - delay(50); for (int i = 0; i < num_spoofers; i++) { spoofers[i].update(); + delay(10); } } diff --git a/RemoteIDSpoofer/id_open.cpp b/RemoteIDSpoofer/id_open.cpp index 826d6d7..8f0cfd8 100644 --- a/RemoteIDSpoofer/id_open.cpp +++ b/RemoteIDSpoofer/id_open.cpp @@ -68,12 +68,16 @@ ID_OpenDrone::ID_OpenDrone() { #if ID_OD_WIFI - memset(WiFi_mac_addr,0,6); + // scrambled, not poached + for (int i = 0; i < 6; i++) { + WiFi_mac_addr[i] = (uint8_t) (rand() % 16); + } + memset(ssid,0,sizeof(ssid)); strcpy(ssid,"UAS_ID_OPEN"); - beacon_interval = (BEACON_INTERVAL) ? BEACON_INTERVAL: 500; + beacon_interval = 10; #if ID_OD_WIFI_BEACON @@ -409,10 +413,8 @@ int ID_OpenDrone::transmit(struct UTM_data *utm_data) { int i, status; char text[128]; - uint32_t msecs; time_t secs = 0; static int phase = 0; - static uint32_t last_msecs = 2000; // @@ -574,7 +576,6 @@ int ID_OpenDrone::transmit(struct UTM_data *utm_data) { // Pack and transmit the WiFi data. static uint8_t wifi_toggle = 1; - static uint32_t last_wifi = 0; if ((msecs - last_wifi) >= beacon_interval) { @@ -653,9 +654,7 @@ int ID_OpenDrone::transmit_wifi(struct UTM_data *utm_data,int prepacked) { #if ID_OD_WIFI int length = 0, wifi_status = 0; - uint32_t msecs; uint64_t usecs = 0; - static uint32_t last_wifi = 0; char text[128]; text[0] = 0; @@ -833,9 +832,6 @@ int ID_OpenDrone::transmit_wifi(struct UTM_data *utm_data,int prepacked) { */ int ID_OpenDrone::transmit_ble(uint8_t *odid_msg,int length) { - - uint32_t msecs; - static uint32_t last_ble; msecs = millis(); ble_interval = msecs - last_ble; diff --git a/RemoteIDSpoofer/id_open.h b/RemoteIDSpoofer/id_open.h index 0f7abaa..17f55e6 100644 --- a/RemoteIDSpoofer/id_open.h +++ b/RemoteIDSpoofer/id_open.h @@ -138,6 +138,7 @@ private: char *UAS_operator; uint8_t msg_counter[16]; uint16_t wifi_interval = 0, ble_interval = 0; + uint32_t last_ble = 0, last_wifi = 0, msecs = 0, last_msecs = 2000; Stream *Debug_Serial = NULL; char ssid[32]; diff --git a/RemoteIDSpoofer/id_open_esp32.cpp b/RemoteIDSpoofer/id_open_esp32.cpp index 748581e..a732478 100644 --- a/RemoteIDSpoofer/id_open_esp32.cpp +++ b/RemoteIDSpoofer/id_open_esp32.cpp @@ -189,7 +189,8 @@ void init2(char *ssid,int ssid_length,uint8_t *WiFi_mac_addr,uint8_t wifi_channe // esp_wifi_set_max_tx_power(78); esp_wifi_get_max_tx_power(&wifi_power); - status = esp_read_mac(WiFi_mac_addr,ESP_MAC_WIFI_STA); + // no default mac addresses + // status = esp_read_mac(WiFi_mac_addr,ESP_MAC_WIFI_STA); if (Debug_Serial) { diff --git a/RemoteIDSpoofer/id_open_esp8266.cpp b/RemoteIDSpoofer/id_open_esp8266.cpp index b441323..3a45dfb 100644 --- a/RemoteIDSpoofer/id_open_esp8266.cpp +++ b/RemoteIDSpoofer/id_open_esp8266.cpp @@ -66,8 +66,7 @@ void init2(char *ssid,int ssid_length,uint8_t *WiFi_mac_addr,uint8_t wifi_channe softap_config wifi_config; WiFi.mode(WIFI_OFF); - - WiFi.macAddress(WiFi_mac_addr); + // WiFi.macAddress(WiFi_mac_addr); WiFi.softAP(ssid,NULL,wifi_channel,false,0); WiFi.setOutputPower(20.0); diff --git a/RemoteIDSpoofer/spoofer.cpp b/RemoteIDSpoofer/spoofer.cpp index 720d7ef..54f06f6 100644 --- a/RemoteIDSpoofer/spoofer.cpp +++ b/RemoteIDSpoofer/spoofer.cpp @@ -40,8 +40,6 @@ Spoofer::Spoofer() { speed_m_x = ((float) speed_kn) * 0.514444 * 0.2; // Because we update every 200 ms. utm_utils.calc_m_per_deg(lat_d,&m_deg_lat,&m_deg_long); - - srand(micros()); } void Spoofer::update() { @@ -69,7 +67,6 @@ void Spoofer::update() { } String Spoofer::getID() { - srand(micros()) String characters = String("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); String ID = ""; for (int i = 0; i < 16; i++) From 51b674e429b34e8f155e22b0b8f1c713b26ca905 Mon Sep 17 00:00:00 2001 From: Jet Date: Thu, 22 Jun 2023 21:30:19 +0100 Subject: [PATCH 5/5] update readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ad264a0..2fac250 100644 --- a/README.md +++ b/README.md @@ -24,5 +24,4 @@ This spawns 16 different fake drones broadcasting RemoteID, with them all flying ## To-Do List -1. Set custom MAC address for each Remote ID instance. -2. Add GPS capability to automatically create IDs wherever the device is located. +1. Add GPS capability to automatically create IDs wherever the device is located.