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 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
11月前
Uncaught DOMException: Blocked a frame with origin "http://localhost:8000" from accessing a cross-origin frame.
Uncaught DOMException: Blocked a frame with origin "http://localhost:8000" from accessing a cross-origin frame.
209 0
|
Web App开发 安全 前端开发
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
314 0
Mixed Content: The page at was loaded over HTTPS, but requested an insecure imag
|
iOS开发 MacOS
curl: (4) A requested feature, protocol or option was not found
curl: (4) A requested feature, protocol or option was not found
215 0
curl: (4) A requested feature, protocol or option was not found
|
Web App开发 网络安全
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute
Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute在这里插入图片描述
2061 0
|
Java 应用服务中间件 Python
Refused to display 'xxx' in a frame ,because it set 'X-Frame-Options' to 'deny'.
我本是在DJANGO页面的iframe里嵌入springboot的页面。 当报了这个错误之后,我花了时间在nginx和django上, 后来才改变解决思路,从springboot出发,解决问题。
5653 0
|
Android开发
How to determine whether your http request starting from localhost is correctly forwarded
Created by Jerry Wang, last modified on Mar 09, 2015 Requirement: you are using WebIDE to run your application. The metadata request is sent by WebUDE via the following url:
94 0
How to determine whether your http request starting from localhost is correctly forwarded
|
数据可视化
成功解决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