WAGIC is a WPF-based graphical user interface for interacting with MAGIC - Detecting Advanced Persistent Threats via Masked Graph Representation Learning
WAGIC provides a user-friendly graphical interface for:
- Training MAGIC models on different datasets
- Evaluating and assessing model performance
- Automatically generating and displaying visualization charts
- Real-time monitoring of training/evaluation progress
- Managing trained models
- Windows 10/11
- .NET 8.0 or higher
- Visual Studio 2022 (for development)
- Python 3.8+
- PyTorch
- Flask
- NumPy, Pandas, Matplotlib
- Other dependencies (see requirements.txt in MAGIC repo)
# Clone MAGIC repository
git clone https://github.com/WanThinnn/MAGIC.git
cd MAGIC
# Install Python dependencies
pip install -r requirements.txt
# Run Flask API server
python app.pyBackend will run at: http://localhost:5000
# Clone WAGIC repository
git clone https://github.com/WanThinnn/WAGIC.git
cd WAGIC
# Build project
dotnet build
# Run application
dotnet run --project WAGICOr open WAGIC.sln in Visual Studio and run.
WAGIC supports the following datasets:
- cadets - DARPA TC Cadets dataset
- fivedirections - Five Directions dataset
- streamspot - StreamSpot dataset
- theia - DARPA TC Theia dataset
- trace - DARPA TC Trace dataset
- wget - Wget dataset
- Select dataset from "Dataset Selection" dropdown
- Click "Start Training"
- Monitor progress via progress bar and log
- Wait for completion - model will be saved automatically
- Select dataset that has a trained model
- Click "Start Evaluation"
- View results displayed on the interface:
- AUC, F1, Precision, Recall
- Confusion Matrix (TN, FN, TP, FP)
- Test AUC with standard deviation
- Automatic: Charts are generated automatically after evaluation
- Manual: Click "Create Chart" button anytime
- Result Window: Separate window displays charts with zoom/pan functionality
WAGIC communicates with MAGIC backend through the following APIs:
| Endpoint | Method | Description |
|---|---|---|
/api/datasets |
GET | Get list of available datasets |
/api/models |
GET | Get list of trained models |
/api/train |
POST | Start training process |
/api/train/status |
GET | Get training status |
/api/eval |
POST | Start evaluation process |
/api/eval/status |
GET | Get evaluation status |
/api/visualize |
POST | Generate visualization charts |
/api/latest-result-image |
GET | Get latest result image |
WAGIC/
├── WAGIC/
│ ├── MainWindow.xaml # Main interface
│ ├── MainWindow.xaml.cs # Main logic
│ ├── result_windows.xaml # Result display interface
│ ├── result_windows.xaml.cs # Result window logic
│ ├── App.xaml # App configuration
│ └── WAGIC.csproj # Project file
├── WAGIC.sln # Solution file
└── README.md # This file
Error connecting to API: http://localhost:5000
Solution: Ensure MAGIC backend is running on port 5000
Invalid dataset. Choose from: [cadets, fivedirections, ...]
Solution: Select dataset from available dropdown options
No model found for dataset X. Please train first!
Solution: Run training for that dataset before evaluation
UnicodeDecodeError: 'charmap' codec can't decode byte
Solution: Fixed in backend with encoding='utf-8'
- Lại Quan Thiên - WanThinnn
- Mai Nguyễn Nam Phương - Mai Nguyen Nam Phuong - Cyber Security
- Trần Thế Hữu Phúc - tranthehuuphuc
- Hồ Diệp Huy - hohuyy
- MAGIC Framework - MAGIC Repository
- DARPA TC Program - For providing the datasets used
- PyTorch Team - Main machine learning framework
- Microsoft WPF Team - GUI framework
Star this repository if you find it helpful!

