AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Analyzing Email Headers For Phishing Investigation

skill-killvxk-cybersecurity-skills-zh-analyzing-email-headers-for-phishing-investigation · by killvxk

解析和分析电子邮件头部以追踪钓鱼邮件的来源,通过 SPF、DKIM 和 DMARC 验证来核实发件人真实性并识别伪造行为。

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-killvxk-cybersecurity-skills-zh-analyzing-email-headers-for-phishing-investigation

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-killvxk-cybersecurity-skills-zh-analyzing-email-headers-for-phishing-investigation)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Analyzing Email Headers For Phishing Investigation? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

分析电子邮件头部用于钓鱼调查

适用场景

  • 调查疑似钓鱼(Phishing)邮件以确定其真实来源时
  • 验证发件人真实性并检测电子邮件伪造时
  • 用户点击钓鱼链接后的事件响应期间
  • 追踪可疑邮件的投递路径和中继服务器时
  • 验证 SPF、DKIM 和 DMARC 对齐以识别伪造时

前置条件

  • 来自可疑邮件的原始邮件头部(EML 或 MSG 格式)
  • 了解 SMTP 协议和电子邮件头部字段
  • 访问 DNS 查询工具(dig、nslookup)用于 SPF/DKIM/DMARC 验证
  • 电子邮件头部分析工具(MHA、emailheaders.net 相关概念)
  • 带邮件解析库的 Python 用于自动化分析
  • 访问威胁情报(Threat Intelligence)平台进行 IP/域名声誉查询

工作流程

步骤 1:提取原始电子邮件头部

# 从 Outlook 导出: 打开邮件 > 文件 > 属性 > Internet 头部
# 从 Gmail 导出: 打开邮件 > 三个点 > 显示原始邮件
# 从 Thunderbird 导出: 查看 > 消息源码

# 如果从取证镜像处理 EML 文件
cp /mnt/evidence/Users/suspect/AppData/Local/Microsoft/Outlook/phishing_email.eml \
   /cases/case-2024-001/email/

# 如果处理 PST 文件,提取单个消息
pip install pypff
python3  0.8:
    print("警告: 可能是错字/仿冒域名!")
PYEOF

# 在 VirusTotal 上检查域名声誉
curl -s "https://www.virustotal.com/api/v3/domains/${SENDER_DOMAIN}" \
   -H "x-apikey: YOUR_VT_API_KEY" | python3 -m json.tool

# 检查 Reply-To 是否与 From 不同(常见钓鱼指标)
python3 -c "
import email
with open('/cases/case-2024-001/email/phishing_email.eml') as f:
    msg = email.message_from_file(f)
from_addr = email.utils.parseaddr(msg['From'])[1]
reply_to = email.utils.parseaddr(msg.get('Reply-To', msg['From']))[1]
if from_addr != reply_to:
    print(f'警告: From ({from_addr}) != Reply-To ({reply_to})')
else:
    print('From 和 Reply-To 匹配')
"

步骤 5:检查邮件正文和附件

# 从邮件正文提取 URL
python3 "\']+', content)
    print("=== 邮件正文中发现的 URL ===")
    for url in set(urls):
        print(f"  {url}")

    # 检查 URL 混淆(显示文本 != href)
    href_pattern = re.findall(r']*href=["\']([^"\']+)["\'][^>]*>(.*?)', content, re.DOTALL)
    print("\n=== 超链接分析 ===")
    for href, text in href_pattern:
        display_url = re.findall(r'https?://[^\s 实际='{href}'")

# 提取附件并计算哈希值
print("\n=== 附件 ===")
for part in msg.walk():
    if part.get_content_disposition() == 'attachment':
        filename = part.get_filename()
        content = part.get_payload(decode=True)
        import hashlib
        sha256 = hashlib.sha256(content).hexdigest()
        print(f"  文件: {filename}, 大小: {len(content)}, SHA-256: {sha256}")
        with open(f'/cases/case-2024-001/email/attachments/{filename}', 'wb') as af:
            af.write(content)
PYEOF

# 将附件哈希提交给 VirusTotal
# 将 URL 提交给 URLhaus 或 PhishTank 进行声誉检查

核心概念

| 概念 | 定义 | |------|------| | SPF(发件人策略框架) | 指定域名授权邮件服务器的 DNS 记录 | | DKIM(域名密钥识别邮件) | 验证电子邮件内容完整性的加密签名 | | DMARC | 将 SPF 和 DKIM 结合用于发件人身份验证的策略框架 | | Received 头部 | 服务器添加的头部,显示投递链中的每一跳(从底部到顶部读取) | | Return-Path | 用于退信消息的信封发件人地址;可能与 From 不同 | | Message-ID | 由原始邮件服务器分配的唯一标识符 | | X-Originating-IP | 原始发件人 IP 地址(由某些邮件服务添加) | | 头部伪造 | 攻击者可以伪造 From、Reply-To 和其他头部,但不能伪造 Received 链 |

工具与系统

| 工具 | 用途 | |------|------| | MXToolbox | 在线邮件头部分析器和 DNS 查询工具 | | dig/nslookup | 用于 SPF、DKIM、DMARC 验证的 DNS 记录查询 | | pyspf | Python SPF 记录验证库 | | dkimpy | Python DKIM 签名验证库 | | PhishTool | 专业钓鱼邮件分析平台 | | VirusTotal | URL 和文件声誉检查服务 | | AbuseIPDB | IP 地址声誉数据库 | | whois | 域名注册信息查询 |

常见场景

场景:CEO 欺诈/商业邮件攻击(BEC) 邮件声称来自 CEO,但 Reply-To 指向 Gmail 地址,SPF 失败(因为发送 IP 未被伪造域名授权),DKIM 缺失,From 域名是仿冒域名(ceo-company.com vs company.com)。

场景:凭据收割钓鱼 邮件包含显示为"login.microsoft.com"但 href 指向仿冒域名的链接,附件是包含带凭据外泄 JavaScript 的假登录页面的 HTML 文件,发送域名三天前刚注册。

场景:通过附件投递恶意软件 带有包含宏的 Office 文档附件的邮件,发件人域名通过 SPF 但账户已被入侵,DKIM 签名有效(从合法基础设施发送),附件 SHA-256 与 VirusTotal 上的已知恶意软件匹配。

场景:使用合法服务的鱼叉式钓鱼(Spearphishing) 攻击者使用合法的邮件营销服务发送钓鱼邮件,SPF 和 DKIM 通过(因为该服务被授权),钓鱼内容在内容中而非基础设施中,需要 URL 和内容分析而非头部认证检查。

输出格式

电子邮件头部分析报告:
  主题:     "紧急: 需要支付发票"
  发件人:   accounting@examp1e-corp.com(已伪造)
  Reply-To: payments.urgent@gmail.com(不匹配)
  Return-Path: 
  日期:     2024-01-15 09:23:45 UTC

  投递路径(4 跳):
    跳 1: mail-server.xyz [203.0.113.45] -> relay1.isp.com
    跳 2: relay1.isp.com -> mx.target-company.com
    跳 3: mx.target-company.com -> internal-filter.target.com
    跳 4: internal-filter.target.com -> 邮箱

  认证结果:
    SPF:    失败(203.0.113.45 未被 examp1e-corp.com 授权)
    DKIM:   无(没有签名)
    DMARC:  失败(p=none,未强制执行)

  钓鱼指标:
    - 仿冒域名(examp1e-corp.com vs example-corp.com,96% 相似)
    - From/Reply-To 不匹配
    - 域名在邮件发送前 2 天注册
    - 正文中的 URL 指向凭据收割页面
    - 附件: invoice.xlsm(SHA-256: a3f2...)- VirusTotal 上的已知恶意软件

  风险级别: 高危

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.