Merge branch 'master' of github.com:jjshoots/RemoteIDSpoofer into master

This commit is contained in:
Jet
2023-06-22 22:45:59 +01:00
7 changed files with 24 additions and 28 deletions

View File

@@ -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.

View File

@@ -5,6 +5,7 @@
#include <ESP8266WiFi.h>
#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(500 / num_spoofers);
}
}
}

View File

@@ -68,12 +68,20 @@ ID_OpenDrone::ID_OpenDrone() {
#if ID_OD_WIFI
memset(WiFi_mac_addr,0,6);
// scrambled, not poached
// Nodemcu doesn't like certain mac addresses
// setting the first value to 0 seems to solve this
WiFi_mac_addr[i] = 0;
for (int i = 1; i < 6; i++) {
// WiFi_mac_addr[i] = (uint8_t) (rand() % 100 + 100);
WiFi_mac_addr[i] = (uint8_t) (rand() % 256);
}
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 +417,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;
//
@@ -573,9 +579,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) {
last_wifi = msecs;
@@ -653,9 +656,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;
@@ -784,9 +785,7 @@ int ID_OpenDrone::transmit_wifi(struct UTM_data *utm_data,int prepacked) {
odid_message_build_pack(&UAS_data,beacon_payload,beacon_max_packed);
if (length > 0) {
*beacon_length = length + 5;
wifi_status = transmit_wifi2(beacon_frame,len2 = beacon_offset + length);
}
@@ -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;
@@ -920,4 +916,4 @@ int ID_OpenDrone::transmit_ble(uint8_t *odid_msg,int length) {
/*
*
*/
*/

View File

@@ -137,7 +137,9 @@ private:
int auth_page = 0, auth_page_count = 0, key_length = 0, iv_length = 0;
char *UAS_operator;
uint8_t msg_counter[16];
uint8_t wifi_toggle = 1;
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];

View File

@@ -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) {

View File

@@ -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);
@@ -162,7 +161,6 @@ int transmit_wifi2(uint8_t *buffer,int length) {
#if ID_OD_WIFI
if (length) {
wifi_send_pkt_freedom(buffer,length,1);
}

View File

@@ -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 =
@@ -40,12 +40,11 @@ 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() {
if ((millis() - last_update) < 200) {
// FAA says minimum rate is 1 Hz, we do 2 Hz here
if ((millis() - last_update) < 500) {
return;
}
@@ -76,4 +75,4 @@ String Spoofer::getID() {
ID.concat(characters[(rand() % characters.length())]);
}
return ID;
}
}