This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
Every machine leaves a trace. Some tell a story.
When a computer or cloud server is compromised, attackers don't just disappearβthey leave behind faint digital apparitions: dozens of failed authentication attempts in the dead of night, an unusual sudo session opened by a low-privileged account, a sudden backdoor user added to /etc/passwd, and an attempt to erase audit logs.
To seasoned SOC tier-3 analysts, these logs tell an obvious story. But for junior developers, sysadmins, and small open-source teams without dedicated security personnel, raw logs are intimidating walls of cryptic text. Existing SIEM tools will throw alerts, but reconstructing what happened, when it happened, and how the adversary navigated the system is agonizingly difficult.
PhantomTrace is an offline, privacy-first AI digital forensics investigator that resurrects suspicious system activity and conducts an autonomous digital autopsy.
Instead of another chatbot that writes Halloween ghost stories, PhantomTrace interprets the "Ghost in the Machine" theme through real-world cybersecurity:
http://localhost:5173
ghost_backdoor) -> crontab persistence. SeDebugPrivilege elevation -> PsExec remote execution -> wevtutil log clearing.
The entire codebase is open-source under the MIT License:
Hacktoberfest-Week4/
βββ backend/
β βββ main.py # FastAPI backend with CORS, streaming, & REST endpoints
β βββ detector.py # Deterministic threat engine (MITRE ATT&CK mapping & scoring)
β βββ ollama_client.py # Ollama local LLM connector + Zero-fail offline DFIR engine
β βββ report_generator.py # Publication-ready PDF (ReportLab) & JSON export
β βββ samples.py # Pre-loaded multi-stage attack scenarios
β βββ requirements.txt # Pure Python dependencies (FastAPI, uvicorn, reportlab)
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ Navbar.tsx # Case status, Ghost Score pill, & engine indicator
β β β βββ SOCDashboard.tsx # Metrics, Recharts attack vectors, & alert feed
β β β βββ EvidenceScanner.tsx # 1-click scenario , file upload, & raw log paste
β β β βββ GhostTimeline.tsx # Chronological attack graph with MITRE tactic tags
β β β βββ AIChatInvestigator.tsx# Grounded forensic investigator chat with prompt chips
β β β βββ ForensicReport.tsx # Official DFIR report, IOC table, & 1-click PDF export
β β β βββ HauntedTerminal.tsx # Retro CRT cyber terminal with real-time digital autopsy
β β βββ types.ts # TypeScript interfaces for all data structures
β β βββ App.tsx # Central state & scenario orchestrator
β β βββ index.css # Cyber-obsidian & spectral emerald theme
β βββ package.json
β βββ vite.config.ts
βββ samples/ # Standalone raw sample logs
βββ run.bat # 1-Click Windows launcher
βββ README.md # Architecture, installation, & judge guide
You can clone and run it with one command:
git clone https://github.com/balabhadra3141/Hacktoberfest-Week4.git
cd Hacktoberfest-Week4
.\run.bat # Or `cd backend && uvicorn main:app` and `cd frontend && npm run dev`
PhantomTrace combines a deterministic rule pipeline with local open-weight AI inference:
System Logs (Linux / Windows / Web)
β
βΌ
βββββββββββββββββββββββββββββ
β Log Normalization & β
β Deterministic Rules β βββ Regex Threat Engine (MITRE T1110, T1548, etc.)
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β Ghost Timeline Rebuilder β βββ Chronological Attack Sequences
βββββββββββββββ¬ββββββββββββββ
β
ββββββββββββββ΄βββββββββββββ
βΌ βΌ
ββββββββββββββββββββ βββββββββββββββββββββββββββ
β Local LLM β β Grounded Fallback β
β (Ollama/Qwen2.5) β OR β Offline Forensic Agent β (100% Free / Zero Setup)
ββββββββββ¬ββββββββββ ββββββββββββββ¬βββββββββββββ
β β
βββββββββββββββ¬ββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
ββββββββββββββββ βββββββββββββββ βββββββββββββββββ
β SOC Console β β AI Chat Q&A β β PDF / JSON β
β & Terminal β β Investigatorβ β Report Export β
ββββββββββββββββ βββββββββββββββ βββββββββββββββββ
A major risk in AI cybersecurity is hallucinationβan LLM imagining an attack or inventing a fake IP address.
PhantomTrace solves this through a two-stage pipeline:
detector.py uses high-speed regex pattern matching to parse Linux syslog/auth.log, Windows EVTX-exported events, and Web server access logs. It identifies confirmed threat indicators (SSH brute force, sudo elevation, rogue accounts) and tags them with official T1110.001, T1548.003, T1136.001, T1070.001).
PhantomTrace connects directly to a locally hosted Ollama instance (http://127.0.0.1:11434) using open-weight models such as qwen2.5:3b or llama3.2.
Built with React 19, TypeScript, Tailwind CSS, and Recharts:
In digital forensics and cybersecurity, open innovation is not just a preferenceβit is a non-negotiable architectural requirement.
System logs contain some of the most sensitive data an organization possesses: private IP architectures, internal hostnames, user credentials, failed passwords, and command histories.
Sending raw production authentication logs to a proprietary, cloud-hosted closed API (like OpenAI or Anthropic) violates compliance standards (GDPR, HIPAA, SOC 2) and actively creates a new data-exfiltration risk.
With open-weight models and Ollama, PhantomTrace operates completely offline. You can disconnect your ethernet cable, turn off Wi-Fi, and run an in-depth forensic investigation on an air-gapped laptop in a data center.
Closed AI APIs are black boxes that can change, deprecate models, or alter safety guardrails overnight. In forensic investigations where evidence might be presented in court or an insurance audit, you need predictable, auditable, deterministic inference. Open-source models can be versioned, inspected, fine-tuned, and verified locally.
Small startups, non-profits, independent developers, and open-source maintainers cannot afford enterprise SIEM subscriptions that charge thousands of dollars per gigabyte of ingested logs. PhantomTrace proves that open-source AI and deterministic engineering can give anyone an enterprise-grade digital forensic investigator for $0.
This entire applicationβfrom backend threat rules and Ollama integration to the React dashboard, timeline graph, and PDF report generatorβwas developed through an agentic pair-programming session with Antigravity.
The workflow:
The moment this project truly came alive was when we tested the Haunted Terminal Mode on the Linux Server Breach dataset:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHANTOMTRACE FORENSIC KERNEL v1.0.0-HACKTOBERFEST β
β Every machine leaves a trace. Some tell a story. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[*] [PHANTOMTRACE] Initializing Spectral Memory Extraction...
[*] Probing kernel ring buffer and forensic event journals...
[*] Captured 14 spirit traces across system bus.
[!] DANGER: Detected 5 paranormal security deviations!
[!] Spectral Origin Located: Foreign IP entity `198.51.100.42` manifesting on port 22.
[>] Trace #1: SSH Brute Force Attack (5 attempts) [T1110.001]
β³ Whisper: Detected 5 failed authentication attempts originating from IP 198.51.100.42.
[π] THE GHOST BREACHED THE GATE: Authentication barrier collapsed!
[π] GHOST ELEVATION: The entity possessed root UID 0 permissions!
[π] PHANTOM RESIDUE: Adversary left a rogue soul in the user registry!
[*] Forensic timeline sealed. Digital autopsy complete.
Watching cryptic log lines transform into a coherent, gripping narrativeβnot as fictional fantasy, but as an accurate, MITRE-mapped autopsy of a real cyber incursionβmade it clear: AI doesn't just need to generate text; it can give eyes and ears to systems that were previously silent.
Built with β€οΈ for Hacktoberfest 2026. Every machine leaves a trace. Some tell a story. π»