This repository contains the source code and experimental data derived from research on WebAssembly obfuscation. It has been developed as a part of my Master's thesis in Computer Science at the Norwegian University of Science and Technology (NTNU). The thesis can be found here and the paper can be found here. The experimental data, containing close to 50,000 WebAssembly binaries, can be found under the releases.
- Analysis contains the data and code to create the plots used in the thesis.
- Dataset contains the source code and build files for the applications in the dataset.
- Detection contains the source code of the cryptomining detection methods.
- Metrics contains code for measuring the file size, hash rate, and similarity between WebAssembly binaries.
- Miner contains code for the web-based cryptominer.
- Mongodb contains code relating to the mongodb database.
- Obfuscation contains code for obfuscating the WebAssembly binaries.
- Optimization contains code for optimizing the WebAssembly binaries.
- Verify hashes contains code for verifying the hashes of the cryptomining WebAssembly binaries.
- Python 3
- Docker
Some of the docker containers require specific networks to be setup. Specifically, a database, miner, and WASim network will need to be created:
docker network create db_network
docker network create mn_network
docker network create wasim_network
cd mongodb
docker compose run mongodb
The database must run before running the experiments.
cd dataset
docker compose run build-dataset
This will build the applications in the dataset folder using Emscripten and move the WebAssembly binaries, as well as the accompanying JavaScript glue code and HTML file to the binaries folder.
cd obfuscation
docker compose run <method>
where <method>
is either tigress
, llvm
, or wasm-mutate
.
cd detection
docker compose run <method>
where <method>
is either minos
, miner-ray
, virustotal
, or wasim
.
cd metrics
docker compose run file-size
docker compose run dtw
First, start the miner:
cd miner
docker compose up
Then, navigate back to metrics
and run:
cd ../metrics
docker compose run hash-rate
cd verify-hashes
docker compose run verify-hashes
cd optimization
docker compose run v8-stats
This will create a .v8
file in the binaries
folder with the extracted V8 data.
cd optimization
docker compose run opt
The database will then need to be reset before re-running the experiment with the optimized WebAssembly binaries.