SuperAPI AI Directory

pop-pentesting

Security & auditing

View repository

Updated 10-16 04:42

About this skill

POP3 mail penetration testing methodology (110/995)

In-depth reference


Overall decision tree

发现 110/995 端口开放
├─ Phase 1: 服务发现
│   ├─ Banner 抓取 -> 识别邮件服务软件与版本
│   ├─ 110 (明文) vs 995 (SSL/TLS)
│   └─ Nmap 脚本 -> 能力枚举 / NTLM 信息泄露
├─ Phase 2: Banner 信息分析
│   ├─ 邮件服务器类型 (Dovecot / Exchange / JAMES / Zimbra)
│   ├─ NTLM 信息 -> Windows 版本、域名、主机名
│   └─ CAPA 命令 -> 支持的功能列表
├─ Phase 3: 凭据爆破
│   ├─ hydra / medusa / ncrack
│   ├─ Metasploit pop3_login
│   └─ 默认凭据 / 弱密码
├─ Phase 4: 邮件提取
│   ├─ 登录后列出邮件 (LIST / STAT)
│   ├─ 下载邮件内容 (RETR)
│   ├─ 搜索敏感信息 (凭据、VPN配置、内部链接)
│   └─ TOP 命令预览邮件头
└─ Phase 5: 已知漏洞
    ├─ 服务器特定 CVE
    ├─ 密码日志泄露 (auth_debug_passwords)
    └─ searchsploit <pop3_server> <version>

Phase 1: Service discovery

1.1 Banner grabbing

# 明文 POP3 (110)
nc -nv <IP> 110

# SSL/TLS POP3 (995)
openssl s_client -connect <IP>:995 -crlf -quiet

1.2 Nmap enumeration

# POP3 能力与 NTLM 信息
nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -p 110 <IP>

pop3-ntlm-info scripts can leak sensitive information such as the Windows version.

1.3 Metasploit version detection

msfconsole -q -x 'use auxiliary/scanner/pop3/pop3_version; set RHOSTS <IP>; set RPORT 110; run; exit'

Phase 2: Banner information analysis

2.1 CAPA command

# 连接后发送 CAPA 获取服务能力
CAPA
# 返回支持的扩展 (如 STLS, SASL, PIPELINING)

2.2 Information analysis decision tree

Banner 分析
├─ 识别邮件服务器
│   ├─ Dovecot -> Linux 邮件服务器
│   ├─ Microsoft Exchange -> Windows 域环境
│   ├─ JAMES -> Java 邮件服务器
│   └─ Zimbra -> Web 邮件套件
├─ NTLM 信息泄露 (Exchange)
│   ├─ Windows 版本
│   ├─ 域名
│   └─ 主机名
└─ STLS 支持
    ├─ 支持 -> 可升级到 TLS (STARTTLS)
    └─ 不支持 -> 明文传输 (嗅探风险)

Phase 3: Credential brute forcing

3.1 Brute-force tools

# hydra
hydra -l <username> -P <password_list> -f <IP> pop3 -V
hydra -l <username> -P <password_list> -f <IP> -s 995 pop3s -V

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

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

3.2 Credential source decision tree

凭据获取路径
├─ 已知用户名 (从 SMTP VRFY / LDAP / Web 枚举获得)
│   ├─ 密码爆破 (hydra / medusa)
│   └─ 密码喷洒 (单密码多用户)
├─ 邮箱格式推断
│   ├─ 企业邮箱: first.last@domain.com
│   └─ 构造用户名列表
└─ 默认凭据
    └─ admin / test / user + 常见弱密码

Phase 4: Email extraction

4.1 POP3 command operations

# 登录
USER <username>
PASS <password>

# 邮箱状态 (邮件数量和总大小)
STAT

# 列出所有邮件 (编号和大小)
LIST

# 预览邮件头 (不下载全部)
TOP <msg_number> 0

# 下载完整邮件
RETR <msg_number>

# 标记删除
DELE <msg_number>

# 取消删除
RSET

# 退出
QUIT

4.2 Email content analysis

邮件提取后关注内容
├─ 密码 / 凭据
│   ├─ 明文密码 (密码重置邮件)
│   ├─ VPN / SSH 配置文件
│   └─ API Key / Token
├─ 内部信息
│   ├─ 内网 IP / 主机名
│   ├─ 内部系统 URL
│   └─ 组织架构信息
├─ 附件
│   ├─ 文档 (可能含宏)
│   └─ 配置文件
└─ 社会工程素材
    └─ 邮件模板 / 签名格式 -> 钓鱼攻击

4.3 Complete operation example

# Telnet 连接示例
telnet <IP> 110
+OK POP3 server ready
USER billydean
+OK
PASS password
+OK Welcome billydean

LIST
+OK 2 1807
1 786
2 1021

RETR 1
+OK Message follows
From: admin@company.com
...

Phase 5: Known vulnerabilities

5.1 Vulnerability detection decision tree

POP3 服务版本已知
├─ Dovecot
│   └─ searchsploit dovecot
├─ Microsoft Exchange
│   └─ ProxyLogon / ProxyShell 系列 (通过 HTTP 入口)
├─ JAMES 2.x
│   └─ 默认凭据 + RCE
├─ Zimbra
│   └─ CVE-2022-27925 / CVE-2022-37042 等
└─ 通用
    └─ searchsploit pop3

5.2 Password log disclosure

Some POP servers enable auth_debug configuration to increase logging. If auth_debug_passwords or auth_verbose_passwords is set to true, passwords may be recorded in plaintext in logs.

After obtaining server file system access, check whether log files contain plaintext passwords.