An automated pipeline to translate raw, heterogeneous honeypot logs into standardized MITRE CAPEC attack patterns. Log2CAPEC leverages a Large Language Model for semantic interpretation and a hybrid retrieval engine (semantic + keyword) for accurate, context-aware mapping of cyber threats.
Python
0
6 commits
updated Jan 4, 2026
An automated end-to-end pipeline to translate raw, heterogeneous honeypot logs into standardized MITRE CAPEC attack patterns. Log2CAPEC leverages a Large Language Model for semantic interpretation and a hybrid retrieval engine (semantic + keyword with Reciprocal Rank Fusion) for accurate, context-aware mapping of cyber threats.
Security log analysis is critical for threat intelligence, but security teams are often overwhelmed by a "data deluge." Multi-honeypot platforms like TPOT generate a massive volume of raw and heterogeneous data (SSH session logs, network scans, emulated service interactions, etc.), making manual analysis impractical.
This project addresses three core challenges:
Log2CAPEC is an end-to-end pipeline that automates the interpretation and mapping of honeypot logs. Its innovative approach is based on three key methodological contributions:
ATT&CK-BERT embeddings) and a lexical search (using TF-IDF), ensuring a robust and accurate final ranking.Mistral-7B-Instruct-v0.2 with contextual prompt engineering for high-level analysis.ATT&CK-BERT with the term precision of TF-IDF.The architecture is a modular pipeline that transforms raw data into structured knowledge.
This project is developed in Python 3.10+ and relies on a rich ecosystem of open-source libraries.
pandas: For reading and handling the CSV log dataset.nltk, spacy: For lemmatization, POS tagging, and stopword removal.torch, transformers (Hugging Face): For loading and running the model.bitsandbytes, accelerate: For 4-bit quantization of the mistralai/Mistral-7B-Instruct-v0.2 model.sentence-transformers: To generate embeddings with the basel/ATT&CK-BERT model.chromadb: As the vector database for efficient semantic search.scikit-learn: For the TF-IDF model implementation.Follow these steps to set up the environment and run the project.
1. Clone the Repository
git clone https://github.com/your-username/Log2CAPEC.git
cd Log2CAPEC
2. Create a Virtual Environment (Recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate```
**3. Install Dependencies**
This project requires several large libraries. Ensure your `pip` is up to date.
```bash
pip install -r requirements.txt
4. Download NLP Models
The first time you run the script, it will automatically download the necessary models for spacy and nltk.
5. Prepare the Data
CAPEC.xml.HONEYPOT_CSV_FILE variable in the script (e.g., tpot_less.csv).To run the full analysis pipeline, execute the main script from the project root:
Log2CAPEC.py
The script will perform the following steps:
Log2CAPEC/
β
βββ Log2CAPEC.py # Main script to run the entire pipeline
βββ requirements.txt # Python dependency list
βββ CAPEC.xml # MITRE CAPEC catalog file
βββ tpot_less.csv # Example honeypot log dataset
βββ LICENSE # Project license file (MIT)
βββ README.md # This file
Contributions are welcome! If you have ideas for improvements, bug fixes, or new features, please feel free to:
This project is released under the MIT License. See the LICENSE file for more details.
If you use this code or methodology in your research, please cite the following thesis:
@mastersthesis{Gregori2025Log2CAPEC,
author = {Daniele Gregori},
title = {Semantic Analysis and Hybrid Mapping of Honeypot Logs to CAPEC Attack Patterns via Large Language Models},
school = {University of Salerno},
year = {2025},
month = {MM}, % Replace with the month of defense
type = {Master's Thesis in Computer Science}
}
An automated pipeline to translate raw, heterogeneous honeypot logs into standardized MITRE CAPEC attack patterns. Log2CAPEC leverages a Large Language Model for semantic interpretation and a hybrid retrieval engine (semantic + keyword) for accurate, context-aware mapping of cyber threats.
Python
0
6 commits
updated Jan 4, 2026
An automated end-to-end pipeline to translate raw, heterogeneous honeypot logs into standardized MITRE CAPEC attack patterns. Log2CAPEC leverages a Large Language Model for semantic interpretation and a hybrid retrieval engine (semantic + keyword with Reciprocal Rank Fusion) for accurate, context-aware mapping of cyber threats.
Security log analysis is critical for threat intelligence, but security teams are often overwhelmed by a "data deluge." Multi-honeypot platforms like TPOT generate a massive volume of raw and heterogeneous data (SSH session logs, network scans, emulated service interactions, etc.), making manual analysis impractical.
This project addresses three core challenges:
Log2CAPEC is an end-to-end pipeline that automates the interpretation and mapping of honeypot logs. Its innovative approach is based on three key methodological contributions:
ATT&CK-BERT embeddings) and a lexical search (using TF-IDF), ensuring a robust and accurate final ranking.Mistral-7B-Instruct-v0.2 with contextual prompt engineering for high-level analysis.ATT&CK-BERT with the term precision of TF-IDF.The architecture is a modular pipeline that transforms raw data into structured knowledge.
This project is developed in Python 3.10+ and relies on a rich ecosystem of open-source libraries.
pandas: For reading and handling the CSV log dataset.nltk, spacy: For lemmatization, POS tagging, and stopword removal.torch, transformers (Hugging Face): For loading and running the model.bitsandbytes, accelerate: For 4-bit quantization of the mistralai/Mistral-7B-Instruct-v0.2 model.sentence-transformers: To generate embeddings with the basel/ATT&CK-BERT model.chromadb: As the vector database for efficient semantic search.scikit-learn: For the TF-IDF model implementation.Follow these steps to set up the environment and run the project.
1. Clone the Repository
git clone https://github.com/your-username/Log2CAPEC.git
cd Log2CAPEC
2. Create a Virtual Environment (Recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate```
**3. Install Dependencies**
This project requires several large libraries. Ensure your `pip` is up to date.
```bash
pip install -r requirements.txt
4. Download NLP Models
The first time you run the script, it will automatically download the necessary models for spacy and nltk.
5. Prepare the Data
CAPEC.xml.HONEYPOT_CSV_FILE variable in the script (e.g., tpot_less.csv).To run the full analysis pipeline, execute the main script from the project root:
Log2CAPEC.py
The script will perform the following steps:
Log2CAPEC/
β
βββ Log2CAPEC.py # Main script to run the entire pipeline
βββ requirements.txt # Python dependency list
βββ CAPEC.xml # MITRE CAPEC catalog file
βββ tpot_less.csv # Example honeypot log dataset
βββ LICENSE # Project license file (MIT)
βββ README.md # This file
Contributions are welcome! If you have ideas for improvements, bug fixes, or new features, please feel free to:
This project is released under the MIT License. See the LICENSE file for more details.
If you use this code or methodology in your research, please cite the following thesis:
@mastersthesis{Gregori2025Log2CAPEC,
author = {Daniele Gregori},
title = {Semantic Analysis and Hybrid Mapping of Honeypot Logs to CAPEC Attack Patterns via Large Language Models},
school = {University of Salerno},
year = {2025},
month = {MM}, % Replace with the month of defense
type = {Master's Thesis in Computer Science}
}