GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ait-aecid/attack-manifestations-interpretation: Scripts to analyze the CAM-LDS using LLMs

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
state_diagrams
state_diagrams
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
attack_times.csv
attack_times.csv
 
 
count_identical_prompts.py
count_identical_prompts.py
 
 
create_llm_prompt.py
create_llm_prompt.py
 
 
create_llm_prompt_resample.py
create_llm_prompt_resample.py
 
 
extract_attack_logs.py
extract_attack_logs.py
 
 
get_llm_responses.py
get_llm_responses.py
 
 
get_statistics.py
get_statistics.py
 
 
labels.json
labels.json
 
 
llm_queries.json
llm_queries.json
 
 
llm_responses.json
llm_responses.json
 
 
mitre_matrix.json
mitre_matrix.json
 
 
requirements.txt
requirements.txt
 
 
timestampExtractor.py
timestampExtractor.py
 
 

Repository files navigation

LLM-based interpretation of cyber attack manifestations

This repository contains scripts to process and analyze the Cyber Attack Manifestations - Log Data Set (CAM-LDS) using LLMs.

If you use data or scripts from this repository, please cite the following publication:

  • M. Landauer, W. Hotwagner, T. Boenke, F. Skopik, M. Wurzenberger. 2026. CAM-LDS: Cyber Attack Manifestations for Automatic Interpretation of System Logs and Security Alerts. International Journal of Information Security, 25(5). [PDF]

Getting the data

We provide a data set of filtered attack manifestations online. Download and unzip it with the following commands:

wget https://zenodo.org/records/18390561/files/manifestations_filtered.zip
unzip manifestations_filtered.zip

In the manifestations_filtered directory you can find log data and security alerts generated by various cyber attacks. The manifestations are collected for single attack steps, sequences, and techniques. We recommend to focus on attack steps, since each step may be associated with multiple techniques and thus both sequences and techniques directories contain duplicated logs.

For example, Step 4 of Scenario 1 is a web scanning attack; check out our publication for state charts of all scenarios. You can find the logs corresponding to that attack step as follows:

head manifestations_filtered/steps/1_autostart_localaccount-4/videoserver/logs/access.log.2
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /tmp HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /components HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /forum HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /cgi-bin HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /profiles HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /objects HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /download HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /img HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /dyn HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"
192.42.1.174 - - [22/Sep/2025:18:31:35 +0000] "GET /include HTTP/1.1" 404 341 "-" "Fuzz Faster U Fool v2.1.0-dev"

Creating LLM Prompts

To create LLM prompts based on the log data in the manifestations_filtered/steps directory, use the following script. Using the displayed example, five prompts are generated per step by randomly selecting scenario variants. Note that log lines are sampled only once per scenario variant and step, meaning that selecting the same variant multiple times results in identical prompts rather than new random samples of log lines. Using this command together with the random seed of 42 reproduces the llm_queries.json file provided in this repository.

python3 create_llm_prompt.py --samples 5 --seed 42

Note that llm_queries.json was created from version 1 of the data set (record 18390561, as downloaded above). The latest version 2 (record 18861762) additionally contains audit events of runc init in the Docker audit.log files of steps 3, 6, 8, 10, and 13 of Scenario 7, which results in different prompts. Moreover, Path.rglob does not return the log files in a fixed order, so the prompts may also differ across file systems and Python versions; the provided file can be reproduced with Python 3.12 when the files are read in the order in which they are stored in the zip archive.

The generated prompts contain a general task description as well as the lines to be classified. An example could look like this:

You are a MITRE ATT&CK TTP classification expert. Your task is to classify the following system log data. You are provided with samples from one or more hosts and one or more log sources that are captured during execution of one specific MITRE ATT&CK technique. Always output a valid JSON object with the following fields:
 - "techniques": A list of top 10 ATT&CK techniques that are most likely related to the sample logs, sorted in descending order. Only print the ID of the techniques without any other descriptions.
 - "confidence": An estimate for the certainty that the logs indicate an actual attack rather than normal system or user activity. Provide one of the following estimates: "Certain: Attack", "Almost Certain: Attack", "Somewhat Certain: Attack", "Neutral", "Somewhat Certain: Normal", "Almost Certain: Normal", "Certain: Normal"
 - "explanation": A brief explanation (1-2 sentences) why you think that the samples correspond to attacks or normal behavior, e.g., by pointing to specific artifacts or properties of the logs.

videoserver:
  logs/access.log.1:
    192.42.1.174 - - [24/Sep/2025:07:51:33 +0000] "GET /zm/index.php HTTP/1.1" 200 8978 "-" "Mozilla/5.0"
    192.42.1.174 - - [24/Sep/2025:07:51:33 +0000] "POST /zm/index.php HTTP/1.1" 302 756 "-" "Mozilla/5.0"
  logs/log/audit/audit.log:
    type=SYSCALL msg=audit(1758700293.784:4701): arch=c000003e syscall=59 success=yes exit=0 a0=7fe4cb2e7152 a1=7ffc1def0bd0 a2=7ffc1def3878 a3=8 items=3 ppid=2948 pid=2977 auid=4294967295 uid=33 gid=33 euid=33 suid=33 fsuid=33 egid=33 sgid=33 fsgid=33 tty=(none) ses=4294967295 comm="sh" exe="/usr/bin/dash" subj==unconfined ARCH=x86_64 SYSCALL=execve AUID="unset" UID="www-data" GID="www-data" EUID="www-data" SUID="www-data" FSUID="www-data" EGID="www-data" SGID="www-data" FSGID="www-data"
    type=EXECVE msg=audit(1758700293.784:4701): argc=3 a0="sh" a1="-c" a2=2F7573722F62696E2F7A6D75202D4120202D61202D6D20303B736C6565702036

To create prompts with new random samples of log lines in every repetition, as described in Sect. 5.1.2 of the paper, use the following script instead. It works like create_llm_prompt.py and takes the same parameters, but samples the log lines again for each prompt of a step. Prompts of steps where no log file has more than ten lines may still be identical, since all lines are included in this case. This command will create the file llm_queries_resampled.json. Since get_llm_responses.py reads the prompts from llm_queries.json, add --output llm_queries.json to retrieve responses for the new prompts (this replaces the provided file).

python3 create_llm_prompt_resample.py --samples 5 --seed 42

Retrieving responses from an LLM

To query the LLM with the prompts generated in the previous section, use the following script. Note that you need to set your OPENROUTER_API_KEY before running this scipt.

python3 get_llm_responses.py

This command will create the file llm_responses.json. Each line in this file is a json object that includes information on the scenario, variant, and step of the attack chain, as well as the prompt, response, and ground truth labels.

Responses from the LLM include the predicted attack techniques for the log data, an estimation whether the logs correspond to benign or malicious behavior, and an explanation. An example could look like this:

"techniques": ["T1059.004", "T1190", "T1068", "T1105", "T1041", "T1071.001", "T1055", "T1036", "T1005", "T1043"],
"confidence": "Somewhat Certain: Attack",
"explanation": "Web access to ZoneMinder (/zm/index.php) is followed by auditd showing apache2 (www-data) spawning /bin/sh with a \"sh -c\" command, which is a strong indicator of command execution via a web application (likely exploitation). The proximity of the remote client IP to the PHP warning and the shell exec makes this more consistent with attacker-driven activity than normal web usage."

Computing classification accuracy

By comparing the predicted techniques with the ground truth labels, the classification accuracy can be estimated. The following script computes several metrics for accuracy and stability. For the provided repsonses from five LLMs, the following metrics are obtained.

python3 get_statistics.py

Extracted records: 4943
Candidate technique universe size: 216

Metrics by model_id
===================
model_id                                      | n_records | top1_accuracy | top5_accuracy | top10_accuracy | mrr      | weighted_mrr_by_num_gt | precision_at_1 | recall_at_1 | precision_at_5 | recall_at_5 | precision_at_10 | recall_at_10
----------------------------------------------+-----------+---------------+---------------+----------------+----------+------------------------+----------------+-------------+----------------+-------------+-----------------+-------------
meta-llama/llama-4-maverick-17b-128e-instruct | 990       | 0.256566      | 0.386869      | 0.446465       | 0.312486 | 0.324001               | 0.256566       | 0.204545    | 0.082020       | 0.320603    | 0.050101        | 0.374165
mistralai/ministral-3b-2512                   | 983       | 0.100712      | 0.160732      | 0.166836       | 0.123780 | 0.127580               | 0.100712       | 0.080875    | 0.032350       | 0.133944    | 0.016785        | 0.139369
openai/gpt-5.2-20251211                       | 990       | 0.404040      | 0.601010      | 0.650505       | 0.486855 | 0.502444               | 0.404040       | 0.322727    | 0.132727       | 0.514595    | 0.075051        | 0.570992
openai/gpt-5.5-20260423                       | 990       | 0.418182      | 0.608081      | 0.671717       | 0.503596 | 0.546148               | 0.418182       | 0.330199    | 0.133737       | 0.518467    | 0.078182        | 0.585237
qwen/qwen3-32b-04-28                          | 990       | 0.160606      | 0.254545      | 0.309091       | 0.199830 | 0.206520               | 0.160606       | 0.133333    | 0.052121       | 0.206728    | 0.031818        | 0.250317
__random_baseline__                           | 4943      | 0.006677      | 0.032926      | 0.064964       | 0.019254 | 0.028697               | 0.006677       | 0.004634    | 0.006659       | 0.023170    | 0.006654        | 0.046325

Inter-run stability
===================
model_id                                      | n_repeated_steps | percent_steps_all_runs_same_top1 | average_pairwise_top1_agreement | fleiss_kappa_top1 | average_stdev_first_correct_rank_penalty
----------------------------------------------+------------------+----------------------------------+---------------------------------+-------------------+-----------------------------------------
meta-llama/llama-4-maverick-17b-128e-instruct | 198              | 0.681818                         | 0.829293                        | 0.805499          | 0.319110
mistralai/ministral-3b-2512                   | 198              | 0.363636                         | 0.589899                        | 0.367866          | 0.207533
openai/gpt-5.2-20251211                       | 198              | 0.555556                         | 0.750000                        | 0.735404          | 0.456134
openai/gpt-5.5-20260423                       | 198              | 0.590909                         | 0.745960                        | 0.734673          | 0.503411
qwen/qwen3-32b-04-28                          | 198              | 0.141414                         | 0.387879                        | 0.333481          | 0.819178

Clarification regarding the stability results in our paper: The paper refers to generating prompts "with new random samples of log lines." However, log lines are sampled only once per scenario variant and attack step, and reused whenever the same variant is selected. Consequently, the five repetitions resulted in identical prompts for 89 of the 198 attack steps, while prompts varied for the remaining 109 steps. This distinction is important when interpreting the Same-Top-1 stability results: for identical prompts, the metric reflects run-to-run consistency rather than robustness to different log samples. In particular, Llama-4's higher overall stability compared to GPT-5.5 (68.2% vs. 59.1%) is entirely attributable to the identical-prompt subset (83.1% vs. 62.9%), whereas both models achieve 56.0% on steps with varying prompts.

The numbers in this clarification can be reproduced with the following script. It counts the distinct prompts of each attack step in llm_queries.json, uses the log files in manifestations_filtered/steps (if available) to check whether a new sample could have resulted in different log lines, and computes Same-Top-1 separately for steps with identical and with varying prompts in llm_responses.json. Use --queries llm_queries_resampled.json to check prompts created with create_llm_prompt_resample.py, and --csv <file> to write the results for each step to a file.

python3 count_identical_prompts.py

Prompt file: llm_queries.json
Steps: 198, prompts: 990, distinct prompts: 393
Distinct prompts per step: 1: 89, 2: 51, 3: 36, 4: 16, 5: 6
Steps with as many distinct prompts as distinct variants selected: 198
Steps with identical prompts in all repetitions: 89
  logs from a single scenario variant: 86
  all log files of the selected variant have at most 10 lines: 21
  at least one log file of the selected variant has more than 10 lines: 68

Same-Top-1 per model (llm_responses.json)
model_id                                      | all steps       | identical prompts | varying prompts
meta-llama/llama-4-maverick-17b-128e-instruct | 135/198 (68.2%) | 74/89 (83.1%)     | 61/109 (56.0%)
mistralai/ministral-3b-2512                   | 72/198 (36.4%)  | 33/89 (37.1%)     | 39/109 (35.8%)
openai/gpt-5.2-20251211                       | 110/198 (55.6%) | 53/89 (59.6%)     | 57/109 (52.3%)
openai/gpt-5.5-20260423                       | 117/198 (59.1%) | 56/89 (62.9%)     | 61/109 (56.0%)
qwen/qwen3-32b-04-28                          | 28/198 (14.1%)  | 14/89 (15.7%)     | 14/109 (12.8%)

Reproducing the data set: Extraction of attack manifestations (optional)

The filtered attack manifestations are based on log data collected from multiple simulation runs. We recommend to just use the filtered manifestations as described in the previous sections; however, we also provide the script used to generate these manifestations.

First, you need to download the logs collected from all simulation runs from our Zenodo page and store them in a directory called data/scenario<id> within this respository (you need to create these folders). For example, for the simulations in Scenario 2, the following files should exist:

data/scenario2/scenario_2_cron
data/scenario2/scenario_2_rootkit

Note that filtering is based on the normal behavior activities observed in all of the available scenarios; therefore the resulting manifestations may differ if not all 34 simulation runs (18 from Scenario 1, 2 from Scenario 2, 6 from Scenario 3, 1 from Scenario 4, 1 from Scenario 5, 5 from Scenario 6, and 1 from Scenario 7) are in their respective directories. Then, run the following command to extract the attack manifestations - this command will generate the manifestations_filtered and manifestations_raw folders.

python3 extract_attack_logs.py

Besides the manifestations, the script creates the files labels.json and attack_times.csv provided in this repository. attack_times.csv lists the start and end times (Unix timestamps) of the attack steps together with their techniques and tactics. Note that in rows with more than one technique (203 of the 904 rows), the tactics column concatenates the tactics of the individual techniques without separator, e.g., reconnaissancereconnaissance for the techniques T1590.002_T1591, while tactics of the same technique are separated by _. The tactics of each technique are available in the metadata field of the corresponding entry in labels.json (key <scenario>-<event_id>). The technique_names column is not filled (NA).

Citation

If you use data or scripts from this repository, please cite the following publication:

  • M. Landauer, W. Hotwagner, T. Boenke, F. Skopik, M. Wurzenberger. 2026. CAM-LDS: Cyber Attack Manifestations for Automatic Interpretation of System Logs and Security Alerts. International Journal of Information Security, 25(5). [PDF]

About

Scripts to analyze the CAM-LDS using LLMs

Topics

attack-classificationattack-manifestationscyber-attacksintrusion-detectionllm-interpretationlog-analysislog-datasecurity-alerts

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

7 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.