# FTP Bounce attack - Scan

<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** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

**Try Hard Security Group**

<figure><img src="https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-dae1ef8c660e0243188462f22f417bbb1a2719d3%2Ftelegram-cloud-document-1-5159108904864449420.jpg?alt=media" alt=""><figcaption></figcaption></figure>

{% embed url="<https://discord.gg/tryhardsecurity>" %}

***

## FTP反弹 - 扫描

### 手动

1. 连接到易受攻击的FTP
2. 使用\*\*`PORT`**或**`EPRT`\*\*（但只能使用其中一个）来建立与您要扫描的\_IP:端口\_的连接：

`PORT 172,32,80,80,0,8080`\
`EPRT |2|172.32.80.80|8080|` 3. 使用\*\*`LIST`**（这只会向连接的\_IP:端口\_发送FTP文件夹中当前文件的列表），并检查可能的响应：`150 文件状态正常`（这意味着端口是打开的）或`425 未建立连接`（这意味着端口已关闭） 4. 您也可以使用**`RETR /file/in/ftp`\*\*而不是`LIST`，并寻找类似的`打开/关闭`响应。

使用**PORT**的示例（172.32.80.80的端口8080是打开的，端口7777已关闭）：

![](https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-3e9c614b9566726b780aa8b994ffe0c333adf618%2Fimage%20\(225\).png?alt=media)

使用\*\*`EPRT`\*\*的相同示例（图像中省略了身份验证）：

![](https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-4d05af9879397a741b7335b2544716109206a70d%2Fimage%20\(226\).png?alt=media)

使用`EPRT`而不是`LIST`打开端口（不同的环境）：

![](https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-4d34a0da9b12a9dfadc7dcc6d665d90c10b21452%2Fimage%20\(228\).png?alt=media)

### **nmap**

```bash
nmap -b <name>:<pass>@<ftp_server> <victim>
nmap -Pn -v -p 21,80 -b ftp:ftp@10.2.1.5 127.0.0.1 #Scan ports 21,80 of the FTP
nmap -v -p 21,22,445,80,443 -b ftp:ftp@10.2.1.5 192.168.0.1/24 #Scan the internal network (of the FTP) ports 21,22,445,80,443
```

**尝试困难安全团队**

<figure><img src="https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-dae1ef8c660e0243188462f22f417bbb1a2719d3%2Ftelegram-cloud-document-1-5159108904864449420.jpg?alt=media" alt=""><figcaption></figcaption></figure>

{% embed url="<https://discord.gg/tryhardsecurity>" %}

<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) 或 [**telegram团队**](https://t.me/peass) 或在**Twitter**上关注我们 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>
