KapilWaghumbare123 commited on
Commit
8546a25
Β·
verified Β·
1 Parent(s): 065027d

Update Web/phishing.html

Browse files
Files changed (1) hide show
  1. Web/phishing.html +59 -72
Web/phishing.html CHANGED
@@ -2,7 +2,7 @@
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
- <meta-name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Phishing Website Checker | SpectroGuard</title>
7
 
8
  <style>
@@ -39,9 +39,9 @@
39
  color: #ffffff;
40
  }
41
 
42
- header nav a:hover {
43
- color: #000;
44
- }
45
 
46
  .container {
47
  max-width: 750px;
@@ -155,14 +155,12 @@ header nav a:hover {
155
 
156
  <button onclick="checkPhishing()">Check Website</button>
157
 
158
- <div class="result" id="resultText">Result: – The Website is Legit and safe to share detailesx</div>
159
 
160
  <div class="extra-info">
161
  This tool analyzes domain complexity, URL structure, HTTPS, redirections, and malicious patterns to flag potential phishing sites, helping users make informed, safer online decisions while remaining vigilant against deceptive attacks. </div>
162
- </div>
163
  </div>
164
 
165
- <!-- FOOTER -->
166
  <footer>
167
  <div class="footer-content">
168
  <div class="footer-item">
@@ -194,73 +192,62 @@ header nav a:hover {
194
  </div>
195
  </div>
196
 
197
- <div class="contact">
198
- Contact us: <a href="https://mail.google.com/mail/?view=cm&to=spectroguard.security@gmail.com&su=SpectroGuard%20Inquiry" target="_blank" style="color: #1877F2;">spectroguard.security@gmail.com</a>
199
- </div>
200
  </footer>
201
 
202
  <script>
203
- const resultEl = document.getElementById("resultText");
204
- const input = document.getElementById("urlInput");
205
-
206
- document.querySelector("button").addEventListener("click", checkPhishing);
207
- input.addEventListener("keydown", (e) => {
208
- if (e.key === "Enter") checkPhishing();
209
- });
210
-
211
-
212
- async function checkPhishing() {
213
- const url = document.getElementById("urlInput").value.trim();
214
- if (!url) { resultEl.textContent = "Result: Please enter a URL"; return; }
215
-
216
- resultEl.textContent = "Analyzing...";
217
- resultEl.style.color = "#888";
218
-
219
- try {
220
- const res = await fetch("http://127.0.0.1:5000/check_phishing", {
221
- method: "POST",
222
- headers: { "Content-Type": "application/json" },
223
- body: JSON.stringify({ url })
224
- });
225
- if (!res.ok) throw new Error();
226
- const data = await res.json();
227
- // We now pass result, status, and confidence
228
- updateUI(data.score, data.status);
229
- } catch {
230
- resultEl.textContent = "⚠ Backend not running β€” start app.py";
231
- resultEl.style.color = "#cc0000";
232
- }
233
- }
234
-
235
- function updateUI(score, status) {
236
- let icon = "❓";
237
- let color = "#f0ad4e"; // Default
238
-
239
- if (status === "Safe") {
240
- icon = "βœ…";
241
- color = "#28a745";
242
- } else if (status === "Suspicious") {
243
- icon = "⚠️";
244
- color = "#ff8c00";
245
- } else if (status === "Phishing") {
246
- icon = "🚫";
247
- color = "#cc0000";
248
- }
249
-
250
- let message = "";
251
-
252
- if (status === "Safe") {
253
- message = "Website appears safe";
254
- } else if (status === "Suspicious") {
255
- message = "This website looks suspicious";
256
- } else {
257
- message = "Potential phishing threat detected";
258
- }
259
-
260
- resultEl.textContent = `${icon} ${status} β€” ${message}. (Score: ${score}%)`;
261
- resultEl.style.color = color;
262
- }
263
-
264
- </script>
265
  </body>
266
  </html>
 
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Phishing Website Checker | SpectroGuard</title>
7
 
8
  <style>
 
39
  color: #ffffff;
40
  }
41
 
42
+ header nav a:hover {
43
+ color: #000;
44
+ }
45
 
46
  .container {
47
  max-width: 750px;
 
155
 
156
  <button onclick="checkPhishing()">Check Website</button>
157
 
158
+ <div class="result" id="resultText">Result: –</div>
159
 
160
  <div class="extra-info">
161
  This tool analyzes domain complexity, URL structure, HTTPS, redirections, and malicious patterns to flag potential phishing sites, helping users make informed, safer online decisions while remaining vigilant against deceptive attacks. </div>
 
162
  </div>
163
 
 
164
  <footer>
165
  <div class="footer-content">
166
  <div class="footer-item">
 
192
  </div>
193
  </div>
194
 
195
+ <div class="contact">
196
+ Contact us: <a href="https://mail.google.com/mail/?view=cm&to=spectroguard.security@gmail.com&su=SpectroGuard%20Inquiry" target="_blank" style="color: #1877F2;">spectroguard.security@gmail.com</a>
197
+ </div>
198
  </footer>
199
 
200
  <script>
201
+ const resultEl = document.getElementById("resultText");
202
+ const input = document.getElementById("urlInput");
203
+
204
+ input.addEventListener("keydown", (e) => {
205
+ if (e.key === "Enter") checkPhishing();
206
+ });
207
+
208
+ async function checkPhishing() {
209
+ const url = document.getElementById("urlInput").value.trim();
210
+ if (!url) { resultEl.textContent = "Result: Please enter a URL"; return; }
211
+
212
+ resultEl.textContent = "Analyzing Website Infrastructure...";
213
+ resultEl.style.color = "#888";
214
+
215
+ try {
216
+ // πŸ”— FIXED: Relative address maps perfectly to your live Flask app
217
+ const res = await fetch("/check_phishing", {
218
+ method: "POST",
219
+ headers: { "Content-Type": "application/json" },
220
+ body: JSON.stringify({ url })
221
+ });
222
+ if (!res.ok) throw new Error();
223
+ const data = await res.json();
224
+
225
+ updateUI(data.score, data.status);
226
+ } catch {
227
+ resultEl.textContent = "⚠ Server Error β€” Connection could not be established";
228
+ resultEl.style.color = "#cc0000";
229
+ }
230
+ }
231
+
232
+ function updateUI(score, status) {
233
+ let icon = "❓";
234
+ let color = "#f0ad4e";
235
+ let message = "";
236
+
237
+ // πŸ”— FIXED: Map your UI components perfectly to your backend's direct response classifications
238
+ if (status === "Safe") {
239
+ icon = "βœ…";
240
+ color = "#28a745";
241
+ message = "Website appears safe and legitimate";
242
+ } else {
243
+ icon = "🚨";
244
+ color = "#cc0000";
245
+ message = "Potential phishing threat detected";
246
+ }
247
+
248
+ resultEl.textContent = `${icon} ${status} β€” ${message}. (Phishing Probability: ${score}%)`;
249
+ resultEl.style.color = color;
250
+ }
251
+ </script>
 
 
 
 
 
 
 
 
 
 
 
252
  </body>
253
  </html>