Home netcat使用
Post
Cancel

netcat使用

传递文件

单个文件

1
nc -l -p 1234 > out.file

will begin listening on port 1234.

1
nc -w 3 [destination] 1234 < out.file

will connect to the receiver and begin sending file.

多个文件

On the receiving end,

1
nc -l -p 1234 | uncompress -c | tar xvfp -

On the sending end,

1
tar cfp - /some/dir | compress -c | nc -w 3 [destination] 1234

python方法

除了使用nc进行文件传输外,还可以使用python自带的http file server模块,无需下载nc

python2

1
python -m SimpleHTTPServer <port>

python3

1
python3 -m http.server <port>

这两个都是相对路径的文件共享,直接使用curl命令下载即可,例如共享文件夹内有a.txt

1
curl -O http://<ip>:<port>/a.txt
This post is licensed under CC BY 4.0 by the author.

Nas通过Frp暴露到外网

PT plugin plus chrome安装