2013年6月27日星期四

NetCat 命令监听本地端口

今天打算用 nc ( netcat ) 命令做一个简单的本地监听,以测试防火墙是否封锁了某个端口。
网上很多文章上都是这样写:
    nc -l -p $PORT
但是在我的 CentOS 5u4 上确实不能正确执行成功,一直提示语法错误。
后来查看 nc 的 man 手册,关于 -l 选项,里面这样写着:
     -l      Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host. It is an error to use this option in conjunction with the -p, -s, or -z options. Additionally, any timeouts specified with the -w option are ignored.

因此正确的写法应该是:
    nc -l $PORT
这样就直接监听本地的 $PORT 端口了。

费解,不知道是不是因为 CenOS 5u4 上的 nc 版本太旧的缘故。

没有评论:

发表评论

使用 Charles 及旧版本 iTunes 下载旧版本 iOS APP

注意:吾爱破解论坛发布的一系列自动化下载软件,比如 iOS APP Store 旧版应用下载 5.1 什么的都不好用,目前只能手动通过 Charles 截留并修改旧版本 iTunes HTTPS 请求达到下载旧版本应用的目的。 从 iOS APP Store 下载的软件都是与用户...