Imap Pentesting logo

Imap Pentesting

OrganizationPopular
wgpsec
imap-pentesting

IMAP 邮件服务(143/993 端口)渗透测试方法论。涵盖 IMAP 服务发现、Banner 信息提取、凭据爆破、邮箱枚举与邮件下载、IMAP 命令注入、已知漏洞利用。 当 Agent 扫描发现 143 或 993 端口开放、需要测试 IMAP 认证强度、枚举邮箱内容、或利用 IMAP 服务漏洞时,触发此 Skill。

Overview

Publisherwgpsec
RepositoryAboutSecurity
Skill nameimap-pentesting
Stars
1.8K
Forks
247
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wgpsec on GitHub. Read the source before you install it.

Installation

Install the Imap Pentesting AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/network-service/imap-pentesting
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wgpsec/AboutSecurity.git /tmp/AboutSecurity
mkdir -p .claude/skills
cp -r /tmp/AboutSecurity/skills/exploit/network-service/imap-pentesting .claude/skills/imap-pentesting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Imap Pentesting in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Imap Pentesting on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Imap Pentesting is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

IMAP 邮件渗透测试方法论 (143/993)

深入参考


整体决策树

发现 143/993 端口开放
├─ Phase 1: 服务发现
│   ├─ Banner 抓取 -> 识别邮件服务与版本
│   ├─ 143 (明文) vs 993 (SSL/TLS)
│   └─ Nmap 脚本 -> 能力枚举 / NTLM 信息
├─ Phase 2: Banner 信息分析
│   ├─ 邮件服务器类型 (Dovecot / Exchange / Cyrus / Zimbra)
│   ├─ NTLM 信息泄露 (Exchange) -> Windows 版本、域名
│   └─ CAPABILITY 命令 -> 支持的功能
├─ Phase 3: 凭据爆破
│   ├─ hydra / medusa / ncrack
│   ├─ Metasploit imap_version
│   └─ 默认凭据 / 弱密码
├─ Phase 4: 邮箱枚举与邮件下载
│   ├─ LIST "" * -> 列出所有邮箱文件夹
│   ├─ SELECT INBOX -> 选中收件箱
│   ├─ SEARCH ALL -> 列出所有邮件
│   ├─ FETCH -> 下载邮件内容
│   └─ SEARCH TEXT "password" -> 关键词搜索
└─ Phase 5: 已知漏洞
    ├─ 服务器特定 CVE
    ├─ IMAP 命令注入
    └─ searchsploit <imap_server> <version>

Phase 1: 服务发现

1.1 Banner 抓取

bash
# 明文 IMAP (143)
nc -nv <IP> 143

# SSL/TLS IMAP (993)
openssl s_client -connect <IP>:993 -quiet

1.2 Nmap 枚举

bash
# IMAP NTLM 信息泄露
nmap --script imap-ntlm-info -p 143 <IP>

# IMAP 能力枚举
nmap --script imap-capabilities -p 143 <IP>

1.3 Metasploit

bash
msfconsole -q -x 'use auxiliary/scanner/imap/imap_version; set RHOSTS <IP>; set RPORT 143; run; exit'

Phase 2: Banner 信息分析

2.1 NTLM 信息提取 (Exchange)

如果服务器支持 NTLM 认证,可提取 Windows 版本等信息:

bash
# Telnet 交互
telnet <IP> 143
* OK The Microsoft Exchange IMAP4 service is ready.
>> a1 AUTHENTICATE NTLM
+
>> TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=
# 服务器返回 NTLMSSP_CHALLENGE (含 OS 版本、域信息)

2.2 信息分析决策树

Banner 分析
├─ Microsoft Exchange
│   ├─ NTLM 信息泄露 -> 版本、域名、主机名
│   └─ 可能存在 ProxyLogon / ProxyShell 等漏洞 (通过 HTTP)
├─ Dovecot
│   └─ 检查版本特定 CVE
├─ Cyrus IMAP
│   └─ 检查版本特定 CVE
├─ Zimbra
│   └─ 检查 Web 接口相关 CVE
└─ CAPABILITY 结果
    ├─ STARTTLS -> 可升级加密
    ├─ AUTH=PLAIN -> 明文认证
    └─ AUTH=NTLM -> Windows 域环境

Phase 3: 凭据爆破

3.1 爆破工具

bash
# hydra — IMAP 明文
hydra -l <username> -P <password_list> -f <IP> imap -V

# hydra — IMAPS (SSL)
hydra -l <username> -P <password_list> -f <IP> -s 993 imaps -V

# medusa
medusa -h <IP> -u <username> -P <password_list> -M imap

# ncrack
ncrack -p 143 --user <username> -P <password_list> <IP>

Phase 4: 邮箱枚举与邮件下载

4.1 IMAP 命令操作

bash
# 登录
a1 LOGIN username password

# 列出所有邮箱/文件夹
a1 LIST "" *
a1 LIST INBOX *

# 选中邮箱
a1 SELECT INBOX

# 查看邮箱状态
a1 STATUS INBOX (MESSAGES UNSEEN RECENT)

# 搜索所有邮件
a1 SEARCH ALL

# 关键词搜索
a1 SEARCH TEXT "password"
a1 SEARCH SUBJECT "vpn"
a1 SEARCH FROM "admin"

# 获取邮件标志
a1 FETCH 1:* (FLAGS)

# 下载邮件全文
a1 FETCH <msg_id> body[text]
a1 FETCH <msg_id> all
a1 UID FETCH <uid> (UID RFC822.SIZE BODY.PEEK[])

# 关闭邮箱
a1 CLOSE

# 退出
a1 LOGOUT

4.2 CURL 操作 (更方便)

bash
# 列出所有邮箱
curl -k 'imaps://<IP>/' --user user:pass

# 列出 INBOX 中的邮件
curl -k 'imaps://<IP>/INBOX?ALL' --user user:pass

# 关键词搜索
curl -k 'imaps://<IP>/Drafts?TEXT password' --user user:pass

# 下载指定邮件
curl -k 'imaps://<IP>/INBOX;MAILINDEX=1' --user user:pass

# UID 操作
curl -k 'imaps://<IP>/INBOX' -X 'UID SEARCH ALL' --user user:pass
curl -k 'imaps://<IP>/INBOX;UID=1' --user user:pass

# 批量获取邮件头
curl -k 'imaps://<IP>/INBOX' -X 'FETCH 1:5 BODY[HEADER.FIELDS (SUBJECT FROM)]' --user user:pass -v 2>&1 | grep '^<'

4.3 邮件内容分析

邮件提取后关注内容
├─ 凭据信息
│   ├─ 密码重置邮件
│   ├─ 系统通知 (新账户创建)
│   └─ VPN / SSH / RDP 配置
├─ 内部网络信息
│   ├─ 内网 IP / URL
│   ├─ 系统架构文档
│   └─ 运维通知
├─ 附件
│   ├─ 配置文件
│   ├─ 文档 (Word/Excel/PDF)
│   └─ 压缩包
├─ 草稿箱
│   └─ 可能包含未发送的敏感信息
└─ 社会工程素材
    └─ 邮件模板 / 签名 -> 钓鱼攻击参考

4.4 批量下载脚本

bash
# 循环下载前 N 封邮件
for m in {1..20}; do
  echo "--- Message $m ---"
  curl -k "imap://<IP>/INBOX;MAILINDEX=$m;SECTION=HEADER.FIELDS%20(SUBJECT%20FROM)" --user user:pass
done

Phase 5: 已知漏洞

5.1 漏洞检测决策树

IMAP 服务版本已知
├─ Dovecot
│   ├─ CVE-2019-11500 (堆溢出)
│   └─ searchsploit dovecot
├─ Cyrus IMAP
│   ├─ CVE-2019-18928 (认证绕过)
│   └─ searchsploit cyrus imap
├─ Microsoft Exchange
│   ├─ ProxyLogon (CVE-2021-26855)
│   ├─ ProxyShell (CVE-2021-34473)
│   └─ 通过 HTTP/HTTPS 接口利用
├─ Zimbra
│   ├─ CVE-2022-27925 (RCE)
│   └─ CVE-2022-37042 (认证绕过 + RCE)
└─ 通用
    └─ searchsploit imap

图形化客户端

如需更直观操作邮件内容:

bash
# Evolution 邮件客户端 (Linux)
apt install evolution
# 添加 IMAP 账户配置后可浏览完整邮箱

Shodan 搜索

port:143 CAPABILITY
port:993 CAPABILITY

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Imap Pentesting AI skill do?

IMAP 邮件服务(143/993 端口)渗透测试方法论。涵盖 IMAP 服务发现、Banner 信息提取、凭据爆破、邮箱枚举与邮件下载、IMAP 命令注入、已知漏洞利用。 当 Agent 扫描发现 143 或 993 端口开放、需要测试 IMAP 认证强度、枚举邮箱内容、或利用 IMAP 服务漏洞时,触发此 Skill。

Why use Imap Pentesting on TypingMind?

Because you install it once and use it with any model. Imap Pentesting is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Imap Pentesting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wgpsec/AboutSecurity/tree/master/skills/exploit/network-service/imap-pentesting. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Imap Pentesting?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Imap Pentesting?

As many as you like. As long as a model supports skills, you can use Imap Pentesting with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Imap Pentesting AI skill free?

It is published on GitHub by wgpsec. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇