Netcat

参考:

Netcat for Windows

Linux Netcat 命令——网络工具中的瑞士军刀

8 个实用的 Linux netcat 命令示例

If I am not mistaken, nc comes as a default tool in most of the Linux distros. You can download the windows port of the tool at http://www.securityfocus.com/tools/139

The command to have netcat listen on a specific port is “nc -l PORT_NUMBER”. If you run this on a Windows 7 machine, you will get this dreaded message “local listenfuxored: INVAL”. The fix is to run it with a -L option. So the command would like this

nc -L -p 80

The -L means “listen harder, re-listen on socket close” :).. Have to dig deeper and see what it really means though. I will leave that for another blog post.

And if you want to validate that netcat is indeed listening on that port, you can connect to that port from another workstation by using nmap.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
什么是nc nc是netcat的简写,有着网络界的瑞士军刀美誉。因为它短小精悍、功能实用,被设计为一个简单、可靠的网络工具 nc的作用 (1)实现任意TCP/UDP端口的侦听,nc可以作为server以TCP或UDP方式侦听指定端口 (2)端口的扫描,nc可以作为client发起TCP或UDP连接 (3)机器之间传输文件 (4)机器之间网络测速                                                                                                                                                                                                                         nc的控制参数不少,常用的几个参数如下所列: 1) -l 用于指定nc将处于侦听模式。指定该参数,则意味着nc被当作server,侦听并接受连接,而非向其它地址发起连接。 2) -p 暂未用到(老版本的nc可能需要在端口号前加-p参数,下面测试环境是centos6.6,nc版本是nc-1.84,未用到-p参数) 3) -s  指定发送数据的源IP地址,适用于多网卡机  4) -u  指定nc使用UDP协议,默认为TCP 5) -v 输出交互或出错信息,新手调试时尤为有用 6)-w 超时秒数,后面跟数字  7)-z 表示zero,表示扫描时不发送任何数据       前期准备 准备两台机器,用于测试nc命令的用法 主机A:ip地址 10.0.1.161 主机B:ip地址 10.0.1.162   两台机器先安装nc和nmap的包 yum install nc -y yum install nmap -y 如果提示如下-bash: nc: command not found 表示没安装nc的包 ———————————————— 版权声明:本文为CSDN博主「小毛毛2013」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/u012486730/article/details/82019996

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值