--- license: apache-2.0 language: - en tags: - cybersecurity - intrusion-detection - phishing-detection - vulnerability-scoring - machine-learning - random-forest - xgboost --- # 🛡️ Cybersecurity ML Models A collection of machine learning models for cybersecurity threat detection and vulnerability assessment. ## Models Included ### 🔍 Intrusion Detection (UNSW-NB15) Detects network intrusions and classifies attack types. - **Algorithm:** Random Forest + XGBoost - **Classes:** Normal, DoS, Exploits, Fuzzers, Generic, Reconnaissance, Backdoor, Analysis, Shellcode, Worms - **Dataset:** UNSW-NB15 ### 🎣 Phishing Detection Identifies phishing URLs and malicious web content. - **Algorithm:** Random Forest + XGBoost - **Output:** Phishing / Legitimate ### 🛡️ Vulnerability Scoring Predicts vulnerability severity and CVSS scores. - **Algorithm:** Random Forest + XGBoost (classifier + regressor) - **Output:** Severity label + numeric score --- ## 📁 Repository Structure ``` ├── predictor.pkl # Main predictor (load this) ├── preprocessors/ │ ├── intrusion_label_encoder.pkl │ ├── intrusion_scaler.pkl │ ├── phishing_scaler.pkl │ ├── severity_encoder.pkl │ ├── vulnerability_scaler.pkl │ ├── intrusion_feature_names.json │ ├── phishing_feature_names.json │ └── vulnerability_feature_names.json └── saved_models/ ├── intrusion_detection/ ├── phishing_detection/ └── vulnerability_scoring/ ``` --- ## 🚀 Quickstart ### Install dependencies ```bash pip install scikit-learn xgboost joblib huggingface_hub ``` ### Load the models ```python import joblib from huggingface_hub import hf_hub_download # Download and load main predictor path = hf_hub_download(repo_id="Alfeesi/cybersecurity-ml-models", filename="predictor.pkl") predictor = joblib.load(path) ``` ### Intrusion Detection ```python import numpy as np features = np.array([[0.5, 0, 1, 1024, 512]]) # your network features result = predictor.predict_intrusion(features) print(f"Attack Type: {result['attack_type']}") ``` ### Phishing Detection ```python features = np.array([[75, 1, 3, 0]]) # url_length, has_ip, num_dots, has_https result = predictor.predict_phishing(features) print(f"Phishing: {result}") ``` ### Vulnerability Scoring ```python features = np.array([[7.5, 0, 0]]) # cvss_base, attack_vector, complexity result = predictor.predict_vulnerability(features) print(f"Severity: {result['severity']} | Score: {result['score']}") ``` --- ## 📊 Model Performance | Model | Metric | Score | |-------|--------|-------| | Intrusion Detection | Accuracy | See evaluation/ | | Phishing Detection | Accuracy | See evaluation/ | | Vulnerability Scoring | RMSE | See evaluation/ | --- ## 🔗 Live Demo https://huggingface.co/spaces/Alfeesi/cybersecurity-demo --- ## 📄 License Apache 2.0 — free to use, modify, and distribute.