Skip to main content

AppScanner

This code was implemented as part of the NDSS FlowPrint [1] paper, it implements the Single Large Random Forest Classifier of AppScanner [2]. We ask people to cite both works when using the software for academic research papers.

Installation

Using pip

The easiest way to install appscanner is using pip

pip install appscanner

Manually

If you would like to install appscanner manually, please make sure you have installed the required dependencies.

Dependencies

This code is written in Python3 and depends on the following libraries:

  • Numpy
  • Pandas
  • Scikit-learn
  • Scapy

To install these use the following command

pip install -U scapy numpy pandas scikit-learn

Usage

The AppScanner implementation can be tested with the main.py script. This script allows you to specify .pcap files to load. After loading, the script splits the data into training and testing data and evaluates the performance. See main.py --help for more information.

API

It is also possible to directly use the AppScanner code as an API. There are two main classes which need to be understood.

  • appscanner.preprocessor.Preprocessor for extracting features from .pcap files.
  • appscanner.appscanner.AppScanner for applying the AppScanner detection.

Preprocessor

The Preprocessor object is used to extract data from .pcap files and label them. To this end, it uses the process function which requires a list of files and a list of labels. The list of files must be pathnames to pcap files. The list of labels must be labels corresponding to each file. The example below shows how the Preprocessor can be used.

Example
from appscanner.preprocessor import Preprocessor

# Create object
preprocessor = Preprocessor()
# Load from files
X, y = preprocessor.process(['<path_file_1>', ..., '<path_file_n>'],
                            ['<label_1>'    , ..., '<label_n>'])

AppScanner

The AppScanner object is used to find known applications in network traffic. AppScanner requires a confidence threshold (default=0.9). The threshold means AppScanner only returns labels for which it is confident enough or -1 otherwise, a threshold of 0 gives labels for every predicted sample. It can be fit with X_train and y_train arrays obtained by the Preprocessor. After it has been fit, the AppScanner is able to predict unknown samples X_test. The example below shows how AppScanner can be used.

Example
from appscanner.appscanner import AppScanner

# Create object
scanner = AppScanner(threshold=0.9)

# Fit scanner
scanner.fit(X_train, y_train)
# Predict labels of test data
y_pred = scanner.predict(X_test)

References

[1] van Ede, T., Bortolameotti, R., Continella, A., Ren, J., Dubois, D. J., Lindorfer, M., Choffnes, D., van Steen, M. & Peter, A. (2020, February). FlowPrint: Semi-Supervised Mobile-App Fingerprinting on Encrypted Network Traffic. In 2020 NDSS. The Internet Society.

[2] Taylor, V. F., Spolaor, R., Conti, M., & Martinovic, I. (2016, March). Appscanner: Automatic fingerprinting of smartphone apps from encrypted network traffic. In 2016 IEEE European Symposium on Security and Privacy (EuroS&P) (pp. 439-454). IEEE.

Bibtex

@inproceedings{vanede2020flowprint,
  title={{FlowPrint: Semi-Supervised Mobile-App Fingerprinting on Encrypted Network Traffic}},
  author={van Ede, Thijs and Bortolameotti, Riccardo and Continella, Andrea and Ren, Jingjing and Dubois, Daniel J. and Lindorfer, Martina and Choffness, David and van Steen, Maarten, and Peter, Andreas}
  booktitle={NDSS},
  year={2020},
  organization={The Internet Society}
}
@inproceedings{taylor2016appscanner,
  title={Appscanner: Automatic fingerprinting of smartphone apps from encrypted network traffic},
  author={Taylor, Vincent F and Spolaor, Riccardo and Conti, Mauro and Martinovic, Ivan},
  booktitle={2016 IEEE European Symposium on Security and Privacy (EuroS\&P)},
  pages={439--454},
  year={2016},
  organization={IEEE}
}

Metadata

Release files for appscanner 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for appscanner 1.0.2
File Size Uploaded
appscanner-1.0.2.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for appscanner 1.0.2
File Interpreter ABI Platform
appscanner-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / appscanner-1.0.2.tar.gz

Download URL appscanner-1.0.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d92d0a873286db711780b49a99a705ee4105fcd61a1a17d1867d234bc5e76fa8
BLAKE2b-256 checksum
How to use checksums
c3b42e52d03757583dca059595072d92d933f7f202ad76cbbe1de8260724041f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.9

Release files / appscanner-1.0.2-py3-none-any.whl

Download URL appscanner-1.0.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b30f85a999a68f27fdf47fd1f4a094dd88e2818c6c915105f2255ee4d424870d
BLAKE2b-256 checksum
How to use checksums
50fd6cd08bfdc9825a2c4ed714cebb08cf081f6eab4897a1d91220e2dfbce5cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page