设为首页 收藏本站
查看: 2018|回复: 0

[经验分享] redhat 安装 snort

[复制链接]

尚未签到

发表于 2018-5-12 14:27:08 | 显示全部楼层 |阅读模式
  1.下载下面网址列出的所有列出的软件
  http://www.snort.org/start/requirements

  • Libpcap
  • PCRE
  • Libdnet
  • Barnyard2
  • DAQ
  Note to Windows users: If you’re downloading Snort binaries the only requirements are WinPcap and Barnyard.
  Libpcap
  In the field of computer network administration, pcap (packet capture) consists of an application programming interface (API) for capturing network traffic. Unix-like systems implement pcap in the libpcap library; Windows uses a port of libpcap known as WinPcap.
  Monitoring software may use libpcap and/or WinPcap to capture packets traveling over a network. libpcap and WinPcap also support saving captured packets to a file and reading files containing saved packets. Snort uses these files to read network traffic and analyze it.
  For more information and to download please visit tcpdump
  PCRE
  Perl Compatible Regular Expressions (PCRE) is a regular expression C library inspired by Perl’s external interface, written by Philip Hazel. The PCRE library is incorporated into a number of prominent open-source programs such as the Apache HTTP Server, the PHP and R scripting languages, and Snort.
  For more information and to download please visit PCRE
  Libdnet
  Libdnet is a generic networking API that provides access to several protocols.
  For more information and to download please visit libdnet
  Barnyard2
  Barnyard is an output system for Snort. Snort creates a special binary output format called ``unified.’’ Barnyard2 reads this file, and then resends the data to a database back-end. Unlike the database output plugin, Barnyard2 manages the sending of events to the database and stores them when the database temporarily cannot accept connections.
  For more information and to download please visit barnyard2
  DAQ
  DAQ is the Data-Acquisition API that is necessary to use Snort version 2.9.0 and above.
  For more information and to download please visit DAQ
Next: Download Snort
  2.如果需要apache ,php ,mysql,snort,acid支持,还需要下载上述软件
  参考 http://shenjianzhousx.blog.51cto.com/1627247/454480
  3../configute snort过程中出现
  ERROR! Libpcap library version >= 1.0.0 not found.
  请参考
  https://forums.snort.org/forums/snort-newbies/topics/libpcap-not-found
  First it is important to note that libpcap is found, just not a version that is >=1.0.0. Notice the message above the one you posted says "checking for pcap_lib_version" = "yes". Then the line you posted indicates a failure because libpcap is not recent enough:
  checking for pcap_lib_version… checking for pcap_lib_version in -lpcap… yes
checking for libpcap version >= "1.0.0"… no
  ERROR! Libpcap library version >= 1.0.0 not found. Get it from <a href=&quot;http://www.tcpdump.org&quot;>http://www.tcpdump.org</a>
  It appears libpcap-1.1.1.tar.gz installs the library into /usr/local/lib. I tried to force daq to use that library as mentioned in the link Quiltface provided, but it did not work. This lead me to look for another version of libpcap which may be the one that daq is inspecting. I ended up finding another version which was much older:
  root@xxxx:# locate libpcap
/usr/lib/libpcap.a
/usr/local/lib/libpcap.a
  root@xxxx:# ls l /usr/lib/libpcap.a
-rw-r-r— 1 root root 228262 2008-04-08 22:19 /usr/lib/libpcap.a
  root@xxxx:# ls l /usr/local/lib/libpcap.a
-rw-r-r— 1 root root 293658 2011-01-01 22:37 /usr/local/lib/libpcap.a
  I copied the new one over the old one and daq compiled and installed without issue:
  root@xxxx:# cp /usr/local/lib/libpcap.a /usr/lib/
  checking for pcap_lib_version… checking for pcap_lib_version in -lpcap… yes
checking for libpcap version >= &quot;1.0.0&quot;… yes
  4.运行snort过程中出现没有找到规则,添加规则或“#”掉。
  出现其他错误请参考:http://www.iyunv.com/Article/201008/54546.html

一、执行# snort -c /usr/local/snort/etc/snort.conf的时候出现的三个问题:
1、
ERROR: parser.c(5047) Could not stat dynamic module path &quot;/usr/local/lib/snort_dynamicengine/libsf_engine.so&quot;: No such file or directory.

  Fatal Error, Quitting..
原因:没有找到/usr/local/lib/snort_dynamicengine/libsf_engine.so文件所在的目录。
解决:将snort安装目录下lib目录内的snort_dynamicpreprocessor目录,创建软链接到/usr/local/lib下面。
如:ln -s /usr/local/snort/lib/snort_dynamicpreprocessor /usr/local/lib/snort_dynamicpreprocessor

2、
ERROR: parser.c(5047) Could not stat dynamic module path &quot;/usr/local/lib/snort_dynamicengine/libsf_engine.so&quot;: No such file or directory.
  Fatal Error, Quitting..
原因:没有找到/usr/local/lib/snort_dynamicengine/libsf_engine.so文件所在的目录。
解决:将snort安装目录下lib目录内的snort_dynamicengine目录,创建软链接到/usr/local/lib下面。
如:ln -s /usr/local/snort/lib/snort_dynamicengine /usr/local/lib/snort_dynamicengine

3、
ERROR: parser.c(5047) Could not stat dynamic module path &quot;/usr/local/lib/snort_dynamicrules/bad-traffic.so&quot;: No such file or directory.
  Fatal Error, Quitting..
原因:没有找到/usr/local/lib/snort_dynamicrules/bad-traffic.so文件所在的目录。
解决:将snort安装目录下so_rules/precompiled/Centos-5-4/i386/2.8.6.0目录,创建软链接到/usr/local/lib下面。
如:ln -s /usr/local/snort/so_rules/precompiled/Centos-5-4/i386/2.8.6.0 /usr/local/lib/snort_dynamicrules
(请按实际情况选择正确的操作系统的版本及CPU类型)

二、在编译安装snort过程中提示:
ERROR: /usr/local/snort/etc/snort.conf(193) => Invalid keyword compress_depth for global configuration.
原因:在编译的时候没有带--enable-zlib
解决:清除所有已编译安装的snort信息,再进行编译安装,编译的时候带上--enable-zlib参数。
注:我在进行重新覆盖编译(带--enable-zlib参数)安装,没有成功,不知道是必须清空以前的snort信息,还是RP有问题。

三、在进行base的web配置的时候提示:
Your PHP Logging Level is too high to handle the running of BASE!
Please set the error_reporting variable to at least E_ALL & ~E_NOTICE in your php.ini!
The directory where BASE is installed does not allow the web server to write.
This will prevent the setup progam from creating the base_conf.php file. You have two choices.
1. Make the directory writeable for the web server user.
2. When the set up is done, copy the information displayed to the screen and use it to create a base_conf.php.

原因:
0、提示运行base的记录的PHP日志级别太高。
1、snort的web目录没有写权限;
2、base_conf.php内的参数有问题;
解决:
0、编辑php.ini,找到error_reporting,修改为:error_reporting = E_ALL & ~E_NOTICE
1、将snort的web目录权限修改为757或777
2、将相关的参数(snort数据库名称、用户名、密码、数据库类型、数据库位置等信息)设置在base_conf.php文件内。

四、Not Using PCAP_FRAMES
解决:
# export PCAP_FRAMES=&quot;Foo Bar This setting has no impact on my libpcap instance&quot;
(修改用户的环境变量。解决问题的方法出处:http://leonward.wordpress.com/2008/07/18/not-using-pcap_frames-aka-when-good-verbosity-goes-bad/

五、ERROR: The php session does not contain the array key &quot;adodbpath&quot;. This is typically caused by not having allowed cookies. Exiting.
原因:???
解决:???

这个问题我自己也没搞定,待查。

六、在Base的web页面中出现:
Check your Pear::Image_Graph installation!
  * Image_Graph can be found here:at http://pear.veggerby.dk/. Without this library no
  graphing operations can be performed.
    * Make sure PEAR libraries can be found by php at all:
  pear config-show | grep &quot;PEAR directory&quot;
      PEAR directory      php_dir     /usr/share/pear
  This path must be part of the include path of php (cf. /etc/php.ini):
  php -i | grep &quot;include_path&quot;
      include_path => .:/usr/share/pear:/usr/share/php => .:/usr/share/pear:/usr/share/php

原因:Base需要绘图插件Image_Graph,Image_Graph没有安装。
解决:去http://pear.veggerby.dk/下载Image_Canvas及Image_Graph进行安装,也可直接执行下列命令让系统自己下载安装:
# pear install Image_Canvas-0.3.2
downloading Image_Canvas-0.3.2.tgz ...
Starting to download Image_Canvas-0.3.2.tgz (54,698 bytes)
.............done: 54,698 bytes
downloading Image_Color-1.0.4.tgz ...
Starting to download Image_Color-1.0.4.tgz (9,501 bytes)
...done: 9,501 bytes
install ok: channel://pear.php.net/Image_Color-1.0.4
install ok: channel://pear.php.net/Image_Canvas-0.3.2

# pear install Image_Graph-0.7.2
Did not download dependencies: pear/Numbers_Roman, pear/Numbers_Words, use --alldeps or --onlyreqdeps to download automatically
pear/Image_Graph can optionally use package &quot;pear/Numbers_Roman&quot;
pear/Image_Graph can optionally use package &quot;pear/Numbers_Words&quot;
downloading Image_Graph-0.7.2.tgz ...
Starting to download Image_Graph-0.7.2.tgz (368,056 bytes)
.....................................done: 368,056 bytes
install ok: channel://pear.php.net/Image_Graph-0.7.2
(说明:事先必须安装php-pear组件!)
  5。ERROR: snort.conf(387) => Unable to open the IIS Unicode Map file './unicode.map'.
  找到unicode.map copy到提示出错的目录。


  6.其他问题请google。good luck!!!!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-459201-1-1.html 上篇帖子: RedHat Linux as5上安装Zabbix 1.8软件 下篇帖子: RedHat的yum源修改为CentOS的yum源
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表