posts - 297,  comments - 15,  trackbacks - 0

linux下的nc命令中,-l后跟随监听端口,-p后跟随与目标主机建立连接时的本地端口,二者不可能同时使用。

 

nc -l 1234

nc 127.0.0.1 1234
在端口1234建立连接,互相发送输入

nc -p 1234 -w 5 host.example.com 80
建立从本地1234端口到host.example.com的80端口连接,5秒超时
nc -u host.example.com 53
u为UDP连接

echo -n "GET / HTTP/1.0"r"n"r"n" | nc host.example.com 80
连接到主机并执行

nc -v -z host.example.com 70-80
扫描端口(70到80),可指定范围。-v输出详细信息。

转自:
posted on 2010-01-12 21:14 chatler 阅读(583) 评论(0)  编辑 收藏 引用 所属分类: Linux_SysAdmin

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2010年1月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456

常用链接

留言簿(10)

随笔分类(307)

随笔档案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感觉这个博客还是不错,虽然做的东西和我不大相关,觉得看看还是有好处的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新评论

阅读排行榜

评论排行榜