144.4. ncat - Concatenate and redirect sockets

简介:

nc - TCP/IP swiss army knife

按照 ncat

# yum search nc | grep nmap
nmap-ncat.x86_64 : Nmap's Netcat replacement

yum install nmap-ncat
		

144.4.1. TCP 数据传输

Server

nc -l 8080 > test.txt
			

Client

cat /etc/hosts | nc your_server 8080
			

144.4.2. UDP 数据传输

Server 端

nc -4 -u -l 9000
			

Client 端

cat /etc/passwd | nc -4 -u 47.90.1.240 9000
			

144.4.3. 始终保持服务器开启

-k, --keep-open Accept multiple connections in listen mode

# nc -l 8087 -k
			

这是你可以持续想服务器端发送数据

144.4.4. 传输视频流

服务端,这里我们从一个视频文件中读入并重定向输出到netcat客户端

$cat video.avi | nc -l 3000
			

客户端,从socket中读入数据并通过管道传递给 mplayer播放该视频。

$nc 172.16.0.10 3000 | mplayer -vo x11 -cache 3000 -			
			




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
7月前
|
网络安全 数据安全/隐私保护
basic-ftp 550 Can't check for file existence
basic-ftp 550 Can't check for file existence
|
8月前
|
开发工具 git
解决 HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
解决 HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
783 0
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
|
iOS开发 MacOS
curl: (4) A requested feature, protocol or option was not found
curl: (4) A requested feature, protocol or option was not found
213 0
curl: (4) A requested feature, protocol or option was not found
|
数据可视化
成功解决graphviz\backend.py", line 162, in pipe raise ExecutableNotFound(args) graphviz.backend.Executab
成功解决graphviz\backend.py", line 162, in pipe raise ExecutableNotFound(args) graphviz.backend.Executab
goods_type和disable_pay_channels和enable_pay_channels区别
说明:   为防止用户使用花呗分期套现,需要禁止使用花呗分期。如果商家在虚拟商品交易中使用花呗分期支付,一经发现关闭花呗分期权限。禁用花呗分期方法   注意:goods_type如果传值为0,信用卡渠道也是不可以使用的。
1123 0
|
Python
解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
解决pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
79551 0

热门文章

最新文章