hacktricks/network-services-pentesting/pentesting-pop.md

171 lines
9.4 KiB
Markdown
Raw Normal View History

2022-05-01 13:25:53 +00:00
# 110,995 - Pentesting POP
2022-04-28 16:01:33 +00:00
<details>
2023-04-25 18:35:28 +00:00
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
* 你在一个**网络安全公司**工作吗你想在HackTricks中看到你的**公司广告**吗?或者你想获得**PEASS的最新版本或下载PDF格式的HackTricks**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)
* 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品[**The PEASS Family**](https://opensea.io/collection/the-peass-family)
* 获得[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
* **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**电报群组**](https://t.me/peass)或**关注**我在**Twitter**上的[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
2023-08-03 19:12:22 +00:00
* **通过向[hacktricks repo](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享你的黑客技巧**。
2022-04-28 16:01:33 +00:00
</details>
<figure><img src="/.gitbook/assets/image (675).png" alt=""><figcaption></figcaption></figure>
发现最重要的漏洞以便更快地修复它们。Intruder跟踪您的攻击面运行主动威胁扫描发现整个技术堆栈中的问题从API到Web应用程序和云系统。[**立即免费试用**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks)。
{% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
***
2023-08-03 19:12:22 +00:00
## 基本信息
2022-04-28 16:01:33 +00:00
2023-08-03 19:12:22 +00:00
**邮局协议****POP**)是一种计算机网络和互联网标准**协议**,用于从远程邮件服务器提取和检索电子邮件,以供主机机器访问。**POP**是OSI模型中的应用层**协议**,为终端用户提供获取和接收电子邮件的能力(来自[这里](https://www.techopedia.com/definition/5383/post-office-protocol-pop))。
2023-08-03 19:12:22 +00:00
POP客户端通常连接检索所有消息将其存储在客户端系统上并从服务器上删除。有3个版本的POP但POP3是最常用的版本。
2023-08-03 19:12:22 +00:00
**默认端口:**110995ssl
2022-05-01 13:25:53 +00:00
```
PORT STATE SERVICE
110/tcp open pop3
```
### 枚举
2023-08-03 19:12:22 +00:00
#### 横幅抓取
2023-08-03 19:12:22 +00:00
横幅抓取是一种枚举技术,用于获取目标主机上运行的网络服务的版本和其他相关信息。这可以帮助黑客确定目标系统上可能存在的漏洞和弱点。横幅抓取通常通过发送特定的网络请求来获取服务的响应横幅。这些响应横幅通常包含有关服务的版本号、操作系统信息和其他标识符。
2023-08-03 19:12:22 +00:00
黑客可以使用各种工具来执行横幅抓取例如Telnet、Netcat和Nmap。这些工具可以发送不同类型的请求以获取服务的响应横幅。黑客可以分析响应横幅中的信息以确定目标系统上可能存在的漏洞和弱点。
2023-08-03 19:12:22 +00:00
横幅抓取是一种被动的枚举技术,因为它不会对目标系统造成任何影响。然而,黑客应该小心使用横幅抓取工具,以避免引起目标系统管理员的注意。
```bash
nc -nv <IP> 110
openssl s_client -connect <IP>:995 -crlf -quiet
```
2023-08-03 19:12:22 +00:00
## 手动
您可以使用命令 `CAPA` 来获取 POP3 服务器的功能。
2023-08-03 19:12:22 +00:00
## 自动化
```bash
2021-03-28 16:50:16 +00:00
nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -port <PORT> <IP> #All are default scripts
```
`pop3-ntlm-info`插件将返回一些敏感数据Windows版本
2023-08-03 19:12:22 +00:00
### [POP3暴力破解](../generic-methodologies-and-resources/brute-force.md#pop)
2023-08-03 19:12:22 +00:00
## POP语法
```bash
POP commands:
2023-08-03 19:12:22 +00:00
USER uid Log in as "uid"
PASS password Substitue "password" for your actual password
STAT List number of messages, total mailbox size
LIST List messages and sizes
RETR n Show message n
DELE n Mark message n for deletion
RSET Undo any changes
QUIT Logout (expunges messages if no RSET)
TOP msg n Show first n lines of message number msg
CAPA Get capabilities
```
2023-08-03 19:12:22 +00:00
从[这里](http://sunnyoasis.com/services/emailviatelnet.html)
2023-08-03 19:12:22 +00:00
示例:
2022-05-01 13:25:53 +00:00
```
root@kali:~# telnet $ip 110
2023-08-03 19:12:22 +00:00
+OK beta POP3 server (JAMES POP3 Server 2.3.2) ready
USER billydean
+OK
PASS password
+OK Welcome billydean
2021-03-31 10:21:23 +00:00
2023-08-03 19:12:22 +00:00
list
2021-03-31 10:21:23 +00:00
2023-08-03 19:12:22 +00:00
+OK 2 1807
1 786
2 1021
2023-08-03 19:12:22 +00:00
retr 1
2021-03-31 10:21:23 +00:00
2023-08-03 19:12:22 +00:00
+OK Message follows
From: jamesbrown@motown.com
Dear Billy Dean,
2023-08-03 19:12:22 +00:00
Here is your login for remote desktop ... try not to forget it this time!
username: billydean
password: PA$$W0RD!Z
```
## 危险的设置
2023-08-03 19:12:22 +00:00
来自[https://academy.hackthebox.com/module/112/section/1073](https://academy.hackthebox.com/module/112/section/1073)
2022-10-02 21:10:53 +00:00
2023-08-03 19:12:22 +00:00
| **设置** | **描述** |
2022-10-02 21:10:53 +00:00
| ------------------------- | ----------------------------------------------------------------------------------------- |
2023-08-03 19:12:22 +00:00
| `auth_debug` | 启用所有身份验证调试日志记录。 |
| `auth_debug_passwords` | 此设置调整日志详细程度,记录提交的密码和方案。 |
| `auth_verbose` | 记录未成功的身份验证尝试及其原因。 |
| `auth_verbose_passwords` | 记录用于身份验证的密码,也可以进行截断。 |
| `auth_anonymous_username` | 指定在使用ANONYMOUS SASL机制登录时要使用的用户名。 |
2021-08-12 13:23:35 +00:00
2023-08-03 19:12:22 +00:00
## HackTricks自动命令
2022-05-01 13:25:53 +00:00
```
2021-08-12 13:23:35 +00:00
Protocol_Name: POP #Protocol Abbreviation if there is one.
Port_Number: 110 #Comma separated if there is more than one.
Protocol_Description: Post Office Protocol #Protocol Abbreviation Spelled out
2021-08-15 17:31:12 +00:00
Entry_1:
2023-08-03 19:12:22 +00:00
Name: Notes
Description: Notes for POP
Note: |
Post Office Protocol (POP) is a type of computer networking and Internet standard protocol that extracts and retrieves email from a remote mail server for access by the host machine. POP is an application layer protocol in the OSI model that provides end users the ability to fetch and receive email (from here).
The POP clients generally connect, retrieve all messages, store them on the client system, and delete them from the server. There are 3 versions of POP, but POP3 is the most used one.
2021-08-15 17:31:12 +00:00
2023-08-03 19:12:22 +00:00
https://book.hacktricks.xyz/pentesting/pentesting-whois
2021-08-15 17:31:12 +00:00
Entry_2:
2023-08-03 19:12:22 +00:00
Name: Banner Grab
Description: Banner Grab 110
Command: nc -nv {IP} 110
2021-08-15 17:31:12 +00:00
Entry_3:
2023-08-03 19:12:22 +00:00
Name: Banner Grab 995
Description: Grab Banner Secure
Command: openssl s_client -connect {IP}:995 -crlf -quiet
2021-08-15 17:31:12 +00:00
Entry_4:
2023-08-03 19:12:22 +00:00
Name: Nmap
Description: Scan for POP info
Command: nmap --script "pop3-capabilities or pop3-ntlm-info" -sV -p 110 {IP}
2021-09-13 15:39:29 +00:00
Entry_5:
2023-08-03 19:12:22 +00:00
Name: Hydra Brute Force
Description: Need User
Command: hydra -l {Username} -P {Big_Passwordlist} -f {IP} pop3 -V
2022-07-18 12:05:04 +00:00
Entry_6:
2023-08-03 19:12:22 +00:00
Name: consolesless mfs enumeration
Description: POP3 enumeration without the need to run msfconsole
Note: sourced from https://github.com/carlospolop/legion
Command: msfconsole -q -x 'use auxiliary/scanner/pop3/pop3_version; set RHOSTS {IP}; set RPORT 110; run; exit'
2023-08-03 19:12:22 +00:00
```
2022-04-28 16:01:33 +00:00
<details>
<figure><img src="/.gitbook/assets/image (675).png" alt=""><figcaption></figcaption></figure>
找到最重要的漏洞以便您能更快地修复它们。Intruder跟踪您的攻击面运行主动威胁扫描发现整个技术堆栈中的问题从API到Web应用程序和云系统。[**立即免费试用**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks)。
2022-04-28 16:01:33 +00:00
{% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
<summary><a href="https://cloud.hacktricks.xyz/pentesting-cloud/pentesting-cloud-methodology"><strong>☁️ HackTricks Cloud ☁️</strong></a> -<a href="https://twitter.com/hacktricks_live"><strong>🐦 Twitter 🐦</strong></a> - <a href="https://www.twitch.tv/hacktricks_live/schedule"><strong>🎙️ Twitch 🎙️</strong></a> - <a href="https://www.youtube.com/@hacktricks_LIVE"><strong>🎥 Youtube 🎥</strong></a></summary>
* 您在**网络安全公司**工作吗您想在HackTricks中看到您的**公司广告**吗?或者您想获得**PEASS的最新版本或下载HackTricks的PDF**吗?请查看[**订阅计划**](https://github.com/sponsors/carlospolop)
* 发现我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品- [**The PEASS Family**](https://opensea.io/collection/the-peass-family)
* 获得[**官方PEASS和HackTricks周边产品**](https://peass.creator-spring.com)
* **加入**[**💬**](https://emojipedia.org/speech-balloon/) [**Discord群组**](https://discord.gg/hRep4RUj7f)或[**电报群组**](https://t.me/peass),或在**Twitter**上**关注**我[**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* **通过向[hacktricks repo](https://github.com/carlospolop/hacktricks)和[hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)提交PR来分享您的黑客技巧**。
2022-04-28 16:01:33 +00:00
</details>