[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADR9RH9BB6RXBGWEBS7RPZ":3,"skill-same:01M6ADR9RH9BB6RXBGWEBS7RPZ":129},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":72,"commitSha":73,"skillDirectory":74,"forksCount":75,"repositoryHtmlUrl":76,"repositoryHomepageUrl":77,"ownerHtmlUrl":78,"ownerBlogUrl":79,"ownerDescription":80,"updatedAt":81,"install":82,"resources":95},"01M6ADR9RH9BB6RXBGWEBS7RPZ","analyzing-outlook-pst-for-email-forensics","Outlook PST 邮件取证分析","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.","使用 libpff 和 pst-utils 解析 Microsoft Outlook PST 和 OST 文件，提取邮件内容、邮件头、附件、已删除项目及 MAPI 元数据，包括从“可恢复项目”（Recoverable Items）文件夹中恢复项目。适用于电子邮件取证调查、法律电子发现（e-discovery），或需要重建通信模式、追踪邮件路由的事件响应场景。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"analyzing outlook pst for email forensics","email","forensics","analyzing","pst","eml-extraction","libpff","deleted-emails","attachments","email-headers","mapi","outlook","ost","cybersecurity","email-forensics","tracing","communication","routing","microsoft","incident response","2026-11-10 10:12:30",false,"---\nname: analyzing-outlook-pst-for-email-forensics\ndescription: 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.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- email-forensics\n- pst\n- ost\n- outlook\n- mapi\n- email-headers\n- attachments\n- deleted-emails\n- libpff\n- eml-extraction\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_ai_rmf:\n- MANAGE-2.4\n- MANAGE-3.1\n- MEASURE-3.1\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1114.001\n- T1564.008\n- T1070.008\n---\n\n# Analyzing Outlook PST for Email Forensics\n\n## Overview\n\nMicrosoft 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.\n\n\n## When to Use\n\n- When investigating security incidents that require analyzing outlook pst for email forensics\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- libpff\u002Fpffexport (open-source PST parser)\n- Python 3.8+ with pypff or libratom libraries\n- MailXaminer, Forensic Email Collector, or SysTools PST Forensics (commercial)\n- Microsoft Outlook (optional, for native PST access)\n- Sufficient disk space for extracted content\n\n## PST File Locations\n\n| Source | Path |\n|--------|------|\n| Outlook 2016+ Default | %USERPROFILE%\\Documents\\Outlook Files\\*.pst |\n| Outlook Legacy | %LOCALAPPDATA%\\Microsoft\\Outlook\\*.pst |\n| OST Cache | %LOCALAPPDATA%\\Microsoft\\Outlook\\*.ost |\n| Archive | %USERPROFILE%\\Documents\\Outlook Files\\archive.pst |\n\n## Analysis with Open-Source Tools\n\n### libpff \u002F pffexport\n\n```bash\n# Export all items from PST file\npffexport -m all evidence.pst -t exported_pst\n\n# Export only email messages\npffexport -m items evidence.pst -t exported_emails\n\n# Export recovered\u002Fdeleted items\npffexport -m recovered evidence.pst -t recovered_items\n\n# Get PST file information\npffinfo evidence.pst\n```\n\n### Python PST Analysis\n\n```python\nimport pypff\nimport os\nimport json\nimport hashlib\nimport email\nimport sys\nfrom datetime import datetime\nfrom collections import defaultdict\n\n\nclass PSTForensicAnalyzer:\n    \"\"\"Forensic analysis of Outlook PST\u002FOST files.\"\"\"\n\n    def __init__(self, pst_path: str, output_dir: str):\n        self.pst_path = pst_path\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n        self.pst = pypff.file()\n        self.pst.open(pst_path)\n        self.messages = []\n        self.attachments = []\n        self.stats = defaultdict(int)\n\n    def process_folder(self, folder, folder_path: str = \"\"):\n        \"\"\"Recursively process PST folders and extract messages.\"\"\"\n        folder_name = folder.name or \"Root\"\n        current_path = f\"{folder_path}\u002F{folder_name}\" if folder_path else folder_name\n\n        for i in range(folder.number_of_sub_messages):\n            try:\n                message = folder.get_sub_message(i)\n                msg_data = self.extract_message(message, current_path)\n                if msg_data:\n                    self.messages.append(msg_data)\n                    self.stats[\"total_messages\"] += 1\n            except Exception as e:\n                self.stats[\"parse_errors\"] += 1\n\n        for i in range(folder.number_of_sub_folders):\n            try:\n                subfolder = folder.get_sub_folder(i)\n                self.process_folder(subfolder, current_path)\n            except Exception:\n                continue\n\n    def extract_message(self, message, folder_path: str) -> dict:\n        \"\"\"Extract forensic metadata from a single email message.\"\"\"\n        msg_data = {\n            \"folder\": folder_path,\n            \"subject\": message.subject or \"\",\n            \"sender\": message.sender_name or \"\",\n            \"sender_email\": \"\",\n            \"creation_time\": str(message.creation_time) if message.creation_time else None,\n            \"delivery_time\": str(message.delivery_time) if message.delivery_time else None,\n            \"modification_time\": str(message.modification_time) if message.modification_time else None,\n            \"has_attachments\": message.number_of_attachments > 0,\n            \"attachment_count\": message.number_of_attachments,\n            \"body_size\": len(message.plain_text_body or b\"\"),\n            \"html_size\": len(message.html_body or b\"\"),\n        }\n\n        # Extract transport headers for routing analysis\n        headers = message.transport_headers\n        if headers:\n            msg_data[\"headers_present\"] = True\n            msg_data[\"headers_size\"] = len(headers)\n            # Parse key headers\n            parsed = email.message_from_string(headers)\n            msg_data[\"from_header\"] = parsed.get(\"From\", \"\")\n            msg_data[\"to_header\"] = parsed.get(\"To\", \"\")\n            msg_data[\"date_header\"] = parsed.get(\"Date\", \"\")\n            msg_data[\"message_id\"] = parsed.get(\"Message-ID\", \"\")\n            msg_data[\"x_originating_ip\"] = parsed.get(\"X-Originating-IP\", \"\")\n            msg_data[\"received_headers\"] = parsed.get_all(\"Received\", [])\n\n        # Process attachments\n        for j in range(message.number_of_attachments):\n            try:\n                attachment = message.get_attachment(j)\n                att_data = {\n                    \"message_subject\": msg_data[\"subject\"],\n                    \"name\": attachment.name or f\"attachment_{j}\",\n                    \"size\": attachment.size,\n                    \"content_type\": \"\",\n                }\n                self.attachments.append(att_data)\n                self.stats[\"total_attachments\"] += 1\n            except Exception:\n                continue\n\n        return msg_data\n\n    def save_attachments(self, max_size_mb: int = 100):\n        \"\"\"Export attachments to disk for analysis.\"\"\"\n        att_dir = os.path.join(self.output_dir, \"attachments\")\n        os.makedirs(att_dir, exist_ok=True)\n\n        root = self.pst.get_root_folder()\n        self._save_attachments_recursive(root, att_dir, max_size_mb)\n\n    def _save_attachments_recursive(self, folder, att_dir, max_size_mb):\n        for i in range(folder.number_of_sub_messages):\n            try:\n                message = folder.get_sub_message(i)\n                for j in range(message.number_of_attachments):\n                    att = message.get_attachment(j)\n                    if att.size and att.size \u003C max_size_mb * 1024 * 1024:\n                        name = att.name or f\"unknown_{i}_{j}\"\n                        safe_name = \"\".join(c if c.isalnum() or c in \".-_\" else \"_\" for c in name)\n                        path = os.path.join(att_dir, safe_name)\n                        try:\n                            data = att.read_buffer(att.size)\n                            with open(path, \"wb\") as f:\n                                f.write(data)\n                        except Exception:\n                            continue\n            except Exception:\n                continue\n\n        for i in range(folder.number_of_sub_folders):\n            try:\n                self._save_attachments_recursive(folder.get_sub_folder(i), att_dir, max_size_mb)\n            except Exception:\n                continue\n\n    def generate_report(self) -> str:\n        \"\"\"Generate comprehensive PST forensic analysis report.\"\"\"\n        root = self.pst.get_root_folder()\n        self.process_folder(root)\n\n        report = {\n            \"analysis_timestamp\": datetime.now().isoformat(),\n            \"pst_file\": self.pst_path,\n            \"pst_size_bytes\": os.path.getsize(self.pst_path),\n            \"statistics\": dict(self.stats),\n            \"messages\": self.messages[:500],\n            \"attachments\": self.attachments[:200],\n        }\n\n        report_path = os.path.join(self.output_dir, \"pst_forensic_report.json\")\n        with open(report_path, \"w\") as f:\n            json.dump(report, f, indent=2, default=str)\n\n        print(f\"[*] Total messages: {self.stats['total_messages']}\")\n        print(f\"[*] Total attachments: {self.stats['total_attachments']}\")\n        print(f\"[*] Parse errors: {self.stats['parse_errors']}\")\n        return report_path\n\n    def close(self):\n        self.pst.close()\n\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: python process.py \u003Cpst_file> \u003Coutput_dir>\")\n        sys.exit(1)\n    analyzer = PSTForensicAnalyzer(sys.argv[1], sys.argv[2])\n    analyzer.generate_report()\n    analyzer.close()\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Email Header Analysis\n\nKey headers for forensic investigation:\n\n| Header | Forensic Value |\n|--------|---------------|\n| Received | Message routing chain (read bottom to top) |\n| X-Originating-IP | Sender's actual IP address |\n| Message-ID | Unique identifier for correlation |\n| Date | Send timestamp |\n| Return-Path | Bounce address (may differ from From) |\n| DKIM-Signature | Domain authentication signature |\n| Authentication-Results | SPF, DKIM, DMARC verification results |\n| X-Mailer | Email client used |\n\n## References\n\n- MailXaminer PST Forensics: https:\u002F\u002Fwww.mailxaminer.com\u002Fblog\u002Foutlook-pst-file-forensics\u002F\n- libpff Documentation: https:\u002F\u002Fgithub.com\u002Flibyal\u002Flibpff\n- PST File Format Specification: https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fopenspecs\u002Foffice_file_formats\u002Fms-pst\u002F\n- SANS Email Forensics: https:\u002F\u002Fwww.sans.org\u002Fblog\u002Femail-forensics\u002F\n\n## Example Output\n\n```text\n$ pffexport \u002Fevidence\u002Fjsmith_archive.pst -t \u002Fanalysis\u002Fpst_output\n\npffexport 20231205 - libpff PST\u002FOST Export Tool\n=================================================\nInput: \u002Fevidence\u002Fjsmith_archive.pst (2.3 GB)\n\nExporting PST contents...\n  Folders:       45\n  Messages:      12,456\n  Attachments:   3,234\n  Contacts:      567\n  Calendar:      234\n  Tasks:         89\n\nExport completed in 3m 42s.\n\n$ python3 pst_analyzer.py \u002Fanalysis\u002Fpst_output \u002Fanalysis\u002Femail_report\n\nPST Forensic Analysis Report\n==============================\nSource: jsmith_archive.pst (john.smith@corporate.com)\nDate Range: 2023-06-01 to 2024-01-18\n\n--- Mailbox Statistics ---\n  Total Emails:       12,456\n  Sent:               4,567\n  Received:           7,889\n  With Attachments:   3,234\n  Deleted (recovered): 234\n\n--- Phishing \u002F Suspicious Emails ---\nEmail #8923\n  Date:        2024-01-15 14:30:22 UTC\n  From:        \"IT Support\" \u003Cit-support@c0rporate-help.com>\n  To:          john.smith@corporate.com\n  Subject:     Urgent: Password Reset Required\n  Headers:\n    Return-Path:    bounce@mail-relay.c0rporate-help.com\n    X-Originating-IP: 203.0.113.55\n    Received:       from mail-relay.c0rporate-help.com (203.0.113.55)\n    SPF:            FAIL (domain c0rporate-help.com)\n    DKIM:           NONE\n    DMARC:          FAIL\n  Attachments:\n    - Password_Reset_Form.xlsm (245 KB) SHA-256: 7a3b8c9d...e1f2a3b4\n  Body Preview:  \"Dear Employee, Your password will expire in 24 hours.\n                  Please open the attached form to reset your credentials...\"\n\n--- Data Exfiltration Indicators ---\nEmail #9102\n  Date:        2024-01-16 03:15:45 UTC\n  From:        john.smith@corporate.com\n  To:          j.smith.personal8842@protonmail.com\n  Subject:     (no subject)\n  Attachments:\n    - archive_part1.7z (24.5 MB) - encrypted\n    - archive_part2.7z (24.5 MB) - encrypted\n\nEmail #9103\n  Date:        2024-01-16 03:18:22 UTC\n  From:        john.smith@corporate.com\n  To:          j.smith.personal8842@protonmail.com\n  Subject:     Re:\n  Attachments:\n    - archive_part3.7z (18.2 MB) - encrypted\n\n--- Keyword Hits ---\n  \"confidential\":     45 emails\n  \"password\":         23 emails\n  \"transfer\":         12 emails\n  \"resign\":           3 emails\n  \"delete evidence\":  1 email (Email #9200, 2024-01-17 22:30:00 UTC)\n\nSummary:\n  Phishing emails detected:    1 (initial compromise vector)\n  Suspicious sent emails:      5 (to personal accounts with attachments)\n  Encrypted attachments:       3 (67.2 MB total - possible exfiltration)\n  Report: \u002Fanalysis\u002Femail_report\u002Fpst_forensic_report.json\n```\n","# Analyzing Outlook PST for Email Forensics\n\n## Overview\n\nMicrosoft 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.\n\n\n## When to Use\n\n- When investigating security incidents that require analyzing outlook pst for email forensics\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- libpff\u002Fpffexport (open-source PST parser)\n- Python 3.8+ with pypff or libratom libraries\n- MailXaminer, Forensic Email Collector, or SysTools PST Forensics (commercial)\n- Microsoft Outlook (optional, for native PST access)\n- Sufficient disk space for extracted content\n\n## PST File Locations\n\n| Source | Path |\n|--------|------|\n| Outlook 2016+ Default | %USERPROFILE%\\Documents\\Outlook Files\\*.pst |\n| Outlook Legacy | %LOCALAPPDATA%\\Microsoft\\Outlook\\*.pst |\n| OST Cache | %LOCALAPPDATA%\\Microsoft\\Outlook\\*.ost |\n| Archive | %USERPROFILE%\\Documents\\Outlook Files\\archive.pst |\n\n## Analysis with Open-Source Tools\n\n### libpff \u002F pffexport\n\n```bash\n# Export all items from PST file\npffexport -m all evidence.pst -t exported_pst\n\n# Export only email messages\npffexport -m items evidence.pst -t exported_emails\n\n# Export recovered\u002Fdeleted items\npffexport -m recovered evidence.pst -t recovered_items\n\n# Get PST file information\npffinfo evidence.pst\n```\n\n### Python PST Analysis\n\n```python\nimport pypff\nimport os\nimport json\nimport hashlib\nimport email\nimport sys\nfrom datetime import datetime\nfrom collections import defaultdict\n\n\nclass PSTForensicAnalyzer:\n    \"\"\"Forensic analysis of Outlook PST\u002FOST files.\"\"\"\n\n    def __init__(self, pst_path: str, output_dir: str):\n        self.pst_path = pst_path\n        self.output_dir = output_dir\n        os.makedirs(output_dir, exist_ok=True)\n        self.pst = pypff.file()\n        self.pst.open(pst_path)\n        self.messages = []\n        self.attachments = []\n        self.stats = defaultdict(int)\n\n    def process_folder(self, folder, folder_path: str = \"\"):\n        \"\"\"Recursively process PST folders and extract messages.\"\"\"\n        folder_name = folder.name or \"Root\"\n        current_path = f\"{folder_path}\u002F{folder_name}\" if folder_path else folder_name\n\n        for i in range(folder.number_of_sub_messages):\n            try:\n                message = folder.get_sub_message(i)\n                msg_data = self.extract_message(message, current_path)\n                if msg_data:\n                    self.messages.append(msg_data)\n                    self.stats[\"total_messages\"] += 1\n            except Exception as e:\n                self.stats[\"parse_errors\"] += 1\n\n        for i in range(folder.number_of_sub_folders):\n            try:\n                subfolder = folder.get_sub_folder(i)\n                self.process_folder(subfolder, current_path)\n            except Exception:\n                continue\n\n    def extract_message(self, message, folder_path: str) -> dict:\n        \"\"\"Extract forensic metadata from a single email message.\"\"\"\n        msg_data = {\n            \"folder\": folder_path,\n            \"subject\": message.subject or \"\",\n            \"sender\": message.sender_name or \"\",\n            \"sender_email\": \"\",\n            \"creation_time\": str(message.creation_time) if message.creation_time else None,\n            \"delivery_time\": str(message.delivery_time) if message.delivery_time else None,\n            \"modification_time\": str(message.modification_time) if message.modification_time else None,\n            \"has_attachments\": message.number_of_attachments > 0,\n            \"attachment_count\": message.number_of_attachments,\n            \"body_size\": len(message.plain_text_body or b\"\"),\n            \"html_size\": len(message.html_body or b\"\"),\n        }\n\n        # Extract transport headers for routing analysis\n        headers = message.transport_headers\n        if headers:\n            msg_data[\"headers_present\"] = True\n            msg_data[\"headers_size\"] = len(headers)\n            # Parse key headers\n            parsed = email.message_from_string(headers)\n            msg_data[\"from_header\"] = parsed.get(\"From\", \"\")\n            msg_data[\"to_header\"] = parsed.get(\"To\", \"\")\n            msg_data[\"date_header\"] = parsed.get(\"Date\", \"\")\n            msg_data[\"message_id\"] = parsed.get(\"Message-ID\", \"\")\n            msg_data[\"x_originating_ip\"] = parsed.get(\"X-Originating-IP\", \"\")\n            msg_data[\"received_headers\"] = parsed.get_all(\"Received\", [])\n\n        # Process attachments\n        for j in range(message.number_of_attachments):\n            try:\n                attachment = message.get_attachment(j)\n                att_data = {\n                    \"message_subject\": msg_data[\"subject\"],\n                    \"name\": attachment.name or f\"attachment_{j}\",\n                    \"size\": attachment.size,\n                    \"content_type\": \"\",\n                }\n                self.attachments.append(att_data)\n                self.stats[\"total_attachments\"] += 1\n            except Exception:\n                continue\n\n        return msg_data\n\n    def save_attachments(self, max_size_mb: int = 100):\n        \"\"\"Export attachments to disk for analysis.\"\"\"\n        att_dir = os.path.join(self.output_dir, \"attachments\")\n        os.makedirs(att_dir, exist_ok=True)\n\n        root = self.pst.get_root_folder()\n        self._save_attachments_recursive(root, att_dir, max_size_mb)\n\n    def _save_attachments_recursive(self, folder, att_dir, max_size_mb):\n        for i in range(folder.number_of_sub_messages):\n            try:\n                message = folder.get_sub_message(i)\n                for j in range(message.number_of_attachments):\n                    att = message.get_attachment(j)\n                    if att.size and att.size \u003C max_size_mb * 1024 * 1024:\n                        name = att.name or f\"unknown_{i}_{j}\"\n                        safe_name = \"\".join(c if c.isalnum() or c in \".-_\" else \"_\" for c in name)\n                        path = os.path.join(att_dir, safe_name)\n                        try:\n                            data = att.read_buffer(att.size)\n                            with open(path, \"wb\") as f:\n                                f.write(data)\n                        except Exception:\n                            continue\n            except Exception:\n                continue\n\n        for i in range(folder.number_of_sub_folders):\n            try:\n                self._save_attachments_recursive(folder.get_sub_folder(i), att_dir, max_size_mb)\n            except Exception:\n                continue\n\n    def generate_report(self) -> str:\n        \"\"\"Generate comprehensive PST forensic analysis report.\"\"\"\n        root = self.pst.get_root_folder()\n        self.process_folder(root)\n\n        report = {\n            \"analysis_timestamp\": datetime.now().isoformat(),\n            \"pst_file\": self.pst_path,\n            \"pst_size_bytes\": os.path.getsize(self.pst_path),\n            \"statistics\": dict(self.stats),\n            \"messages\": self.messages[:500],\n            \"attachments\": self.attachments[:200],\n        }\n\n        report_path = os.path.join(self.output_dir, \"pst_forensic_report.json\")\n        with open(report_path, \"w\") as f:\n            json.dump(report, f, indent=2, default=str)\n\n        print(f\"[*] Total messages: {self.stats['total_messages']}\")\n        print(f\"[*] Total attachments: {self.stats['total_attachments']}\")\n        print(f\"[*] Parse errors: {self.stats['parse_errors']}\")\n        return report_path\n\n    def close(self):\n        self.pst.close()\n\n\ndef main():\n    if len(sys.argv) \u003C 3:\n        print(\"Usage: python process.py \u003Cpst_file> \u003Coutput_dir>\")\n        sys.exit(1)\n    analyzer = PSTForensicAnalyzer(sys.argv[1], sys.argv[2])\n    analyzer.generate_report()\n    analyzer.close()\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Email Header Analysis\n\nKey headers for forensic investigation:\n\n| Header | Forensic Value |\n|--------|---------------|\n| Received | Message routing chain (read bottom to top) |\n| X-Originating-IP | Sender's actual IP address |\n| Message-ID | Unique identifier for correlation |\n| Date | Send timestamp |\n| Return-Path | Bounce address (may differ from From) |\n| DKIM-Signature | Domain authentication signature |\n| Authentication-Results | SPF, DKIM, DMARC verification results |\n| X-Mailer | Email client used |\n\n## References\n\n- MailXaminer PST Forensics: https:\u002F\u002Fwww.mailxaminer.com\u002Fblog\u002Foutlook-pst-file-forensics\u002F\n- libpff Documentation: https:\u002F\u002Fgithub.com\u002Flibyal\u002Flibpff\n- PST File Format Specification: https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fopenspecs\u002Foffice_file_formats\u002Fms-pst\u002F\n- SANS Email Forensics: https:\u002F\u002Fwww.sans.org\u002Fblog\u002Femail-forensics\u002F\n\n## Example Output\n\n```text\n$ pffexport \u002Fevidence\u002Fjsmith_archive.pst -t \u002Fanalysis\u002Fpst_output\n\npffexport 20231205 - libpff PST\u002FOST Export Tool\n=================================================\nInput: \u002Fevidence\u002Fjsmith_archive.pst (2.3 GB)\n\nExporting PST contents...\n  Folders:       45\n  Messages:      12,456\n  Attachments:   3,234\n  Contacts:      567\n  Calendar:      234\n  Tasks:         89\n\nExport completed in 3m 42s.\n\n$ python3 pst_analyzer.py \u002Fanalysis\u002Fpst_output \u002Fanalysis\u002Femail_report\n\nPST Forensic Analysis Report\n==============================\nSource: jsmith_archive.pst (john.smith@corporate.com)\nDate Range: 2023-06-01 to 2024-01-18\n\n--- Mailbox Statistics ---\n  Total Emails:       12,456\n  Sent:               4,567\n  Received:           7,889\n  With Attachments:   3,234\n  Deleted (recovered): 234\n\n--- Phishing \u002F Suspicious Emails ---\nEmail #8923\n  Date:        2024-01-15 14:30:22 UTC\n  From:        \"IT Support\" \u003Cit-support@c0rporate-help.com>\n  To:          john.smith@corporate.com\n  Subject:     Urgent: Password Reset Required\n  Headers:\n    Return-Path:    bounce@mail-relay.c0rporate-help.com\n    X-Originating-IP: 203.0.113.55\n    Received:       from mail-relay.c0rporate-help.com (203.0.113.55)\n    SPF:            FAIL (domain c0rporate-help.com)\n    DKIM:           NONE\n    DMARC:          FAIL\n  Attachments:\n    - Password_Reset_Form.xlsm (245 KB) SHA-256: 7a3b8c9d...e1f2a3b4\n  Body Preview:  \"Dear Employee, Your password will expire in 24 hours.\n                  Please open the attached form to reset your credentials...\"\n\n--- Data Exfiltration Indicators ---\nEmail #9102\n  Date:        2024-01-16 03:15:45 UTC\n  From:        john.smith@corporate.com\n  To:          j.smith.personal8842@protonmail.com\n  Subject:     (no subject)\n  Attachments:\n    - archive_part1.7z (24.5 MB) - encrypted\n    - archive_part2.7z (24.5 MB) - encrypted\n\nEmail #9103\n  Date:        2024-01-16 03:18:22 UTC\n  From:        john.smith@corporate.com\n  To:          j.smith.personal8842@protonmail.com\n  Subject:     Re:\n  Attachments:\n    - archive_part3.7z (18.2 MB) - encrypted\n\n--- Keyword Hits ---\n  \"confidential\":     45 emails\n  \"password\":         23 emails\n  \"transfer\":         12 emails\n  \"resign\":           3 emails\n  \"delete evidence\":  1 email (Email #9200, 2024-01-17 22:30:00 UTC)\n\nSummary:\n  Phishing emails detected:    1 (initial compromise vector)\n  Suspicious sent emails:      5 (to personal accounts with attachments)\n  Encrypted attachments:       3 (67.2 MB total - possible exfiltration)\n  Report: \u002Fanalysis\u002Femail_report\u002Fpst_forensic_report.json\n```\n",{"name":5,"tags":56,"author":57,"domain":44,"license":16,"version":58,"nist_csf":59,"subdomain":63,"description":7,"nist_ai_rmf":64,"mitre_attack":68},[45,35,43,42,41,40,39,38,37,36],"mahipal","1.0",[60,61,62],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[65,66,67],"MANAGE-2.4","MANAGE-3.1","MEASURE-3.1",[69,70,71],"T1114.001","T1564.008","T1070.008","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fanalyzing-outlook-pst-for-email-forensics",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":83,"prompt":93,"zipAvailable":94},[84,87,90],{"tool":85,"command":86},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics",{"tool":88,"command":89},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics",{"tool":91,"command":92},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-outlook-pst-for-email-forensics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002FSKILL.md",true,[96,101,107,111,115,119,125],{"path":97,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002FLICENSE",{"path":102,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":105,"sourceHtmlUrl":106},"package.json","REFERENCE","参考文档",790,"https:\u002F\u002Fgithub.com\u002Fnodetool-ai\u002Fnodetool\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-game\u002Fpackage.json",{"path":108,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fapi-reference.md",2566,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002Freferences\u002Fapi-reference.md",{"path":112,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fstandards.md",634,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002Freferences\u002Fstandards.md",{"path":116,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fworkflows.md",397,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002Freferences\u002Fworkflows.md",{"path":120,"resourceType":121,"resourceTypeDesc":122,"sizeBytes":123,"sourceHtmlUrl":124},"sandbox\u002Findex.js","SCRIPT","脚本",9948,"https:\u002F\u002Fgithub.com\u002Fnodetool-ai\u002Fnodetool\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-game\u002Fsandbox\u002Findex.js",{"path":126,"resourceType":121,"resourceTypeDesc":122,"sizeBytes":127,"sourceHtmlUrl":128},"scripts\u002Fagent.py",5996,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-outlook-pst-for-email-forensics\u002Fscripts\u002Fagent.py",[130,161,190,222,252,284],{"skillNo":131,"name":132,"nameZh":133,"description":134,"descriptionZh":135,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":136,"categories":137,"keywords":142,"publishedAt":51},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[138,139],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":140,"categoryName":141,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[143,144,145,146,147,44,50,148,149,150,151,152,153,154,155,156,157,158,159,160],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":162,"name":163,"nameZh":164,"description":165,"descriptionZh":166,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":167,"categories":168,"keywords":173,"publishedAt":51},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[169,170],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":171,"categoryName":172,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[174,157,175,176,147,177,44,149,178,179,180,181,182,183,184,185,186,187,188,189],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":191,"name":192,"nameZh":193,"description":194,"descriptionZh":195,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":196,"categories":197,"keywords":204,"publishedAt":51},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[198,201],{"categoryNo":199,"categoryName":200,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":202,"categoryName":203,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[184,205,206,207,208,44,209,210,178,211,212,213,214,215,216,217,218,219,220,221],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":223,"name":224,"nameZh":225,"description":226,"descriptionZh":227,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":228,"categories":229,"keywords":234,"publishedAt":51},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[230,231],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":232,"categoryName":233,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[235,236,237,44,238,239,240,241,242,243,244,245,246,247,63,248,181,249,250,251],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","SET","collection","pecmd","artifact-collection",{"skillNo":253,"name":254,"nameZh":255,"description":256,"descriptionZh":257,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":258,"categories":259,"keywords":264,"publishedAt":51},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[260,263],{"categoryNo":261,"categoryName":262,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[265,266,267,44,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":285,"name":286,"nameZh":287,"description":288,"descriptionZh":289,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":290,"categories":291,"keywords":294,"publishedAt":51},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[292,293],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[147,295,44,296,297,298,299,300,301,302,303,217,304,218,305,306,307,308,309,310],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]