abusing-dpapi-for-cred…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Parse Microsoft Outlook PST and OST files using libpff and pst-utils to extract message content, headers, attachments, deleted items, and MAPI metadata, including recovery of items from the Recoverable Items folder. Use when conducting email forensic investigations, legal
Claude Code
$ npx -y skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics --agent claude-code
Codex
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a codex -y
Cursor
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a cursor -y
Gemini CLI
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a gemini-cli -y
GitHub Copilot
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a github-copilot -y
OpenCode
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a opencode -y
Windsurf
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics -a windsurf -y
name: analyzing-outlook-pst-for-email-forensics description: Parse Microsoft Outlook PST and OST files using libpff and pst-utils to extract message content, headers, attachments, deleted items, and MAPI metadata, including recovery of items from the Recoverable Items folder. Use when conducting email forensic investigations, legal e-discovery, or incident response that requires reconstructing communication patterns or tracing message routing from Outlook archives. domain: cybersecurity subdomain: digital-forensics tags: - email-forensics - pst - ost - outlook - mapi - email-headers - attachments - deleted-emails - libpff - eml-extraction version: '1.0' author: mahipal license: Apache-2.0 nist_ai_rmf: - MANAGE-2.4 - MANAGE-3.1 - MEASURE-3.1 nist_csf: - RS.AN-03 - DE.AE-02 - RS.MA-01 mitre_attack: - T1114.001 - T1564.008 - T1070.008
Microsoft Outlook PST (Personal Storage Table) and OST (Offline Storage Table) files are critical evidence sources in digital forensics investigations. PST files store email messages, calendar events, contacts, tasks, and notes in a proprietary binary format based on the MAPI (Messaging Application Programming Interface) property system. Forensic analysis of these files enables recovery of deleted emails (from the Recoverable Items folder), extraction of email headers for tracing message routes, analysis of attachments for malware or exfiltrated data, and reconstruction of communication patterns. Modern PST files use Unicode format with 4KB pages and can grow up to 50GB, while legacy ANSI format is limited to 2GB.
| Source | Path | |--------|------| | Outlook 2016+ Default | %USERPROFILE%\Documents\Outlook Files\*.pst | | Outlook Legacy | %LOCALAPPDATA%\Microsoft\Outlook\*.pst | | OST Cache | %LOCALAPPDATA%\Microsoft\Outlook\*.ost | | Archive | %USERPROFILE%\Documents\Outlook Files\archive.pst |
# Export all items from PST file pffexport -m all evidence.pst -t exported_pst # Export only email messages pffexport -m items evidence.pst -t exported_emails # Export recovered/deleted items pffexport -m recovered evidence.pst -t recovered_items # Get PST file information pffinfo evidence.pst
import pypff
import os
import json
import hashlib
import email
import sys
from datetime import datetime
from collections import defaultdict
class PSTForensicAnalyzer:
"""Forensic analysis of Outlook PST/OST files."""
def __init__(self, pst_path: str, output_dir: str):
self.pst_path = pst_path
self.output_dir = output_dir
os.makedirs(output_dir, exist_ok=True)
self.pst = pypff.file()
self.pst.open(pst_path)
self.messages = []
self.attachments = []
self.stats = defaultdict(int)
def process_folder(self, folder, folder_path: str = ""):
"""Recursively process PST folders and extract messages."""
folder_name = folder.name or "Root"
current_path = f"{folder_path}/{folder_name}" if folder_path else folder_name
for i in range(folder.number_of_sub_messages):
try:
message = folder.get_sub_message(i)
msg_data = self.extract_message(message, current_path)
if msg_data:
self.messages.append(msg_data)
self.stats["total_messages"] += 1
except Exception as e:
self.stats["parse_errors"] += 1
for i in range(folder.number_of_sub_folders):
try:
subfolder = folder.get_sub_folder(i)
self.process_folder(subfolder, current_path)
except Exception:
continue
def extract_message(self, message, folder_path: str) -> dict:
"""Extract forensic metadata from a single email message."""
msg_data = {
"folder": folder_path,
"subject": message.subject or "",
"sender": message.sender_name or "",
"sender_email": "",
"creation_time": str(message.creation_time) if message.creation_time else None,
"delivery_time": str(message.delivery_time) if message.delivery_time else None,
"modification_time": str(message.modification_time) if message.modification_time else None,
"has_attachments": message.number_of_attachments > 0,
"attachment_count": message.number_of_attachments,
"body_size": len(message.plain_text_body or b""),
"html_size": len(message.html_body or b""),
}
# Extract transport headers for routing analysis
headers = message.transport_headers
if headers:
msg_data["headers_present"] = True
msg_data["headers_size"] = len(headers)
# Parse key headers
parsed = email.message_from_string(headers)
msg_data["from_header"] = parsed.get("From", "")
msg_data["to_header"] = parsed.get("To", "")
msg_data["date_header"] = parsed.get("Date", "")
msg_data["message_id"] = parsed.get("Message-ID", "")
msg_data["x_originating_ip"] = parsed.get("X-Originating-IP", "")
msg_data["received_headers"] = parsed.get_all817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platforms · 29 security domains · Apache 2.0
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials)…
Prepare a defense-contractor environment for CMMC Level 2 certification: scope CUI and FCI, implement the 110 NIST SP 800-171 Rev…
Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence…
Detect dangerous ACL misconfigurations in Active Directory using ldap3
Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…
Vercel AI SDK patterns for the installed major (ui/package.json: `ai` 6.x, `@ai-sdk/react` 3.x). The skill name is historical;…