使用netcat(瑞士军刀)进行文件传输
2016-01-30 00:00
447 查看
nc(netcat)被誉为网络工具中的“瑞士军刀”,体积虽小但功能强大,nc最简单的功能是端口扫描,这里我主要笔记一下它作为文件传输的妙用。
首先看一下帮助信息。
端口扫描:
简单文件传输:
客户端:
服务端:
也可以是
服务端ip是192.169.1.11,端口是1234
如此,当两台linux机器需要简单传输文件时,再好不过了~
Linux利用nc命令监控服务器端口的方法
首先看一下帮助信息。
$ nc -h OpenBSD netcat (Debian patchlevel 1.105-7ubuntu1) This is nc from the netcat-openbsd package. An alternative nc is available in the netcat-traditional package. usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length] [-P proxy_username] [-p source_port] [-q seconds] [-s source] [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] [destination] [port] Command Summary: -4 Use IPv4 -6 Use IPv6 -b Allow broadcast -C Send CRLF as line-ending -D Enable the debug socket option -d Detach from stdin -h This help text -I length TCP receive buffer length -i secs Delay interval for lines sent, ports scanned -j Use jumbo frame -k Keep inbound sockets open for multiple connects -l Listen mode, for inbound connects -n Suppress name/port resolutions -O length TCP send buffer length -P proxyuser Username for proxy authentication -p port Specify local port for remote connects -q secs quit after EOF on stdin and delay of secs -r Randomize remote ports -S Enable the TCP MD5 signature option -s addr Local source address -T toskeyword Set IP Type of Service -t Answer TELNET negotiation -U Use UNIX domain socket -u UDP mode -V rtable Specify alternate routing table -v Verbose -w secs Timeout for connects and final net reads -X proto Proxy protocol: "4", "5" (SOCKS) or "connect" -x addr[:port] Specify proxy address and port -Z DCCP mode -z Zero-I/O mode [used for scanning] Port numbers can be individual or ranges: lo-hi [inclusive]
端口扫描:
$ nc -z -v -n 127.0.0.1 20-100 ... Connection to 127.0.0.1 80 port [tcp/*] succeeded! ...
简单文件传输:
客户端:
$ nc -l 192.168.1.11 1234 > passwd.txt &
服务端:
$ nc 192.168.1.11 1234 < /etc/passwd
也可以是
cat /etc/passwd | nc 192.168.1.11 1234
服务端ip是192.169.1.11,端口是1234
如此,当两台linux机器需要简单传输文件时,再好不过了~
您可能感兴趣的文章:
Linux命令行里的“瑞士军刀”Linux利用nc命令监控服务器端口的方法
相关文章推荐
- python 爬取微信文章
- mongodb使用心得简单总结
- 深入分析Javascript事件代理
- 深入探秘jquery瀑布流的实现
- 实现高性能JavaScript之执行与加载
- JavaScript中的this机制
- JS排序方法(sort,bubble,select,insert)代码汇总
- 22个CSS黑魔法
- 新时代网站必备jQuery插件
- Java程序员使用的20几个大数据工具
- 我和程序猿男友在一起的苦逼生活
- 春晚没有请六小龄童,假如我们程序猿去会怎么样?
- 【一些事晚报】张小龙的2359篇日记说的是啥
- 支付宝集福红包,为何陷入“人情”消耗的囚徒困境?
- 除了游戏和 A 片,VR 技术的应用领域还有这些
- 七星级产品经理张小龙做产品也会痛苦!他有3句狠话值得学习
- 只是看电影、玩游戏?这些奇葩VR让你脑洞大开
- 今年微信和支付宝的红包玩法,都是烂设计主导!
- 数据迁移
- JavaScript基础—插曲02