-
-
Save iqfareez/4861c6e5dc76c1190d8b1651def13d37 to your computer and use it in GitHub Desktop.
Login to captive portal https://iqfareez.com/blog/hacking-wifi-captive-portal-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
#include <Wire.h> | |
#include <HTTPClient.h> | |
#define AP_SSID "IIUM-Student" | |
#define AP_PASSWORD "" // leaves empty if open wifi | |
const String username = "1111111"; | |
const String password = "blahblah"; | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
// Connecting to the WIFI AP | |
WiFi.begin(AP_SSID, AP_PASSWORD); | |
while (WiFi.status() != WL_CONNECTED) { | |
delay(500); | |
Serial.println("Connecting to WiFi.."); | |
} | |
Serial.println("Connected to the WiFi network"); | |
// Login to Captive Portal | |
HTTPClient login; | |
login.begin("http://captiveportalmahallahgombak.iium.edu.my/cgi-bin/login"); | |
String body = "user=" + String(username) + "&password=" + String(password) + "&cmd=authenticate&Login=Log%2BIn"; | |
int res = login.POST(body); | |
Serial.println(res); | |
if (res == 200) { | |
Serial.println("Authentication IIUM successful"); | |
} | |
login.end(); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
HTTPClient http; | |
http.begin("https://iqfareez.com/api/hello"); | |
int res = http.GET(); | |
Serial.println(res); // status code | |
Serial.println(http.getString()); // API response | |
delay(2000); | |
} |
Hi, can I have your email? I'd like to discuss via email if allowed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@iqfareez Thank you for giving me sources and information.