新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - 编程开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 操作系统 > Unix系统 > Solaris > 正文:Solaris 系统中的snoop命令详解(上)

Solaris 系统中的snoop命令详解(上)

新客网 XKER.COM 2008-03-09 来源: 收藏本文

  先简单回顾一下snoop的命令参数和用法。

  snoop本身能够运行在以太网环境下的solaris系统中,然后依靠网卡的混杂模式从网络中读取流过的所有数据包,当然,这依赖于网络必须是共享式以太网(使用Hub),或者在Switch上配置SPAN功能把所有流量镜像到snoop所运行的机器。如果网络是运行在除以上两者之外的交换网络上的话,那么snoop只能够获取到广播数据,以及发往主机自身的数据。

  snoop本身支持以太网帧(ethernet frame),TCP|UDP/IP协议,以及之上的一些应用层协议,例如X,RPC,NFS。大家都知道,作为一个优秀的网络分析工具,必须具备良好的宏观和微观两方面的分析能力,而Sniffer类的工具,则更突出在他的微观-数据解析和分析能力方面,这就依赖于工具所能够理解和解析的网络协议(应用协议)类型数量,比如作为网络分析工具无冕之王的Ethereal就能够理解超过六百种不同的网络协议。这方面恰恰是snoop的劣势所在,所以传统的snoop仅仅是作为简单的sniffer类工具来使用的,chaosreader恰恰弥补了snoop在这方面的缺点,同时在Session分析和数据可视化重现方面大大加强了它的功能。

  Chaosreader主页:

  http://users.tpg.com.au/bdgcvb/chaosreader.html

  下载地址:

  http://users.tpg.com.au/bdgcvb/chaosreader

  在Solaris系统里,只要直接运行/usr/sbin/snoop就可以启动一个监听进程:

  ================================

  [tracy@ketty]# /usr/sbin/snoop

  Using device /dev/pcn0 (promiscuous mode)

  192.168.0.2 -> Katty TELNET C port=1366

  Katty -> 192.168.0.2 TELNET R port=1366 Using device /dev/pc

  192.168.0.2 -> Katty TELNET C port=1366

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  .......(省略telnet协商过程)

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368 \377\376\1login:

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368 e

  Katty -> 192.168.0.2 TELNET R port=1368 e

  192.168.0.2 -> Katty TELNET C port=1368 l

  Katty -> 192.168.0.2 TELNET R port=1368 l

  192.168.0.2 -> Katty TELNET C port=1368 l

  Katty -> 192.168.0.2 TELNET R port=1368 l

  192.168.0.2 -> Katty TELNET C port=1368 y

  Katty -> 192.168.0.2 TELNET R port=1368 y

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368 Password:

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368 e

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368 l

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368 l

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368 y

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368 Last login: Tue Feb

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368 Sun Microsystems Inc

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368 w

  Katty -> 192.168.0.2 TELNET R port=1368 w

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368 e

  Katty -> 192.168.0.2 TELNET R port=1368 e

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368 x

  Katty -> 192.168.0.2 TELNET R port=1368 x

  192.168.0.2 -> Katty TELNET C port=1368 i

  Katty -> 192.168.0.2 TELNET R port=1368 i

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368 t

  Katty -> 192.168.0.2 TELNET R port=1368 t

  192.168.0.2 -> Katty TELNET C port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368 logout\r\n

  192.168.0.2 -> Katty TELNET C port=1368

  Katty -> 192.168.0.2 TELNET R port=1368

  =================================

  在上面这个范例中,我们用snoop监视了一个telnet会话,简要过程如下:

  Client Server

  1 <----------> TCP三步握手

  2 <----------> Telnet协议协商

  3 <----------- 发送Login:提示

  4 -----------> Username: elly

  5 <----------- 发送Pass:提示

  6 -----------> Password: elly

  7 <----------- 认证通过,返回MOTD和PS提示符

  8 -----------> 发送命令,执行w

  9 <----------- 返回结果

  10 -----------> 发送命令,执行exit

  11 <----------> 断开连接

  ===================================

  login: elly

  Password:

  Last login: Tue Feb 15 18:03:14 from 192.168.0.2

  Sun Microsystems Inc. SunOS 5.10 Generic January 2005

  [elly@Katty]$ w

  下午 6点03分 运行 49 分钟 4 用户, 平均负载:0.04, 0.02, 0.14

  用户名 终端号 登入时间 闲置 JCPU PCPU 执行命令

  root console 下午 5点30分 34 1 /usr/dt/bin/sdt_shell

  -c ? u

  root pts/2 下午 5点26分 1 1 bash

  root pts/5 下午 5点35分 23 bash

  elly pts/6 下午 6点02分 snoop

  elly pts/7 下午 6点03分 w

  [elly@Katty]$ exit

  logout

共2页: 上一页 [1] [2] 下一页
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐