Skip to content

Commit e568a89

Browse files
committed
add new parsers, new web interface, offline mode
1 parent 8672871 commit e568a89

26 files changed

+1959
-1594
lines changed

Docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt update -y && \
1717
apt install -y libguestfs-tools && \
1818
apt install -y zip && \
1919
apt install -y openssl && \
20+
#apt install -y pff-tools && \
2021
apt clean -y && \
2122
rm -rf /var/cache/apt/* /var/lib/apt/lists/*
2223

@@ -26,5 +27,6 @@ ENV HOME=/root
2627
COPY . .
2728
RUN pip3 install --upgrade pip --break-system-packages
2829
RUN pip install -r requirements.txt --break-system-packages
30+
RUN pip install src/bin/libpff_python-20240826-cp311-cp311-linux_x86_64.whl --break-system-packages
2931
EXPOSE 8080
3032
CMD ["python3", "triage.py"]

Docker/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
context: ..
66
dockerfile: Docker/Dockerfile
77
image: pytriage:x.x.x
8-
container_name: pytriage-preprod
8+
container_name: pytriage
99
volumes:
1010
- /data/hayabusa:/hayabusa
1111
- /data:/data
@@ -39,5 +39,5 @@ services:
3939
- /winlogbeat:/winlogbeat
4040
- /var/run/docker.sock:/var/run/docker.sock
4141
redis:
42-
image: redis:7.2.5
42+
image: dockerhub.cert.lan/redis:7.2.5
4343

README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,13 @@ Le serveur de triage a pour but d'automatiser le traitement des collectes effect
99
Actuellement, le serveur de triage effectue le traitements des collectes suivantes :
1010

1111
- KAPE / DFIR-ORC / GENERAPTOR Windows
12-
- Génération d'une timeline Plaso
13-
- Copie des EVTX sur le partage `VM-WINLOG\winlogbeat` pour indexation par winlogbeat
14-
- Parsing des EVTX et envoi vers ELK
15-
- Envoi des timelines Plaso au serveur Timesketch
16-
- Traitement des logs IIS
17-
- Parsing MFT
18-
- Parsing USNJrnl
19-
- Parsing Registres (amcache, system, software, ntuser...)
20-
- Parsing prefetch
21-
- Parsing MPLog
22-
- Parsing Windows10 Timeline (ActivitiesCache)
23-
- Parsing $Recycle.Bin
24-
2512
- HAYABUSA
26-
- Exécution de Hayabusa sur les EVTX présents dans les collectes Kape, DFIR-ORC et Generaptor (ne s'exécute pas seul mais avec l'un des trois précédents)
2713
- UAC / GENERAPTOR Linux
28-
- Indexation Filebeat des logs Linux
29-
- Génération d'une timeline Plaso
3014
- ADTIMELINE
31-
- Traitement de CSV (envoi vers ELK)
3215
- VOLATILITY Windows
33-
- PSLIST vers ELK
34-
- PSTREE vers ELK
35-
- NETSCAN vers ELK
36-
- NETSTAT vers ELK
3716
- DFIR-O365RC
38-
- Parsing fichiers générés et envoi vers ELK
3917
- ADAUDIT
40-
- Traitement de CSV (envoi vers ELK)
41-
18+
- MAIL (pst/mbox)
4219

4320
## Fonctionnement
4421

@@ -180,6 +157,11 @@ Les résultats générés sont parsés et envoyés à ELK.
180157

181158
L'archive envoyée est dézippée et les fichiers json présents sont parsés puis envoyés à ELK.
182159

160+
#### Mail
161+
> Ce plugin s'exécute sur les fichiers PST et MBOX. Le fichier d'entrée est une archive ZIP contenant ces fichiers.
162+
163+
L'archive envoyée est dézippée et les fichiers PST/MBOX présents sont parsés puis envoyés à ELK. Une option est proposée pour récupérer ou non les pièces-jointes des mails.
164+
183165

184166
### Standalone
185167

@@ -265,6 +247,7 @@ class Plugin(BasePlugin):
265247
* [Orc-decrypt](https://github.com/DFIR-ORC/orc-decrypt)
266248
* [Mplog-parser](https://github.com/Intrinsec/mplog_parser)
267249
* [USN-Journal-Parser](https://github.com/PoorBillionaire/USN-Journal-Parser)
250+
* [Mail parsers](https://github.com/Intrinsec/mplog_parser)
268251

269252
### Images Docker
270253

@@ -277,6 +260,13 @@ class Plugin(BasePlugin):
277260
Le serveur de triage est déployé comme un service docker.
278261

279262

263+
### Configuration
264+
265+
La configuration est présente dans le fichier **config/triage.yaml**.
266+
267+
Il est possible d'activer ou non les connexions aux services tiers Timesketch, ELK et Winlogbeat.
268+
269+
280270
### Prérequis
281271

282272
Créer les dossiers **data**, **winlogbeat**, **log** et **hayabusa** si non présents (chemin à renseigner dans les fichiers docker-compose-build/prod.yml et dans config/triage.yaml *volumes => data* qui est le volume hôte à monter donc ici ./data)
@@ -286,7 +276,8 @@ mkdir ./winlogbeat
286276
mkdir ./log
287277
mkdir ./hayabusa
288278
```
289-
Monter le partage winlogbeat dans le dossier ci-dessus et placer le binaire hayabusa et ses dépendances dans le dossier **hayabusa**.
279+
- Monter le partage winlogbeat dans le dossier précédement créé
280+
- Placer le binaire hayabusa et ses dépendances dans le dossier précédement créé
290281

291282
Générer les certificats SSL
292283

@@ -309,4 +300,4 @@ Le service web est disponible sur https://localhost
309300

310301
# Contributors
311302

312-
* [A-lvu](https://github.com/a-lvu)
303+
* [xx](https://github.com/xx)

config/triage.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
general:
22
upload: /data
3-
winlogbeat: /winlogbeat
43
logfolder: /log
5-
timesketch_url: ""
6-
elastic_url: ""
7-
elastic_port: 9200
8-
logstash_url: ""
9-
kibana_url: ""
104
hayabusa_bin_path: "/hayabusa/hayabusa"
115

126
pipelines:
@@ -21,14 +15,28 @@ pipelines:
2115
orc: 5067
2216
filebeat: 5058
2317
selfassessment: 5050
18+
mail: 5061
2419

2520
administration:
2621
Timesketch:
22+
active: false
23+
url: "https://xxx"
2724
username: xxx
2825
password: xxx
2926
Elastic:
27+
active: false
28+
url: "https://xxx"
29+
port: 9200
3030
username: xxx
3131
password: xxx
32+
Logstash:
33+
active: false
34+
url: "https://xxx"
35+
Kibana:
36+
url: "https://xxx"
37+
Winlogbeat:
38+
active: false
39+
folder: /winlogbeat
3240

3341
volumes:
3442
data: /data

docs/images/plugin_kape.png

14.3 KB
Loading

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,6 @@ flower==2.0.1
8787
redis==4.3.4
8888
docker==7.1.0
8989
ujson==5.10.0
90-
pytsk3==20231007
90+
pytsk3==20231007
91+
mailbox==0.4
92+
libpff-python==20231205

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def generate_entry_points():
2525

2626
setup(
2727
name="pytriage",
28-
version="1.0.0",
28+
version="2.0.0",
2929
description="A modern Python-3-based triage service",
3030
long_description="""SYNETIS Triage service
3131
""",

src/__init__.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,40 @@ def __init__(self, config=None):
1616

1717
internal_config = triageutils.INTERNAL_CONFIG
1818

19-
self.timesketch_url = internal_config["general"]["timesketch_url"]
20-
self.elastic_url = internal_config["general"]["elastic_url"]
21-
self.logstash_url = internal_config["general"]["logstash_url"]
22-
self.kibana_url = internal_config["general"]["kibana_url"]
19+
self.timesketch_url = internal_config["administration"]["Timesketch"]["url"]
20+
self.is_timesketch_active = internal_config["administration"]["Timesketch"][
21+
"active"
22+
]
23+
24+
self.elastic_url = internal_config["administration"]["Elastic"]["url"]
25+
self.is_elastic_active = internal_config["administration"]["Elastic"]["active"]
26+
27+
self.logstash_url = internal_config["administration"]["Logstash"]["url"]
28+
self.is_logstash_active = internal_config["administration"]["Logstash"][
29+
"active"
30+
]
31+
32+
self.kibana_url = internal_config["administration"]["Kibana"]["url"]
2333

2434
self.hayabusa_port = internal_config["pipelines"]["hayabusa"]
2535
self.adtimeline_port = internal_config["pipelines"]["adtimeline"]
2636
self.iis_port = internal_config["pipelines"]["iis"]
2737
self.evtxparser_port = internal_config["pipelines"]["evtxparser"]
2838
self.volatility_port = internal_config["pipelines"]["volatility"]
2939
self.o365_port = internal_config["pipelines"]["o365"]
40+
self.mail_port = internal_config["pipelines"]["mail"]
3041
self.raw_json_port = internal_config["pipelines"]["fortinet"]
3142
self.adaudit_port = internal_config["pipelines"]["adaudit"]
3243
self.filebeat_port = internal_config["pipelines"]["filebeat"]
3344
self.selfassessment_port = internal_config["pipelines"]["selfassessment"]
3445

3546
self.orc_port = internal_config["pipelines"]["orc"]
3647
self.hayabusa_bin_path = internal_config["general"]["hayabusa_bin_path"]
37-
self.winlogbeat = internal_config["general"]["winlogbeat"]
48+
49+
self.winlogbeat = internal_config["administration"]["Winlogbeat"]["folder"]
50+
self.is_winlogbeat_active = internal_config["administration"]["Winlogbeat"][
51+
"active"
52+
]
3853

3954
self.data_volume = internal_config["volumes"]["data"]
4055

1.76 MB
Binary file not shown.

0 commit comments

Comments
 (0)