-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathWiFiBeacon.ino
159 lines (135 loc) · 4.97 KB
/
WiFiBeacon.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
* WiFi Beacon prank
*
* This project simply creates standard beacon frames and broadcasts them over the air.
* Clients will not be able to connect to these but will see them when browsing for wifi.
* PLEASE be responsible and think about how/where you use this. Don't be a dickhead.
*
* Permission is granted for free use and distribution as long as this notice is intact.
*
* Written By: John Rogers john at wizworks dot net http://wizworks.net
*
*/
#include <ESP8266WiFi.h> //more about beacon frames https://mrncciew.com/2014/10/08/802-11-mgmt-beacon-frame/
extern "C" {
#include "user_interface.h"
}
const int switchPin = 13; // bring D7 pin LOW or HIGH to switch broadcast mode LOW: 0V HIGH: 3.3V
int pinState = HIGH;
void setup() {
delay(10000); // Delay initial startup to allow for easy flashing
wifi_set_opmode(STATION_MODE);
WiFi.setOutputPower(20.5);
wifi_promiscuous_enable(1);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(switchPin, INPUT);
digitalWrite(switchPin, HIGH);
}
void loop() {
pinState = digitalRead(switchPin);
digitalWrite(LED_BUILTIN, HIGH);
switch (pinState) {
case LOW:
sendFuzzedBeacon("_LOCK UP ANTIFA!",10); //sends beacon frames with 10 different SSID all starting with '_LOCK UP ANTIFA!' and ending with whitespaces (spaces and/or tabs)
break;
case HIGH:
PorkRoll();
break;
}
//sendRandomBeacon(10); //sends beacon frames with 10 character long random SSID
digitalWrite(LED_BUILTIN, LOW); // Flash the LED once after every transmit
delay(1);
}
void sendFuzzedBeacon(char* baseSsid, int nr) {
int baseLen = strlen(baseSsid);
int i=0;
for(int j=0; j < 32 - baseLen; j++) { //32 is the maximum length of the SSID
for(int k=0; k < pow(2,j); k++) {
int kk = k;
String ssid = baseSsid;
for(int l=0; l < j; l++) {
if(kk%2 == 1) ssid += " "; //add a space
else ssid += "\t"; //add a tab
kk /= 2;
}
char charBufSsid[33];
ssid.toCharArray(charBufSsid, 33);
sendBeacon(charBufSsid);
if(++i >= nr) return;
}
}
}
void sendRandomBeacon(int len) {
char ssid[len+1];
randomString(len, ssid);
sendBeacon(ssid);
}
void randomString(int len, char* ssid) {
String alfa = "1234567890qwertyuiopasdfghjkklzxcvbnm QWERTYUIOPASDFGHJKLZXCVBNM_";
for(int i = 0; i < len; i++) {
ssid[i] = alfa[random(65)];
}
}
void sendBeacon(char* ssid) {
// Randomize channel //
byte channel = random(1,12);
wifi_set_channel(channel);
uint8_t packet[128] = { 0x80, 0x00, //Frame Control
0x00, 0x00, //Duration
/*4*/ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, //Destination address
/*10*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //Source address - overwritten later
/*16*/ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, //BSSID - overwritten to the same as the source address
/*22*/ 0xc0, 0x6c, //Seq-ctl
//Frame body starts here
/*24*/ 0x83, 0x51, 0xf7, 0x8f, 0x0f, 0x00, 0x00, 0x00, //timestamp - the number of microseconds the AP has been active
/*32*/ 0xFF, 0x00, //Beacon interval
/*34*/ 0x01, 0x04, //Capability info
/* SSID */
/*36*/ 0x00
};
int ssidLen = strlen(ssid);
packet[37] = ssidLen;
for(int i = 0; i < ssidLen; i++) {
packet[38+i] = ssid[i];
}
uint8_t postSSID[13] = {0x01, 0x08, 0x82, 0x84, 0x8b, 0x96, 0x24, 0x30, 0x48, 0x6c, //supported rate
0x03, 0x01, 0x04 /*DSSS (Current Channel)*/ };
for(int i = 0; i < 12; i++) {
packet[38 + ssidLen + i] = postSSID[i];
}
packet[50 + ssidLen] = 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);
int packetSize = 51 + ssidLen;
wifi_send_pkt_freedom(packet, packetSize, 0);
wifi_send_pkt_freedom(packet, packetSize, 0);
wifi_send_pkt_freedom(packet, packetSize, 0);
delay(1);
}
void PorkRoll() {
sendBeacon("_X FILES");
sendBeacon("_House of LANister");
sendBeacon("_DEVIL'S CROTCH");
//sendBeacon("_BOMB DETONATOR"); // LEAVE THIS COMMENTED OUT IF USING NEAR AIRPORTS! DON'T BE A DICKHEAD!
sendBeacon("_DEA UNIT 9");
sendBeacon("_DIRTY OLD MAN");
sendBeacon("_ENCRYPTED FOR YOUR PLEASURE");
sendBeacon("_CREEP NEXT DOOR");
sendBeacon("_FAST N FREE");
sendBeacon("_DIRTY DIAPER");
sendBeacon("_IT'S CRAPTASTIC!");
sendBeacon("_I FEEL NAUGHTY");
sendBeacon("_MIND CONTROL");
sendBeacon("_IT HURTS WHEN I PEE");
sendBeacon("_IM UNDER YOUR BED");
sendBeacon("_SURVEILLANCE VAN 69");
sendBeacon("_IM WATCHING YOU NOW");
sendBeacon("_PLEASE CLICK FOR ID THEFT");
sendBeacon("_S & M MEMBERS ONLY");
sendBeacon("_MAKE AMERICA GREAT AGAIN");
}