37 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FTP Bounce attack - Scan
{{#include ../../banners/hacktricks-training.md}}
## FTP Bounce - スキャン
### 手動
1. 脆弱なFTPに接続します
2. **`PORT`**または**`EPRT`**どちらか1つのみを使用して、スキャンしたい_<IP:Port>_との接続を確立します
`PORT 172,32,80,80,0,8080`\
`EPRT |2|172.32.80.80|8080|`
3. **`LIST`**を使用しますこれは接続された_<IP:Port>_にFTPフォルダー内の現在のファイルのリストを送信するだけですし、可能な応答を確認します`150 File status okay`(これはポートが開いていることを意味します)または`425 No connection established`(これはポートが閉じていることを意味します)
1. `LIST`の代わりに**`RETR /file/in/ftp`**を使用し、同様の`Open/Close`応答を探すこともできます。
**PORT**を使用した例172.32.80.80のポート8080は開いており、ポート7777は閉じています
![](<../../images/image (241).png>)
**`EPRT`**を使用した同じ例(認証は画像に省略されています):
![](<../../images/image (539).png>)
`LIST`の代わりに`EPRT`を使用して開いているポート(異なる環境):
![](<../../images/image (875).png>)
### **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
```
{{#include ../../banners/hacktricks-training.md}}