Skip to content

wspr-ncsu/cellcrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cellcrypt

CellCrypt is a research tool for finding and analyzing cryptographic misuse in cellular cores. CellCrypt itself is written in python, and serves as a wrapper around CodeQL. Queries contained within CellCrypt are executed to extract relevant information from compiled databases, and said data is then processed by CellCrypt and output as results.

CellCrypt is a result of our work on our paper "Examining Randomness and Cryptographic Failures in Open-Source Cellular Cores", published at CODASPY '24. A link to the paper will be added once the publication is finalized. We are uploading CellCrypt here for archival and transparency, and to advocate and support open-sourcing research artifacts.

Setup

CodeQL CLI

CellCrypt uses CodeQL as the analysis engine. The CodeQL libraries used at the time of research are included as a submodule pointing to the relevant commit. However, the CodeQL binary must be downloaded directly.

  1. Download the CodeQL CLI binary from Github at https://github.com/github/codeql-cli-binaries/releases
  2. Extract the downloaded file to codeql-home/ in the CellCrypt project
  3. Copy codeql-home/ to ~/.local/
  4. Add the extracted files to $PATH
  5. Test in the CLI using codeql -v

Alternatively, follow the instructions at https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/setting-up-the-codeql-cli. If choosing this method and you wish to use the included libraries, copy ./codeql-home/codeql-repo/ at the appropriate step rather than downloading as instructed.

Python

  1. Install Python3 through your package manager or from https://www.python.org/
  2. Make sure pip is installed: python -m ensurepip
  3. Run pip install -r requirements.txt in the CellCrypt project directory

Recreating Experiment from CellCrypt Paper

Core Version Commit
Free5GC 3.0.2 f8a6e7c
SD-Core 1.3.0 amf,nrf,smf,ausf, nssf,pcf,udr,udm
Open5GS 2.5.6 3531166
OpenAirInterface CN5G 1.4.0 2ff64a2
OpenAirInterface EPC 1.2.0 2dd9a93
NextEPC 1.0.1 c51673c
srsRAN 23.04.1 fa56836

The table above lists the codebase versions and commits used in our experiments.

  1. For SD-Core, clone all tagged repos into a folder called sd-core/.
  2. For OpenAirInterface EPC, follow the instructions in the repo README to gather all required files. It needs some files from Magma MME.
  3. For all other cores, download the repos at specified commits. Make sure to initialize and update all submodules.

After these steps, you should have each core inside a top-level folder named after the core itself. Place each folder inside docker_containers and run the DockerFiles to build the CodeQL databases.

Note: Free5GC, SD-Core, Open5GS, and OAI-5G DockerFiles are currently under maintenance and missing from the repo. They will be added ASAP. In the meantime, run the scripts found in scripts/ to build those cores and extract the databases.

Running Queries

  1. Make sure all databases follow the directory structure specified in run.py. The previous instructions should ensure this.
  2. Execute python run.py

For additional information, run python run.py -h

For any questions, feel free to create and issue or reach out to [email protected].

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published