File size: 2,418 Bytes
1e1f9e3
209f80e
 
 
 
1e1f9e3
209f80e
1e1f9e3
 
209f80e
1e1f9e3
 
209f80e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481147c
 
209f80e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Malicious Email & URL Detector v2
emoji: 🛡️
colorFrom: red
colorTo: yellow
sdk: streamlit
sdk_version: 1.43.2
app_file: app.py
pinned: false
short_description: A web app for detecting malicious emails and URLs
---

# Malicious Email & URL Detector v2

A lightweight **Streamlit** web application that utilizes a fine-tuned deep learning model to detect malicious content in emails and URLs. The app helps individuals and organizations identify threats such as **phishing** and **malware** before any harm can occur.

---

## Key Features

- **Real-Time Detection**  
  Quickly classifies emails or URLs as **malicious** or **benign** using a fine-tuned transformer model.
- **User-Friendly Interface**  
  Paste the email text or URL, then click a button—no advanced knowledge required.
- **Lightweight & Fast**  
  Built on Streamlit for a snappy, interactive experience.

---

## How It Works

1. **Model**  
   A fine-tuned variant of [distilroberta-base](https://huggingface.co/distilroberta-base) trained on a curated dataset of phishing, malware, and legitimate examples.
2. **Input**  
   Users provide either an email’s textual content or a single URL. The app normalizes and processes the input.
3. **Inference**  
   The model returns a **label** (malicious/benign) and a **confidence score**, enabling quick decisions on blocking or flagging potential threats.

---

## Quickstart

1. **Clone the Repository**  
   ```bash
   git clone https://huggingface.co/spaces/your-username/Malicious-Email-and-URL-Detector-v2
   cd Malicious-Email-and-URL-Detector-v2

2. **Install Dependencies**
   pip install -r requirements.txt

3. **Run the App**  
   streamlit run app.py

4. **Use It**

   Step 1: Paste the email content or URL into the input box.

   Step 2: Click Analyze.

   Step 3: View the output displaying the classification (malicious or benign) and the confidence score.

6. **Example**

   Input:

   "Hello, your account has been locked. Please verify at http://suspicious-link.com"

   Output:

   Malicious (Confidence: 0.95)


## Limitations
Limitations
False Positives/Negatives: No model is perfect. Always combine with other security measures.

Dataset Bias: Performance depends on how well the training data represents real-world threats.

Evolving Threats: Regular updates are recommended to keep pace with new phishing or malware tactics.

## Contact
Author: Eason Liu