pgtk is a C++20 toolkit for parsing and analyzing system provenance data. It supports input from sources like Sysmon EVTX logs and PCAP files, and generates graph representations for visualization, Prolog-based reasoning, and semantic graph analysis.
- Parse Windows Sysmon EVTX files
- Parse PCAP files using PcapPlusPlus
- Generate:
- Graphviz
.gvfiles - Prolog
.plfacts - RDF-like
.tsvtriples
- Graphviz
- Identify malicious activity using logic rules via SWI-Prolog
- C++20 compiler (GCC 10+, Clang 11+, MSVC 2019+)
- CMake ≥ 3.16
- SWI-Prolog installed system-wide (used at runtime)
- PcapPlusPlus and its dependencies:
libpcap/ WinPcap / npcaplibpthread,libssl,libcryptoif required
- Git (for cloning submodules)
git clone --recurse-submodules https://github.com/yourusername/pgtk.gitIf you already cloned the repo without --recurse-submodules, run:
git submodule update --init --recursivemkdir build
cd build
cmake ..
makeAfter building, run the tool and follow the interactive prompts:
./pgtk-appA PGTK directory is a folder containing provenance-related input files (EVTX logs and PCAP files) grouped by instance name. Each file's name should begin with an instance identifier (e.g., Target, APT37, router) to allow proper grouping and processing.
Example structure:
PGTK/
├── APT37.pcap
├── router.pcap
├── Target.evtx
└── Target.pcap
In this example:
-
The tool detects three instances:
APT37,router, andTarget. -
Files with the same prefix (
Target.evtx,Target.pcap) are combined into a single graph before analysis. -
Each instance produces:
instance.gv— Graphviz outputinstance.pl— Prolog factsinstance.tsv— Triplesinstance.malicious.*— Files representing malicious subgraphs
The instance name is automatically extracted from the filename by repeatedly stripping extensions (
.evtx,.pcap, etc.) from the basename. For example, the instance name related to the fileTestServer.abc.123.evtxisTestServer.
This project is licensed under the MIT License.
- PcapPlusPlus for packet parsing
- SWI-Prolog for the reasoning engine