hacktricks/network-services-pentesting/pentesting-ftp/ftp-bounce-attack.md

76 lines
4 KiB
Markdown
Raw Normal View History

# FTP Bounce attack - Scan
{% hint style="success" %}
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
<details>
<summary>Support HackTricks</summary>
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
</details>
{% endhint %}
**Try Hard Security Group**
<figure><img src="../../.gitbook/assets/telegram-cloud-document-1-5159108904864449420.jpg" alt=""><figcaption></figcaption></figure>
{% embed url="https://discord.gg/tryhardsecurity" %}
***
## FTP Bounce - Scanning
2023-06-05 18:33:24 +00:00
### Manual
2023-06-05 18:33:24 +00:00
1. Conéctate al FTP vulnerable
2. Usa \*\*`PORT`\*\* o **`EPRT`** (pero solo uno de ellos) para establecer una conexión con el _\<IP:Port>_ que deseas escanear:
2023-06-05 18:33:24 +00:00
`PORT 172,32,80,80,0,8080`\
`EPRT |2|172.32.80.80|8080|`
3. Usa **`LIST`** (esto solo enviará a la _\<IP:Port>_ conectada la lista de archivos actuales en la carpeta FTP) y verifica las posibles respuestas: `150 File status okay` (Esto significa que el puerto está abierto) o `425 No connection established` (Esto significa que el puerto está cerrado)
1. En lugar de `LIST`, también podrías usar **`RETR /file/in/ftp`** y buscar respuestas similares de `Open/Close`.
2023-06-05 18:33:24 +00:00
Ejemplo usando **PORT** (el puerto 8080 de 172.32.80.80 está abierto y el puerto 7777 está cerrado):
2023-06-05 18:33:24 +00:00
![](<../../.gitbook/assets/image (241).png>)
2023-06-05 18:33:24 +00:00
Mismo ejemplo usando **`EPRT`** (autenticación omitida en la imagen):
2023-06-05 18:33:24 +00:00
![](<../../.gitbook/assets/image (539).png>)
2023-06-05 18:33:24 +00:00
Puerto abierto usando `EPRT` en lugar de `LIST` (entorno diferente)
![](<../../.gitbook/assets/image (875).png>)
2023-06-05 18:33:24 +00:00
### **nmap**
2023-06-05 18:33:24 +00:00
```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
```
**Try Hard Security Group**
<figure><img src="../../.gitbook/assets/telegram-cloud-document-1-5159108904864449420.jpg" alt=""><figcaption></figcaption></figure>
{% embed url="https://discord.gg/tryhardsecurity" %}
{% hint style="success" %}
Aprende y practica Hacking en AWS:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Aprende y practica Hacking en GCP: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2023-06-05 18:33:24 +00:00
<details>
2023-06-05 18:33:24 +00:00
<summary>Apoya a HackTricks</summary>
2023-06-05 18:33:24 +00:00
* Revisa los [**planes de suscripción**](https://github.com/sponsors/carlospolop)!
* **Únete al** 💬 [**grupo de Discord**](https://discord.gg/hRep4RUj7f) o al [**grupo de telegram**](https://t.me/peass) o **síguenos** en **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Comparte trucos de hacking enviando PRs a los** [**HackTricks**](https://github.com/carlospolop/hacktricks) y [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) repositorios de github.
2023-06-05 18:33:24 +00:00
</details>
{% endhint %}