| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This repository contains code of the paper "Gotta Detect ’Em All: Fake Base Station and Multi-Step Attack Detection in Cellular Networks" for detecting Fake Base Stations (FBS) and Multi-Step Attacks (MSAs) from cellular network traces in the User Equipment (UE).
. ├── app/ │ ├── app-release.apk │ ├── note.txt ├── codes/ │ ├── classification-models.py │ ├── cross-validation.py │ ├── feature-names.py │ ├── graph_models.py │ ├── graphsage_metrics.py │ ├── ml-stats.py │ ├── stateful-lstm-w-attn.py │ └── trace-level-classification.py │ ├── dataset/ │ ├── fbs_nas.csv │ ├── fbs_rrc.csv │ ├── msa_nas.csv │ ├── msa_rrc.csv │ ├── msa_nas_reshaped.csv │ ├── msa_rrc_reshaped.csv │ ├── plot_data.json │ ├── phoenix-implementation/ │ ├── dfa.py │ ├── mm.py │ ├── packet_utils.py │ └── pltl.py │ └── requirements.txt
This project implements a machine learning-based approach for detecting fake base stations and multi-step attacks from cellular network traces.
The 1-1 mapping of categorical and encoded labels is given below
| Attack Name | Label |
|---|---|
| Benign | 0 |
| Energy Depletion attack | 1 |
| NAS counter Desynch attack | 2 |
| X2 signalling flood | 3 |
| Paging channel hijacking attack | 4 |
| Bidding down with AttachReject | 5 |
| Incarceration with rrcReject and rrcRelease | 6 |
| Panic Attack | 7 |
| Stealthy Kickoff Attack | 8 |
| Authentication relay attack | 9 |
| Location tracking via measurement reports | 10 |
| Capability Hijacking | 11 |
| Lullaby attack using rrcReestablishRequest | 12 |
| Mobile Network Mapping (MNmap) | 13 |
| Lullaby attack with rrcResume | 14 |
| IMSI catching | 15 |
| Incarceration with rrcReestablishReject | 16 |
| Handover hijacking | 17 |
| RRC replay attack | 18 |
| Lullaby attack with rrcReconfiguration | 19 |
| Bidding down with ServiceReject | 20 |
| Bidding down with TAUReject | 21 |
See requirements.txt for details.
See the following sections to reproduce the results in the paper. You can also use this notebook to do all of it together.
We will create and activate a virtual environment for the project.
Create the virtual environment
python3 -m venv venvActivate the virtual environment
source venv/bin/activatepip install -r requirements.txtThe classification-models.py script trains and evaluates the following models:
To run the classification-models.py script, use the following command:
python codes/classification-models.py <[fbs_nas/msa_nas/fbs_rrc/msa_rrc].csv>Replace <[fbs_nas/msa_nas/fbs_rrc/msa_rrc].csv> with the path to your dataset file.
Example:
python codes/classification-models.py dataset/fbs_nas.csvThe script will load the dataset, train the models, and display the performance metrics for each model for the provided dataset.
The graph_models.py script trains and evaluates the following graph neural network models:
To run the graph_models.py script, use the following command:
python3 codes/graph_models.py <[dataset_path]>Replace <dataset_path> with the path to your dataset file.
Example:
python3 codes/graph_models.py dataset/msa_nas.csvTo run the stateful-lstm-w-attn.py script, use the following command:
python3 codes/stateful-lstm-w-attn.py <[dataset_path]>Replace <dataset_path> with the path to your dataset file.
Example:
python3 codes/stateful-lstm-w-attn.py dataset/fbs_nas.csv This script implements our stateful LSTM model with attention mechanism and evaluates its performance.
python3 codes/trace-level-classification.pyThis script performs trace-level classification using following machine learning models:
The ml-stats.py script plots various statistics related to the machine learning models.
To run the ml-stats.py script, use the following command:
python3 codes/ml-stats.pyThis script generates the following plots:
The plots are saved in the outputs/figures directory.
The graphsage_metrics.py script calculates metrics for the GraphSAGE model.
To run the graphsage_metrics.py script, use the following command:
python3 codes/graphsage_metrics.py <[dataset_path]>Replace <dataset_path> with the path to your dataset file.
Example:
python3 codes/graphsage_metrics.py dataset/msa_nas.csvThis script generates a tabular summary of the following metrics for each class:
The results are printed to the console.
python3 codes/feature-names.pyThis script prints the feature names from the dataset in the outputs/column_names_output.txt file.
To run the cross-validation.py script, use the following command:
python3 codes/cross-validation.py <[dataset_path]>Replace <dataset_path> with the path to your dataset file.
Example:
python3 codes/cross-validation.py dataset/msa_nas.csvThis script performs leave-one-class-out cross-validation and generates the following outputs:
To run our implementation for PHOENIX's signature-based detection, run the following codes. Download PHOENIX's signatures and traces from their website and put in the dataset folder.
The dfa.py script detects anomalies using a Deterministic Finite Automaton (DFA) parsed from a DOT file.
To run the dfa.py script, use the following command:
python phoenix-implementation/dfa.py <state_machine.dot> <trace.pcap>Replace <state_machine.dot> with the path to your DOT file and <trace.pcap> with the path to your trace file.
Example:
python3 phoenix-implementation/dfa.py dataset/signatures/dfa/NAS/attach_reject/attach_reject_50_40.trace.dot dataset/NAS_PCAP_logs/attach_reject.pcapThe mm.py script processes events using a Mealy Machine parsed from a DOT file.
To run the mm.py script, use the following command:
python phoenix-implementation/mm.py <trace.pcap>Replace <trace.pcap> with the path to your trace file.
Example:
python3 phoenix-implementation/mm.py dataset/NAS_PCAP_logs/attach_reject.pcapThe pltl.py script checks events against Propositional Linear Temporal Logic (PLTL) signatures.
To run the pltl.py script, use the following command:
python phoenix-implementation/pltl.py <trace.pcap>Replace <trace.pcap> with the path to your trace file.
Example:
python phoenix-implementation/pltl.py dataset/NAS_PCAP_logs/attach_reject.pcapIf you use this dataset, models, or code modules, please cite the following paper:
@misc{mubasshir2025gottadetectemall,
title={Gotta Detect 'Em All: Fake Base Station and Multi-Step Attack Detection in Cellular Networks},
author={Kazi Samin Mubasshir and Imtiaz Karim and Elisa Bertino},
year={2025},
eprint={2401.04958},
archivePrefix={arXiv},
primaryClass={cs.CR},
url={https://arxiv.org/abs/2401.04958},
}
| Back | FazBrowse Home | New Git URL |