-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
262 lines (222 loc) · 6.37 KB
/
index.html
File metadata and controls
262 lines (222 loc) · 6.37 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ESP32 Web Serial Terminal</title>
<style>
body {
font-family: 'Courier New', Courier, monospace;
background-color: #1e1e1e;
color: #fff;
margin: 0;
padding: 0;
text-align: center;
}
h1 {
color: #4CAF50;
margin: 10px 0;
}
.container {
max-width: 800px;
margin: 20px auto;
padding: 20px;
background-color: #222;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.5);
position: relative;
}
.terminal {
width: 100%;
height: 300px;
background-color: #000;
color: #0f0;
padding: 10px;
border-radius: 5px;
overflow-y: auto;
text-align: left;
font-size: 14px;
line-height: 1.5;
border: 1px solid #4CAF50;
white-space: pre-wrap;
}
.command-container {
position: relative;
width: 100%;
}
.command-input {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #4CAF50;
background-color: #333;
color: #fff;
font-size: 16px;
margin-top: 10px;
}
.suggestions {
position: absolute;
width: 100%;
background-color: #333;
border: 1px solid #4CAF50;
color: white;
max-height: 150px;
overflow-y: auto;
border-radius: 5px;
display: none;
text-align: left;
}
.suggestion {
padding: 10px;
cursor: pointer;
}
.suggestion:hover {
background-color: #4CAF50;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px;
font-size: 16px;
border-radius: 5px;
border: none;
cursor: pointer;
margin-top: 10px;
}
button:hover {
background-color: #45a049;
}
/* Styling for Text */
.made-by {
color: red;
font-size: 18px;
font-weight: bold;
margin-top: 10px;
}
.credit {
background: linear-gradient(90deg, rgba(255,0,150,1) 0%, rgba(0,204,255,1) 100%);
-webkit-background-clip: text;
color: transparent;
font-size: 18px;
font-weight: bold;
margin-top: 5px;
}
</style>
</head>
<body>
<!-- Title -->
<h1>ESP32 Web Serial Terminal</h1>
<!-- Made By Linuxndroid (Below Title) -->
<div class="made-by">Made By Linuxndroid</div>
<!-- All Credit ESP32Marauder Team (Below "Made By Linuxndroid") -->
<div class="credit">All Credit ESP32Marauder Team</div>
<div class="container">
<!-- Connection Button -->
<button onclick="connectSerial()">Connect to ESP32</button>
<!-- Terminal Display -->
<div id="terminal" class="terminal">Waiting for connection...</div>
<!-- Command Input with Suggestions -->
<div class="command-container">
<input type="text" id="commandInput" class="command-input" placeholder="Type a command..." oninput="showSuggestions()" onkeypress="handleKeyPress(event)">
<div id="suggestions" class="suggestions"></div>
</div>
<button onclick="sendCommand()">Send Command</button>
</div>
<script>
let port;
let writer;
let reader;
let decoder = new TextDecoder();
let encoder = new TextEncoder();
// List of suggested commands
const commandList = [
"help", "scanap", "stopscan", "list -a", "save -a 0",
"evilportal -c start", "clearlist -a", "attack -t deauth",
"blespam -t all", "sniffraw", "select -a",
"evilportal -c start -w apple.html",
"evilportal -c start -w Better_Google_Mobile.html",
"ssid -a -n Linuxndroid", "reboot", "select -s", "ls /",
];
async function connectSerial() {
try {
port = await navigator.serial.requestPort();
await port.open({ baudRate: 115200 });
writer = port.writable.getWriter();
reader = port.readable.getReader();
updateTerminal("Connected to ESP32\n");
listenToSerial();
} catch (error) {
alert("Connection failed: " + error.message);
}
}
async function listenToSerial() {
try {
while (port.readable) {
const { value, done } = await reader.read();
if (done) {
break;
}
const text = decoder.decode(value);
updateTerminal(text);
}
} catch (error) {
console.error("Error reading serial data: ", error);
}
}
async function sendCommand() {
const commandInput = document.getElementById("commandInput");
const command = commandInput.value.trim();
if (!command) return;
updateTerminal(`\n> ${command}`);
const data = encoder.encode(command + "\n");
await writer.write(data);
commandInput.value = "";
hideSuggestions(); // Hide suggestions after sending command
}
function handleKeyPress(event) {
if (event.key === "Enter") {
sendCommand();
}
}
function updateTerminal(text) {
const terminal = document.getElementById("terminal");
terminal.innerHTML += text;
terminal.scrollTop = terminal.scrollHeight; // Auto-scroll to bottom
}
function showSuggestions() {
const input = document.getElementById("commandInput").value.toLowerCase();
const suggestionsBox = document.getElementById("suggestions");
suggestionsBox.innerHTML = "";
if (!input) {
suggestionsBox.style.display = "none";
return;
}
const filteredCommands = commandList.filter(cmd => cmd.startsWith(input));
if (filteredCommands.length === 0) {
suggestionsBox.style.display = "none";
return;
}
filteredCommands.forEach(command => {
const div = document.createElement("div");
div.classList.add("suggestion");
div.textContent = command;
div.onclick = () => selectCommand(command);
suggestionsBox.appendChild(div);
});
suggestionsBox.style.display = "block";
}
function selectCommand(command) {
document.getElementById("commandInput").value = command;
hideSuggestions();
}
function hideSuggestions() {
document.getElementById("suggestions").style.display = "none";
}
document.addEventListener("click", (event) => {
if (!event.target.classList.contains("suggestion")) {
hideSuggestions();
}
});
</script>
</body>
</html>