Benign network traces that were used can be found here:
- https://mcfp.felk.cvut.cz/publicDatasets/CTU-Normal-14/ (Visible)
- https://mcfp.felk.cvut.cz/publicDatasets/CTU-Normal-33/ (Invisible)
- https://mcfp.felk.cvut.cz/publicDatasets/CTU-Normal-7/ (Invisible)
- https://mcfp.felk.cvut.cz/publicDatasets/CTU-Normal-20/ (Invisible)
Malspam Download Scenario:
- https://www.malware-traffic-analysis.net/2021/04/12/index.html (Visible)
- https://www.malware-traffic-analysis.net/2021/07/02/index.html (Invisible)
- https://www.malware-traffic-analysis.net/2022/09/21/index.html (Invisible)
- https://www.malware-traffic-analysis.net/2023/12/11/index.html (Invisible)
RAT Scenario:
- https://www.malware-traffic-analysis.net/2024/01/09/index.html (Invisible)
- https://www.malware-traffic-analysis.net/2024/03/14/index.html (Invisible)
There is a third trace for the RAT scenario that is currently not in the public domain and too large (>1GB) to share as part of this repository. Therefore, we cannot make this available at this time. The PCAPs collected for the Baby and PHP Information Disclosure scenario contain identifying information and are therefore not available. Sadly, PCAPs are not an easy data format to anonymize, since identifying information can be contained in many locations. A typical anonymization method like randomizing IP addresses and removing packet payloads is not suitable, since the detection rules engineered during the workshop may rely on deep packet inspection. Despite this, we believe the included traces are sufficient to allow reviewers to assess the methodology by which the datasets used for our analysis are gathered. We note that the network traces used as part of our experiments are not part of our core contribution. We intend to make the remaining used PCAPs fully available after acceptance, when preserving anonymity is no longer a concern.
Modify docker-compose.yml to configure the following:
- A password for the Postgres database in
services.postgres.environment.POSTGRES_PASSWORDandservices.umami.environment.DATABASE_URL - The number of workers (test runners) you want to run on the main instance in
services.django.environment.N_WORKERS - PgAdmin credentials in
services.pgadmin.environmentif you want to use PgAdmin for database monitoring - Additionally, you may want to change the ports Nginx is exposed on and subnet ranges to prevent overlap with pre-existing used IP addresses.
Modify djangosite/djangosite/settings.py to configure the following:
- A new secret
SECRET_KEY - The domain name you want to use in
ALLOWED_HOSTSandCSRF_TRUSTED_ORIGINS - The chosen password for the Postgres database in
DATABASES.default.PASSWORD - Configure an SMTP client using
EMAIL_BACKENDand the settings directly underneath (e.g., you can use Gmail)
Modify init-letsencrypt.sh to reflect the domain name(s) that you want to use for hosting the platform.
To do the initial deployment of the platform, ensure Docker is installed on your host and the current user is allowed to deploy containers and expose relevant ports. Then simply, run the following commands.
docker compose up -ddocker compose exec postgres su postgres psql -c 'createdb -O postgres umami;'sudo chmod -R 777 pgadmin_datadocker compose exec django /venv/bin/python3 manage.py makemigrations maindocker compose exec django /venv/bin/python3 manage.py migratedocker compose exec django /venv/bin/python3 manage.py createsuperuser --username=ANONYMIZED --email=ANONYMIZED./init-letsencrypt.sh
You can test whether the setup is successful by visiting the platform through the chosen domain name and logging in with the newly created superuser.
To provision a newly created platform with the available PCAPs, you can either manually configure the scenarios through the admin page https://ctf.anonymized.net/admin or you can import the network traces described above using a database dump. To do the latter, execute the following two commands:
docker compose exec django /venv/bin/python3 manage.py loaddata dumps/provisioning/provisioning.jsoncp -r djangosite/dumps/provisioning/pcap djangosite_data/media/
By provisioning with this data, you will also have created several users, whose usernames and passwords are identical:
- admin: a superuser with access to the admin webpage
- tester: a normal user, simulating the experience of a typical participant
- leaderboard: a dummy user that can be used to project a leaderboard in a classroom
- leaderboard_hidden: another dummy user, but this one shows the hidden test score on the leaderboard as well
When dealing with a large number of simultaneous participants, it may be desirable to set up additional workers on other machines. Note that the worker machine needs to be able to access the web server and the database on the main instance. A worker will connect to the database and look for untested submissions, after which it will download relevant PCAPS and test submissions against those.
- Adjust
docker-compose_worker.ymlso thatDATABASE_HOSTpoints to the server hosting the main instance andN_WORKERSspecifies the number of additional workers to run. docker compose -f docker-compose_worker.yml up -d --force-recreate --build
There are several commands and procedures that you will most likely not need, but that are useful to be aware of.
If you make changes to the platform and wish to (partially) redeploy the platform, you can simply run the following commands.
docker compose cp djangosite/static django:/djangositedocker compose up -d --force-recreate --build --no-deps django nginxdocker compose exec django /venv/bin/python3 manage.py makemigrationsdocker compose exec django /venv/bin/python3 manage.py migrate
If you change tests or add new tests, you may want to retest past submissions. You can do so by running the following two commands.
docker compose exec django /venv/bin/python3 manage.py retest &docker compose up -d --force-recreate --build --no-deps django
Sometimes test results may appear incomplete if a container is stopped while running tests. If you want to verify that all submissions have been tested on all available and configured network traces, you can run the following command.
docker compose exec django /venv/bin/python3 manage.py verifytestresults
If you want to move your instance to a different machine, or just want to backup the data, you can use the following command to dump all database contents to a json file.
docker compose exec django /venv/bin/python3 manage.py dumpdata > djangosite/dumps/dumpdata.json
Note that the above command will not export any files uploaded via the admin portal that may be referenced in the database. Therefore, you should also make a copy of djangosite_data/media to restore later.
If you later want to import that json file, you can simply run the following command. Note that the dump must be available within the container.
docker compose exec django /venv/bin/python3 manage.py loaddata dumps/dumpdata.json
You can edit in the admin website the scenarios and upload a PDF file there for each scenario.
Additionally, you can make an instruction lecture PDF to participants depending on their experiment group. Users that are a member of "Experiment Group 1" will be able to access a file djangosite/handouts/group1/handout.pdf if that file exists. The same goes for any other experiment group number.
- Provide instructions to prospective participants and collect relevant information through a questionnaire.
Wait for responses to come in and then proceed with the following step, about 7 days before the planned activity.
- Download Microsoft Forms Intake as Excel file and place it under
djangosite/forms - Modify
intake.py,credentials.py, andouttake.pyto reference the Excel file and contain correct details for date, location, experiment group, etc. docker compose exec django /venv/bin/python3 manage.py intake
The last command will send emails to all participants with their username, some general instructions, and a link to the instruction lecture video.
At the start of the workshop, run the following command to send out credentials to all registered users, enabling them to access the platform for the first time.
docker compose exec django /venv/bin/python3 manage.py credentials
At the end of the workshop, you can run the following command to make the scores on the hidden tests visible to all users, and inform them about the outtake questionnaire.
docker compose exec django /venv/bin/python3 manage.py outtake
To generate datasets for research from the data collected in the back-end, you can follow the following procedure.
- Download Microsoft Forms Lecture and Outtake as Excel files and place them under
djangosite/forms - Make modifications in
djangosite/main/management/commands/analyze.pyanddjangosite/main/grading.pyto work with the questions asked in the questionnaire if different. docker compose exec django /venv/bin/python3 manage.py analyze
Running this command will generate the datasets described in the next section.
The datasets collected as part of the research describing rule engineering processes can be found in djangosite/dumps. The files in this directory correspond to the processes of the 60 participants recruited for this study. The subfolder called pilot contains the data corresponding to the experts recruited from the collaborating SOC in an identical format.
For both groups, the dataset consists of 5 .parquet files, each representing a table (i.e., that you could load into a relational database). Each participant is associated with zero or more rules. Each valid rule that is submitted is associated with several results, describing outcomes on the tests available for the associated scenario. Updates represent changes between consecutively submitted rules by the same user for the same scenario. One update may consist of multiple changes, representing implementation-level modifications that we isolated.
Parquet files can be loaded using pandas.read_parquet() or similar tools. The analysis.ipynb notebook can be used as an elaborate example of how to process these files.
The analysis of the dataset was performed using the analysis.ipynb notebook using the dependency versions specified in requirements.txt.
The notebook allows for fully replicating all numbers and figures that describe these datasets contained in our manuscript.