Skip to content
Skillpedia
Analysis & spreadsheets35k · #5478

analyzing-outlook-pst-for-email-forensics

Helps your agent extract information from Outlook email files. It's useful for forensic investigations and recovering deleted messages.

What it does

This tool helps investigate and extract information from Outlook email files (.pst and .ost). It can recover deleted emails, analyze headers to trace message routes, and examine attachments.

When to use it

  • ✓When investigating security incidents involving emails.
  • ✓When needing to recover emails that have been deleted.
  • ✓When analyzing how an email message traveled across the internet.

Example of what to ask your AI

“Analyze this PST file to find emails sent between John and Mary in the last month.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-outlook-pst-for-email-forensics/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/analyzing-outlook-pst-for-email-forensics/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses specific programs (like libpff) to read .pst and .ost files. It separates and organizes emails, attachments, and other information within these files for easier analysis.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/analyzing-outlook-pst-for-email-forensics/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Analyzing Outlook PST for Email Forensics

Overview

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.

When to Use

  • When investigating security incidents that require analyzing outlook pst for email forensics
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • libpff/pffexport (open-source PST parser)
  • Python 3.8+ with pypff or libratom libraries
  • MailXaminer, Forensic Email Collector, or SysTools PST Forensics (commercial)
  • Microsoft Outlook (optional, for native PST access)
  • Sufficient disk space for extracted content

PST File Locations

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

Analysis with Open-Source Tools

libpff / pffexport

# 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

Python PST Analysis

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""),
        }


…
FAQ

What are PST and OST files?

These are files used by Microsoft Outlook to store emails, contacts, calendars, and other data. PST is for local storage, and OST is for an offline copy of Exchange accounts.

Can I use this tool if I don't have Outlook installed?

Yes, the tool works directly on PST and OST files, even without Outlook installed, by using analysis libraries.

Does the tool recover permanently deleted emails?

Yes, it can recover emails that were moved to the 'Recoverable Items' folder or were more deeply deleted.

Details

Original description by the author

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 a

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5478
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills