Skip to content

Commit 85b08f9

Browse files
committed
fix: update README and exfiltration guide for Python version and script names
1 parent 5a963d9 commit 85b08f9

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,25 @@ flowchart TB
129129
- **Docker** & **Docker Compose**
130130
- Linux / macOS (or WSL2 for Windows)
131131
- At least **4 GB RAM**
132+
- **Python 3.12.3**
133+
- **All exposed ports are accessible**
134+
135+
### ⚠️ Python packages
136+
137+
**Make sure to install all of the requirements.txt packages in python virtual environment.**
138+
139+
**Make sure to activate the virtual environment before running any Python scripts.**
140+
141+
**When you are in any directory that uses Python scripts and you want to run a script outside of a container, make sure to activate the virtual environment first and check that the packages are installed.**
142+
143+
**In case of error make sure you are using the same Python version as specified in the Prerequisites section as this toolkit has NOT been tested with other versions.**
144+
132145

133146
### Installation
134147
```bash
135148
# 1. Clone repository
136149
git clone git@github.com:AdamLBS/DohExfTlk.git
137-
cd DoHExfTlk
150+
cd DohExfTlk
138151

139152
# 2. Download the dataset's CSVs used for the model training (l1-benign.csv & l2-malicious.csv)
140153
wget http://cicresearch.ca/CICDataset/DoHBrw-2020/Dataset/CSVs/Total_CSVs.zip
@@ -147,6 +160,7 @@ chmod +x generate_certs.sh
147160
./generate_certs.sh
148161

149162
# 3. Start infrastructure
163+
docker compose build
150164
docker compose up -d
151165
```
152166

@@ -164,6 +178,7 @@ docker exec -it client_test bash /scripts/test_doh.sh
164178
```bash
165179
# Train model
166180
cd ml_analyzer
181+
# python3 can be used if python is not found
167182
python -m venv .venv
168183
source .venv/bin/activate
169184
pip install -r requirements.txt
@@ -213,11 +228,12 @@ bash run_pipeline.sh
213228
### Training Phase
214229
```bash
215230
cd ml_analyzer
216-
python3 trainer.py --quick --fpr 0.01
231+
python3 model_trainer.py --quick --fpr 0.01
217232
# Models saved in /models/
218233
```
219234

220235
### Detection & Classification Phase
236+
Theses commands are automatically executed by the pipeline, but can be used manually if needed.
221237
```bash
222238
# 1. Analyze traffic with DoHLyzer
223239
# 2. Filter detected queries
@@ -251,20 +267,23 @@ python config_generator.py --list
251267
```json
252268
{
253269
"name": "APT Simulation",
270+
"description": "APT Simulation",
254271
"exfiltration_config": {
255272
"doh_server": "https://doh.local/dns-query",
256-
"target_domain": "update-service.local",
273+
"target_domain": "exfill.local",
257274
"chunk_size": 8,
258275
"encoding": "base32",
259276
"timing_pattern": "random",
260277
"base_delay": 30.0,
261-
"encryption": true,
262-
"domain_rotation": true,
263-
"backup_domains": [
264-
"security-updates.local",
265-
"maintenance-api.local"
266-
]
267-
}
278+
"delay_variance": 15.0,
279+
"compression": true,
280+
"encryption": false,
281+
"subdomain_randomization": false,
282+
"domain_rotation": false,
283+
"padding": true,
284+
"padding_size": 20
285+
},
286+
"notes": "APT Simulation"
268287
}
269288
```
270289

docs/exfiltration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bash scripts/run_pipeline.sh
2828
- One subfolder per config, containing:
2929
- `logs/client.log` & `logs/predictor_*.log`
3030
- `captured/*.only_*.csv` (filtered flows used by the predictor)
31-
- **ML scripts:** `ml_analyzer/trainer.py`, `ml/predictor.py`
31+
- **ML scripts:** `ml_analyzer/model_trainer.py`, `ml_analyzer/predictor.py`
3232

3333
---
3434

@@ -93,7 +93,7 @@ Best (least detected): stealth_burst — 3.23% — model: logistic_regression
9393

9494
## Minimal troubleshooting
9595
- **No filtered CSV found**: ensure the traffic actually hit `/dns-query` and the filter script path is correct (`IN_CONTAINER_FILTER_SCRIPT`).
96-
- **Predictor says no models**: train first (`ml_analyzer/trainer.py`), then re‑run pipeline.
96+
- **Predictor says no models**: train first (`ml_analyzer/model_trainer.py`), then re‑run pipeline.
9797
- **TLS errors**: for quick tests use `curl -k` or import the generated CA into your lab machine.
9898
- **Ranking empty**: check per‑config `logs/predictor_*.log` for model sections.
9999

0 commit comments

Comments
 (0)