Code release for USENIX Security'21 paper " Stars Can Tell: A Robust Method to Defend against GPS Spoofing using Off-the-shelf Chipset ".
Check our website for the technical paper, apk release, dataset, and more.
If you end up building on this research or code as part of a project or publication, please include a reference to the USENIX Security paper:
@inproceedings{liu2021stars,
title = {Stars Can Tell: A Robust Method to Defend against GPS Spoofing using Off-the-shelf Chipset},
author = {Liu, Shinan and Cheng, Xiang and Yang, Hanchao and Shu, Yuanchao and Weng, Xiaoran and Guo, Ping and Zeng, (Curtis) Kexiong and Wang, Gang and Yang, Yaling},
booktitle = {Proceedings of the 30th USENIX Security Symposium (USENIX Security 21)},
year = {2021}
}
Before getting started, you need to install the MATLAB, our code has been tested on MATLAB 2020a in both macOS and Window10. After installing MATLAB, download the repository to your computer and add the project repository as well as its subfolders to MATLAB search paths.
The project's directory layout:
.
├── Analysis # Analytic algorithm used in the paper
├── Config # Config files
├── Constants # Constant values
├── ExpData # directory to place GNSS logs
├── LoadData # Scripts for reading logs
├── Utils # Utils
├── LICENSE
└── README.md
Requirement: Android Phone with Android 8.0 or above.
We provide the apk file on our website and you can use it to install the customized GNSSLogger app on an Android smartphone. We developed the app based on Google's GNSS Logger and added orientation measurement on it. The app has been tested on Xiaomi MIX2, Xiaomi MI8, Xiaomi Redmi Note 7, Huawei Nova5pro, and Huawei P30.
Follow the steps in the screenshots below to start collecting GPS signals..
Run run.m
in Matlab
We provide 10 sample log (non-spoofing in open-air) files in ./ExpData/
. After running the code, you will see the results of our detection algorithm.
Change ./Config./SetConfig.m/
as follows and run run.m
:
function config = SetConfig
config.Base = '**/'; % The folder you save you files
config.LogFile = {
'gnss_log_yyy_mm_dd_HH_MM_SS.txt' % The file names
'gnss_log_yyy_mm_dd_HH_MM_SS.txt'
% ...
};
end
Note that the hourly ephemeris data should be placed in config.Base/HourlyEphemeris/
, and the code will tell you which hourly data is needed. You can download the data from here. On the website, go to the directory of the corresponding year and day, download the file named hourDDDD.YYn.gz
, uncompress the file, and put it into config.Base/HourlyEphemeris/
.
if you have any questions, please contact Shinan(shinanliu@uchicago.edu)
This project is partly inspired by GPS Measurement Tools from Google:
https://github.com/google/gps-measurement-tools.
And we use the Apache-2.0 License.