免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8488 | 回复: 10
打印 上一主题 下一主题

[信息安全] 求助:snort为什么检测不到alert啊! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-05-11 19:47 |只看该作者 |倒序浏览
我好不容易在linux下把snort配置起来了,我用的是snort-2.2.0,规则用的是包里自带的,用林肯实验室数据集
99年第二周的,想生成安全事件,可是检测不出alert,希望高手能给予指点啊!

论坛徽章:
0
2 [报告]
发表于 2007-05-11 20:26 |只看该作者
在这里我把我的安装过程说一下,希望能帮我找出问题所在!不胜感激啊!
我用的是readhat且是通过虚拟机vmware,通过ssh进行的整个安装过程,我的linux系统是完全安装的,而且是新安装的,所以像mysql,php,httpd等都已经有了,能正常启动。假设我的虚拟机的ip是192.168.0.1
1、groupadd snort
     useradd -g snort snort(我是参考别人的安装笔记安装的,对于这一步不是很理解,没有可不可以)
2、我把snort+acid+adodb+jpgraph放在/usr/local/src下了
   cd /usr/local/src
     tar zxvf snort-2.2.0
    ./configure --with-mysql=/usr/include/mysql(我的系统自带mysql,所以不知道这个路径对不对,会不
   会对snort的运行有影响)
   make
    make install
    cd rules(/usr/local/src/snort-2.2.0/rules)
    cp * /etc/snort
    cd ../etc
    cp snort.conf /etc/snort
    cp *.config /etc/snort
    cd /etc/snort
    vi snort.conf
    把“# var HOME_NET 10.1.1.0/24”改成“var HOME_NET 192.168.0.1/24”,把前面的#号去掉。
   把“var RULE_PATH ../rules”改成“var RULE_PATH /etc/snort”
   把“# output database: log, mysql, user=root password=test dbname=db host=localhost”改成“output database: log, mysql, user=root password=123456 dbname=snort host=localhost”密码改成我自己的,把前面的#号去掉。
   把“
     # include $RULE_PATH/web-attacks.rules
       # include $RULE_PATH/backdoor.rules
       # include $RULE_PATH/shellcode.rules
       # include $RULE_PATH/policy.rules
       # include $RULE_PATH/porn.rules
       # include $RULE_PATH/info.rules
       # include $RULE_PATH/icmp-info.rules
       include $RULE_PATH/virus.rules
       # include $RULE_PATH/chat.rules
       # include $RULE_PATH/multimedia.rules
       # include $RULE_PATH/p2p.rules”前面所有的#号删除。 修改完毕后,保存退出。
3、service mysqld start
      mysql
     create database snort;
     grant INSERT,SELECT on root .* to snort@localhost;
     exit;
4、cd /usr/local/src/snort-2.2.0/contrib/mysql<create_mysql snort
     zcat snortdb-extra.ge | mysql snort(这句话有什么作用,我不写路径对不对,我不知道我的系统mysql   
     安装在哪了)
5、我的网页的根目录是/var/www/html
     我把jpgraph  adodb acid都放在这了
   tar zxvf adodb390.tgz
    tar zxvf jpgraph-1.20.5.tar.gz
    mv jpgraph-1.20.5 jpgraph
    tar zxvf ACID-0.9.6b21.tar.gz(这个是snort的包里带的)
    cd acid
    vi acid_conf.php
    把“$DBlib_path = "";”  改成“$DBlib_path = "/var/www/html/adodb"
   $alert_dbname   = "snort_log";  //改成snort
    $alert_host     = "localhost";
    $alert_port     = "";
    $alert_user     = "root";
    $alert_password = "mypassword"; //改成我的数据库密码

   /* Archive DB connection parameters */
    $archive_dbname   = "snort_archive";  //改成snort
    $archive_host     = "localhost";
    $archive_port     = "";
    $archive_user     = "root";
    $archive_password = "mypassword";”  //改成我的数据库密码

   把“$ChartLib_path = "";” 改成“$ChartLib_path = "/var/www/html/jpgraph/src";”
    修改完毕后,保存退出。
6、写一个snort规则(这段话有什么作用啊,里面的ip字段用改成我自己的吗?)
  # cd /usr/local/
   # vi snort.sh
   #!/bin/sh
   snort -d -h 192.168.0.0/24 -l /var/log/snort -c /etc/snort/snort.conf -i eth0 -A full
   # 保存退出。
  # chmod 755 snort.sh
7、service httpd start
    192.168.0.1/acid可以正常显示acid页面

本以为这就ok了,不过后来发现不管snort怎么运行,acid上的各项数据都显示0,现在snort还检测不出alert,实在找不出哪有问题了,希望高人指点啊!我配置snort是为了生成安全事件仓库,做毕设用!

论坛徽章:
0
3 [报告]
发表于 2007-05-11 20:51 |只看该作者
以下是snort对99年第二周周一的林肯实验室数据进行的监测结果,outside.tcpdump
Snort processed 661239 packets.
===============================================================================
Breakdown by protocol:
    TCP: 640269     (96.829%)         
    UDP: 7214       (1.091%)         
   ICMP: 528        (0.080%)         
    ARP: 4262       (0.645%)
  EAPOL: 0          (0.000%)
   IPv6: 0          (0.000%)
    IPX: 0          (0.000%)
  OTHER: 8966       (1.356%)
DISCARD: 0          (0.000%)
===============================================================================
Action Stats:
ALERTS: 0
LOGGED: 0
PASSED: 0
===============================================================================
Fragmentation Stats:
Fragmented IP Packets: 241        (0.036%)
    Fragment Trackers: 0         
   Rebuilt IP Packets: 0         
   Frag elements used: 0         
Discarded(incomplete): 0         
   Discarded(timeout): 0         
  Frag2 memory faults: 0         
===============================================================================
不知是否正常

论坛徽章:
0
4 [报告]
发表于 2007-05-15 17:02 |只看该作者
[root@localhost monday]# snort -r inside.tcpdump -c /etc/snort/snort.conf
Running in IDS mode
Log directory = /var/log/snort
TCPDUMP file reading mode.
Reading network traffic from "inside.tcpdump" file.
snaplen = 66000

        --== Initializing Snort ==--
Initializing Output Plugins!
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /etc/snort/snort.conf

+++++++++++++++++++++++++++++++++++++++++++++++++++
Initializing rule chains...
,-----------[Flow Config]----------------------
| Stats Interval:  0
| Hash Method:     2
| Memcap:          10485760
| Rows  :          4099
| Overhead Bytes:  16400(%0.16)
`----------------------------------------------
No arguments to frag2 directive, setting defaults to:
    Fragment timeout: 60 seconds
    Fragment memory cap: 4194304 bytes
    Fragment min_ttl:   0
    Fragment ttl_limit: 5
    Fragment Problems: 0
    Self preservation threshold: 500
    Self preservation period: 90
    Suspend threshold: 1000
    Suspend period: 30
Stream4 config:
    Stateful inspection: ACTIVE
    Session statistics: INACTIVE
    Session timeout: 30 seconds
    Session memory cap: 8388608 bytes
    State alerts: INACTIVE
    Evasion alerts: INACTIVE
    Scan alerts: INACTIVE
    Log Flushed Streams: INACTIVE
    MinTTL: 1
    TTL Limit: 5
    Async Link: 0
    State Protection: 0
    Self preservation threshold: 50
    Self preservation period: 90
    Suspend threshold: 200
    Suspend period: 30
Stream4_reassemble config:
    Server reassembly: INACTIVE
    Client reassembly: ACTIVE
    Reassembler alerts: ACTIVE
    Zero out flushed packets: INACTIVE
    flush_data_diff_size: 500
    Ports: 21 23 25 53 80 110 111 143 513 1433
    Emergency Ports: 21 23 25 53 80 110 111 143 513 1433
HttpInspect Config:
    GLOBAL CONFIG
      Max Pipeline Requests:    0
      Inspection Type:          STATELESS
      Detect Proxy Usage:       NO
      IIS Unicode Map Filename: /etc/snort/unicode.map
      IIS Unicode Map Codepage: 1252
    DEFAULT SERVER CONFIG:
      Ports: 80 8080 8180
      Flow Depth: 300
      Max Chunk Length: 500000
      Inspect Pipeline Requests: YES
      URI Discovery Strict Mode: NO
      Allow Proxy Usage: NO
      Disable Alerting: NO
      Oversize Dir Length: 500
      Only inspect URI: NO
      Ascii: YES alert: NO
      Double Decoding: YES alert: YES
      %U Encoding: YES alert: YES
      Bare Byte: YES alert: YES
      Base36: OFF
      UTF 8: OFF
      IIS Unicode: YES alert: YES
      Multiple Slash: YES alert: NO
      IIS Backslash: YES alert: NO
      Directory Traversal: YES alert: NO
      Web Root Traversal: YES alert: YES
      Apache WhiteSpace: YES alert: YES
      IIS Delimiter: YES alert: YES
      IIS Unicode Map: GLOBAL IIS UNICODE MAP CONFIG
      Non-RFC Compliant Characters: NONE
rpc_decode arguments:
    Ports to decode RPC on: 111 32771
    alert_fragments: INACTIVE
    alert_large_fragments: ACTIVE
    alert_incomplete: ACTIVE
    alert_multiple_requests: ACTIVE
telnet_decode arguments:
    Ports to decode telnet on: 21 23 25 119
database: compiled support for ( mysql )
database: configured to use mysql
database:          user = root
database: password is set
database: database name = snort
database:          host = localhost
database:   sensor name = localhost.localdomain:[reading from a file]
database:     sensor id = 2
database: schema version = 106
database: using the "log" facility
2193 Snort rules read...
2193 Option Chains linked into 244 Chain Headers
0 Dynamic rules
+++++++++++++++++++++++++++++++++++++++++++++++++++


+-----------------------[thresholding-config]----------------------------------
| memory-cap : 1048576 bytes
+-----------------------[thresholding-global]----------------------------------
| none
+-----------------------[thresholding-local]-----------------------------------
| gen-id=1      sig-id=2275       type=Threshold tracking=dst count=5   seconds=60
| gen-id=1      sig-id=2523      type=Both       tracking=dst count=10  seconds=10
| gen-id=1      sig-id=2494      type=Both       tracking=dst count=20  seconds=60
| gen-id=1      sig-id=2496      type=Both       tracking=dst count=20  seconds=60
| gen-id=1      sig-id=2495      type=Both       tracking=dst count=20  seconds=60
+-----------------------[suppression]------------------------------------------
-------------------------------------------------------------------------------
Rule application order: ->activation->dynamic->alert->pass->log

        --== Initialization Complete ==--

-*> Snort! <*-
Version 2.2.0 (Build 30)
By Martin Roesch (roesch@sourcefire.com, www.snort.org)
已经搞定了,用99年的林肯实验室数据集中的两个tcpdump包做实验,一共产生了一万多个安全事件,在acid 页面上也能正常显示,爽啊!

论坛徽章:
0
5 [报告]
发表于 2007-05-16 11:03 |只看该作者
总结之前出现问题的原因:
我在装snort的时候./configure --with-mysql=DIR的路径指的有问题,我的系统是已经装好mysql的,
所以在重新安装的时候我直接./configure --with-mysql,并且在重装之前把snort卸载干净,
重新configure,make,make install,这样再次运行snort的时候就会发现正确连接到数据库了
database: compiled support for ( mysql )
database: configured to use mysql
database:          user = root
database: password is set
database: database name = snort
database:          host = localhost
database:   sensor name = localhost.localdomain:[reading from a file]
database:     sensor id = 2
database: schema version = 106
database: using the "log" facility
看到这些的时候真是太激动了,终于解决了一个大问题!

论坛徽章:
0
6 [报告]
发表于 2007-05-16 15:49 |只看该作者

acid

检测结果

论坛徽章:
0
7 [报告]
发表于 2007-05-16 15:52 |只看该作者
Sensors: 2
Unique Alerts: 60    (   12 categories   )
Total Number of Alerts: 11136
Source IP addresses: 54
Dest. IP addresses: 84
Unique IP links 343

Source Ports: 451
TCP ( 450)  UDP ( 1)
Dest. Ports: 388
TCP ( 387)  UDP ( 1)
Traffic Profile by ProtocolTCP (27%)  
   
UDP (48%)  
   
ICMP (25%)  
   


--------------------------------------------------------------------------------

Portscan Traffic (0%)

论坛徽章:
0
8 [报告]
发表于 2007-05-22 18:00 |只看该作者

我也用的林肯数据星期三的。

我用星期三的数据outside测试snort2。6 ,报警的149条,
用星期一的outside测试,报警489条,
怎么和你的相差很多啊,

论坛徽章:
0
9 [报告]
发表于 2007-05-28 15:31 |只看该作者
原帖由 jerson226 于 2007-5-22 18:00 发表
我用星期三的数据outside测试snort2。6 ,报警的149条,
用星期一的outside测试,报警489条,
怎么和你的相差很多啊,

你是怎么测的啊?不知道是不是我的方法又有问题啊

论坛徽章:
0
10 [报告]
发表于 2007-05-28 15:34 |只看该作者
原帖由 jerson226 于 2007-5-22 18:00 发表
我用星期三的数据outside测试snort2。6 ,报警的149条,
用星期一的outside测试,报警489条,
怎么和你的相差很多啊,

你用的是第几周的数据啊?我用的是第二周的,第一和第三周好像没有攻击啊!我用的是99年的!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP