> For the complete documentation index, see [llms.txt](https://hacktricks.xsx.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacktricks.xsx.tw/generic-methodologies-and-resources/pentesting-methodology.md).

# Pentesting Methodology

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS Red Team Expert）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF版HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)！
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我们 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

<figure><img src="/files/GHj1ZZKHZeM4ad1xvzNu" alt=""><figcaption></figcaption></figure>

如果您对**黑客职业**感兴趣并想要攻破不可攻破的系统 - **我们正在招聘！**（需要流利的波兰语书面和口头表达能力）。

{% embed url="<https://www.stmcyber.com/careers>" %}

## 渗透测试方法论

<figure><img src="/files/rRHvWB6JY58Kag4xrYxN" alt=""><figcaption></figcaption></figure>

*Hacktricks的标志由* [*@ppiernacho*](https://www.instagram.com/ppieranacho/)*设计。*

### 0- 物理攻击

您是否可以**物理访问**要攻击的机器？您应该阅读一些关于[**物理攻击的技巧**](/hardware-physical-access/physical-attacks.md)以及关于[**从GUI应用程序中逃逸**](/hardware-physical-access/escaping-from-gui-applications.md)的其他技巧。

### 1 - [发现网络内的主机](/generic-methodologies-and-resources/pentesting-network.md#discovering-hosts)/ [发现公司资产](/generic-methodologies-and-resources/external-recon-methodology.md)

**取决于**您正在执行的**测试**是**内部测试**还是**外部测试**，您可能有兴趣查找公司网络内的主机（内部测试）或在互联网上查找公司的资产（外部测试）。

{% hint style="info" %}
请注意，如果您正在执行外部测试，一旦成功访问公司内部网络，您应重新开始本指南。
{% endhint %}

### **2-** [**与网络玩耍**](/generic-methodologies-and-resources/pentesting-network.md) **（内部）**

**此部分仅适用于执行内部测试。**\
在攻击主机之前，您可能更喜欢从网络中**窃取一些凭据**或**嗅探**一些**数据**以 passively/actively(MitM) 了解网络内部可以找到什么。您可以阅读[**渗透测试网络**](/generic-methodologies-and-resources/pentesting-network.md#sniffing)。

### 3- [端口扫描 - 服务发现](/generic-methodologies-and-resources/pentesting-network.md#scanning-hosts)

在**查找主机漏洞**时，首先要做的是了解哪些端口中运行了哪些服务。让我们看看[**扫描主机端口的基本工具**](/generic-methodologies-and-resources/pentesting-network.md#scanning-hosts)。

### **4-** [搜索服务版本漏洞](/generic-methodologies-and-resources/search-exploits.md)

一旦您知道哪些服务正在运行，也许知道它们的版本，您必须**搜索已知漏洞**。也许您很幸运，有一个漏洞可以为您提供一个 shell...

### **5-** 渗透测试服务

如果没有任何正在运行服务的花哨漏洞利用，您应该查找每个正在运行服务中的**常见配置错误**。

**在本书中，您将找到渗透测试最常见服务的指南**（以及其他不太常见的服务）**。请在左侧索引中搜索** ***渗透测试*** **部分**（服务按其默认端口排序）。

**我想特别提一下** [**渗透测试Web**](/network-services-pentesting/pentesting-web.md) **部分（因为它是最广泛的部分）。**\
此外，您可以在这里找到一个关于[**查找软件中已知漏洞的小指南**](/generic-methodologies-and-resources/search-exploits.md)。

**如果您的服务不在索引中，请在Google中搜索**其他教程，并告诉我是否要添加它。如果您在Google中**找不到任何内容**，请执行您自己的盲目渗透测试，您可以从**连接到服务，对其进行模糊处理并阅读响应**（如果有）开始。

#### 5.1 自动工具

还有一些工具可以执行**自动漏洞评估**。**我建议您尝试** [**Legion**](https://github.com/carlospolop/legion)**，这是我创建的基于本书中关于渗透测试服务的笔记的工具。**

#### **5.2 对服务进行暴力破解**

在某些情况下，**暴力破解**可能对**破坏**一个**服务**有用。[**在这里找到不同服务暴力破解的速查表**](/generic-methodologies-and-resources/brute-force.md)**。**

### 6- [钓鱼](/generic-methodologies-and-resources/phishing-methodology.md)

如果到目前为止您没有找到任何有趣的漏洞，您**可能需要尝试一些钓鱼**以便进入网络。您可以阅读我的钓鱼方法论[这里](/generic-methodologies-and-resources/phishing-methodology.md)：

### **7-** [**获取Shell**](/generic-methodologies-and-resources/shells.md)

某种程度上，您应该已经找到了在受害者中执行代码的**某种方法**。然后，[您可以使用系统中可能的工具列表来获取反向 shell](/generic-methodologies-and-resources/shells.md)。

特别是在Windows中，您可能需要一些帮助来**避开防病毒软件**：[**查看此页面**](/windows-hardening/av-bypass.md)**。**\\

### 8- 内部

如果您在 shell 方面遇到问题，您可以在这里找到一些对渗透测试人员非常有用的**最常用命令的小编译**：

* [**Linux**](/linux-hardening/useful-linux-commands.md)
* [**Windows（CMD）**](/windows-hardening/basic-cmd-for-pentesters.md)
* [**Windows（PS）**](/windows-hardening/basic-powershell-for-pentesters.md)

### **9 -** [**数据外泄**](/generic-methodologies-and-resources/exfiltration.md)

您可能需要从受害者那里**提取一些数据**，甚至**引入一些东西**（如权限提升脚本）。**在这里，您可以找到** [**用于这些目的的常用工具的帖子**](/generic-methodologies-and-resources/exfiltration.md)**。**

### **10- 提权**

#### **10.1- 本地提权**

如果您在系统中**不是root/Administrator**，您应该找到一种方法来**提升权限。**\
在这里，您可以找到有关如何在[**Linux**](/linux-hardening/privilege-escalation.md) **和** [**Windows**](/windows-hardening/windows-local-privilege-escalation.md) **本地提升权限的指南。**\
您还应该查看有关**Windows工作原理**的页面：

* [**身份验证、凭据、令牌权限和UAC**](/windows-hardening/authentication-credentials-uac-and-efs.md)
* [**NTLM的工作原理**](/windows-hardening/ntlm.md)
* 如何[**窃取凭据**](https://github.com/carlospolop/hacktricks/blob/master/generic-methodologies-and-resources/broken-reference/README.md) 在Windows中
* 有关[***Active Directory***](/windows-hardening/active-directory-methodology.md)的一些技巧

**不要忘记查看用于枚举Windows和Linux本地提权路径的最佳工具：** [**Suite PEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite)

#### **10.2- 域提权**

在这里，您可以找到一种[**解释最常见操作的方法论，用于枚举、提升权限和在Active Directory上保持持久性**](/windows-hardening/active-directory-methodology.md)。即使这只是一个部分，这个过程在渗透测试/红队任务中可能会**非常敏感**。

### 11 - POST

#### **11**.1 - 掠夺

检查您是否可以在主机内找到更多**密码**，或者是否可以使用您的**用户**权限**访问其他机器**。\
在这里找到在[**Windows中转储密码的不同方法**](https://github.com/carlospolop/hacktricks/blob/master/generic-methodologies-and-resources/broken-reference/README.md)。

#### 11.2 - 持久性

**使用2到3种不同类型的持久性机制，这样您就不需要再次利用系统。**\
**在这里，您可以找到一些**[**关于Active Directory持久性技巧**](/windows-hardening/active-directory-methodology.md#persistence)**。**

TODO: 在Windows和Linux中完成持久性Post

### 12 - 枢纽

利用**收集到的凭据**，您可以访问其他机器，或者您可能需要**发现和扫描新主机**（重新开始渗透测试方法论），这些主机位于您的受害者连接的新网络中。\
在这种情况下，可能需要进行隧道设置。在这里，您可以找到有关[**隧道设置的文章**](/generic-methodologies-and-resources/tunneling-and-port-forwarding.md)。\
您绝对还应该查看有关[Active Directory渗透测试方法论](/windows-hardening/active-directory-methodology.md)的文章。在那里，您将找到移动横向、提升权限和转储凭据的有趣技巧。\
还要查看有关[**NTLM**](/windows-hardening/ntlm.md)的页面，这可能对在Windows环境中进行枢纽操作非常有用。

### 更多

#### [Android应用程序](/mobile-pentesting/android-app-pentesting.md)

#### **利用**

* [**基本Linux利用**](https://github.com/xsxtw/hacktricks/blob/cn/binary-exploitation/linux-exploiting-basic-esp.md)
* [**基本Windows利用**](/binary-exploitation/windows-exploiting-basic-guide-oscp-lvl.md)
* [**基本利用工具**](/binary-exploitation/basic-binary-exploitation-methodology/tools.md)

#### [**基本Python**](/generic-methodologies-and-resources/python.md)

#### **加密技巧**

* [**ECB**](/crypto-and-stego/electronic-code-book-ecb.md)
* [**CBC-MAC**](/crypto-and-stego/cipher-block-chaining-cbc-mac-priv.md)
* [**填充Oracle**](/crypto-and-stego/padding-oracle-priv.md)

<figure><img src="/files/GHj1ZZKHZeM4ad1xvzNu" alt=""><figcaption></figcaption></figure>

如果您对**黑客职业**感兴趣并想要攻击无法攻击的目标 - **我们正在招聘！**（需要流利的波兰语书面和口语表达能力）。

{% embed url="<https://www.stmcyber.com/careers>" %}

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想在HackTricks中看到您的**公司广告**或**下载PDF格式的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 发现[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[NFTs](https://opensea.io/collection/the-peass-family)收藏品
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**上关注**我们。
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>
