Real-time anomaly detection system for Apache Struts CVE-2017-5638 exploit using streaming analytics, 3-gram byte analysis, and Count-Min Sketch. Detects RCE attacks without signatures, with <5ms latency and <0.1% false positives. # 🚨 Real-Time Anomaly Detection for Apache Struts CVE-2017-5638
> **Deteksi Zero-Day Exploit Berbasis Analitik Streaming & Probabilistic Data Structures**


## 📌 Keterangan Proyek
Proyek ini adalah **sistem deteksi anomali real-time** yang dirancang untuk **mendeteksi eksploitasi RCE (Remote Code Execution)** pada **Apache Struts melalui kerentanan CVE-2017-5638**, tanpa bergantung pada signature atau pola yang sudah diketahui.
CVE-2017-5638 adalah kerentanan kritis yang digunakan dalam **serangan Equifax 2017**, yang menyebabkan kebocoran data pribadi 147 juta orang. Serangan ini berhasil karena **kegagalan dalam manajemen patch dan deteksi dini**.
Sistem ini mengatasi kelemahan tersebut dengan:
- ✅ **Deteksi berbasis perilaku** (bukan signature)
- ✅ **Analisis byte-level 3-gram** dari seluruh request HTTP
- ✅ **Count-Min Sketch** untuk pelacakan frekuensi efisien
- ✅ **Divergensi KL** untuk mengukur penyimpangan dari pola normal
- ✅ **Threshold adaptif** (mean + 3σ) untuk deteksi real-time
- ✅ **Dashboard visual** dengan Streamlit
Tujuannya: **mendeteksi eksploitasi zero-day sebelum sistem dikompromikan**, bahkan jika payload belum pernah dilihat sebelumnya.
---
## 🎯 Tujuan Utama
- Mendeteksi eksploitasi Struts secara real-time dengan **latensi ≤ 5ms**
- Memori ≤ 1 GB meskipun throughput ≥ 50.000 request/detik
- Tingkat **positif palsu < 0,1%** pada data normal
- Tingkat **deteksi ≥ 95%** pada payload eksploitasi sintetik
- Sistem dapat di-deploy dan dimonitor secara real-time
## STEP menjalankan
- Jalankan simulator log (50k req/sec, 60 detik)
python scripts/simulate_logs.py
- Jalankan sistem deteksi
python src/main.py
- Buka dashboard real-time di terminal baru
streamlit run scripts/dashboard.py
[4.0K] /data/pocs/453a626f278169c4d7219e0d98f7ea5950620270
├── [ 537] Dockerfile
├── [1.4K] Makefile
├── [1.8K] README.md
├── [ 27] requirements.txt
├── [4.0K] screenshots
│ ├── [101K] dashboard.jpg
│ └── [ 14K] Evaluasi-Sistem-Deteksi.png
├── [4.0K] scripts
│ ├── [4.9K] dashboard.py
│ ├── [2.3K] evaluate_performance.py
│ └── [3.6K] simulate_logs.py
├── [4.0K] src
│ ├── [4.0K] alerting
│ │ ├── [1.1K] alert_engine.py
│ │ └── [1.5K] metrics_eval.py
│ ├── [4.0K] anomaly_detection
│ │ ├── [1.2K] adaptive_threshold.py
│ │ └── [1.4K] kl_divergence.py
│ ├── [4.0K] data_ingest
│ │ ├── [ 25] log_consumer.py
│ │ └── [ 31] log_simulator.py
│ ├── [4.0K] feature_extraction
│ │ ├── [1.7K] count_min_sketch.py
│ │ └── [ 496] ngram_extractor.py
│ ├── [5.8K] main.py
│ └── [4.0K] preprocessing
│ ├── [1.5K] parser.py
│ └── [1.7K] request_builder.py
└── [4.0K] tests
├── [1.3K] test_alerting.py
├── [2.0K] test_detection.py
├── [ 952] test_parser.py
└── [1005] test_sketch.py
9 directories, 24 files