0xreversed/with.ai
File formatsWorksSource available
Target: Cisco Packet Tracer

Packet Tracer pka/pkt reverse engineered to fully build, export, or decrypt without running Packet Tracer

by aacanadaa Repository0 views

Evidence at a glance

Based on the linked sources. The author's reported result and independent confirmation are separate checks.

AI involvement
Reported models: Twofish, Serpent, CAST-256. Tools: Python 3.10+, libgcrypt20, GDB, Xvfb. The writeup below describes the work attributed to AI.
Reported result
Works. This is the directory's source-based outcome classification.
Independent confirmation
Not reported.
Human work and limitations
The project uses a combination of static analysis and dynamic debugging (using GDB and Xvfb) to reverse-engineer the file format. It emphasizes reproducibility, suggesting that users verify builds by performing them twice and diffing the resulting XML output.

What was done

This project reverse-engineers the encrypted Cisco Packet Tracer file format, enabling offline lab creation, decryption, and byte-exact reconstruction without requiring the Packet Tracer application.

This project provides a suite of tools to reverse-engineer and interact with Cisco Packet Tracer .pkt and .pka files. The author reports that the project enables the creation of labs and activities entirely offline, without requiring the Packet Tracer application to be installed. The reverse engineering process involved static analysis of the PacketTracer binary to identify encryption primitives, including Twofish in EAX mode, and the implementation of a byte-exact codec. The codec handles the container structure, which includes a pre-encryption wrapper involving byte reversal and position-based XOR, followed by zlib compression. The project includes a type-safe library, pkt_core, which allows for the decoding and encoding of these files. The author notes that the library is designed to be lossless, preserving original source bytes for elements that are not modified. The project also includes auditing tools to validate lab configurations and check for duplicate service instances. The author documents that while the codec is byte-exact for 1,058 real containers, certain device names are rejected by Packet Tracer 9.0.1, and some configurations require careful handling of raw control bytes such as Cisco banner delimiters. Source

Reproduce it

setup
Use the provided Python library `pkt_core` or the CLI tools. For example, to decode a file: `python3 pt9.py decode my_lab.pkt -o my_lab.xml`. To verify reproducibility, build the lab twice and compare the XML output using `diff`.