-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
39 lines (30 loc) · 892 Bytes
/
Copy pathapp.py
File metadata and controls
39 lines (30 loc) · 892 Bytes
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
import streamlit as st
import numpy as np
st.set_page_config(
page_title="Malicious URL Detection",
layout="centered"
)
st.title("🔐 Malicious URL Detection System")
st.caption("Machine Learning-based URL Classification")
url = st.text_input(
"Enter URL to scan",
placeholder="https://example.com"
)
if st.button("Scan URL"):
# --- MOCK FEATURES
features = {
"URL Length": len(url),
"Special Characters": sum(not c.isalnum() for c in url),
"HTTPS Used": url.startswith("https"),
"Domain Age": "New"
}
prediction = "MALICIOUS"
confidence = 0.92
st.divider()
if prediction == "MALICIOUS":
st.error("⚠️ Status: MALICIOUS")
else:
st.success("✅ Status: SAFE")
st.metric("Confidence Score", f"{confidence * 100:.1f}%")
st.subheader("Extracted Features")
st.json(features)