Working with Snort Rules

网络入侵检测--Snort软件安装 介绍了snort在centos下的安装部署及简单使用 阅读详情

3.9 Automatically Updating Snort Rules

There are multiple tools available to update Snort signatures. When using any of these tools you must be careful because you may accidentally modify or delete your customized rules. I shall discuss two methods of updating rules.

3.9.1 The Simple Method

This method consists of a simple shell script. It requires that you have wget program installed on your system. The wget program is used to retrieve any file using HTTP protocol. In essence, it is just like a web browser, but it retrieves one file from a command line argument.

#!/bin/sh
# Place of storing your Snort rules. Change these variables
# according to your installation.

RULESDIR=/etc/snort
RULESDIRBAK=/etc/snort/bak

# Path to wget program. Modify for your system if needed.
WGETPATH=/usr/bin

# URI for Snort rules
RULESURI=http://www.snort.org/downloads/snortrules.tar.gz

# Get and untar rules.
cd /tmp
rm -rf rules
$WGETPATH/wget $RULESURI

tar -zxf snortrules.tar.gz
rm –f snortrules.tar.gz

# Make a backup copy of existing rules
mv $RULESDIR/*.rules $RULESDIRBAK

# Copy new rules to the location
mv /tmp/rules/*.rules $RULESDIR

Let us explore how this script works. The following lines simply set some variables.

RULESDIR=/etc/snort
RULESDIRBAK=/etc/snort/bak
WGETPATH=/usr/bin
RULESURI=http://www.snort.org/downloads/snortrules.tar.gz

The following three lines are used to go to /tmp directory, remove any existing directory /tmp/rules and download the snortrules.tar.gz file from the URI specified by the $RULESURI variable.

cd /tmp
rm -rf rules
$WGETPATH/wget $RULESURI

After downloading, you extract the rules files from snortrules.tar.gz file and then delete it using the following two lines. The files extracted are placed in /tmp/rules directory.

tar -zxf snortrules.tar.gz
rm -f snortrules.tar.gz

The following line makes a backup copy of existing rules files, just in case you need the old copy later on.

mv $RULESDIR/*.rules $RULESDIRBAK

The last line in the script moves new rules from /tmp/rules directory to the actual rules directory /etc/snort where Snort can read them.

mv /tmp/rules/*.rules $RULESDIR

Make sure to restart Snort after running this script. If you have a start script like the one described in Chapter 2, you can add a line at the end of the shell script to restart Snort.

/etc/init.d/snortd restart

You may also restart Snort using the command line.

3.9.2 The Sophisticated and Complex Method

This section provides information about the use of Oinkmaster found at http://www.algonet.se/~nitzer/oinkmaster/. Oinkmaster is a tool to update Snort rule files. It is written in Perl, so you must have Perl installed on your Snort machine to make this tool work. It can be configured to download new rule files from the Internet, find out what rules need to be updated and then updates them. If you have modified some standard rules according to your own requirements, you can configure Oinkmaster not to update these customized rules. At the time of writing this book, version 0.6 of this tool is available. By now updated versions may be available. Oinkmaster is a Perl script and uses a configuration file to update the rules.

It is recommended that you use a temporary directory the first time you use this Perl script. I have used /tmp/rules directory. When you use the following command, it will download all rules, untar them and save all files in /tmp/rules directory.

[rr@conformix]$ ./oinkmaster.pl -o /tmp/rules/
   Downloading rules archive from http://www.snort.org/dl/signatures/snortrules.tar.gz...
   12:27:09 URL:http://www.snort.org/dl/signatures/snortrules.tar.gz [79487/79487] -> "/tmp/
   graphics/ccc.gifoinkmaster.9875/snortrules.tar.gz" [1]
   Archive successfully downloaded, unpacking... tar: rules/attack-responses.rules: time 
   graphics/ccc.gifstamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/classification.config: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/sid-msg.map: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/x11.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-misc.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-iis.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-frontpage.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-coldfusion.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-cgi.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/web-attacks.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/virus.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/tftp.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/telnet.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/sql.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/smtp.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/shellcode.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/scan.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/rservices.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/rpc.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/porn.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/policy.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/netbios.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/misc.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/local.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/info.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/icmp.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/icmp-info.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/ftp.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/finger.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/exploit.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/dos.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/dns.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/ddos.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/bad-traffic.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/backdoor.rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules/snort.conf: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   tar: rules: time stamp 2002-07-14 13:10:24 is 348194 s in the future
   done.
   Disabling rules according to ./oinkmaster.conf... 0 rules disabled.
   Comparing new files to the old ones... done.
   
   [***] Results from Oinkmaster started Wed Jul 10 12:25:37 2002 [***]
   
   [*] Rules added/removed/modified: [*]
   
   [+++]           Added:           [+++]
   
   -> File "tftp.rules":
   alert udp any any -> any 69 (msg:"TFTP GET shadow"; content: "|0001|"; offset:0; 
   graphics/ccc.gifdepth:2; content:"shadow"; nocase; classtype:successful-admin; sid:1442; rev:1;)
   alert udp any any -> any 69 (msg:"TFTP GET passwd"; content: "|0001|"; offset:0; 
   graphics/ccc.gifdepth:2; content:"passwd"; nocase; classtype:successful-admin; sid:1443; rev:1;)
   alert udp $EXTERNAL_NET any -> $HOME_NET 69 (msg:"TFTP parent directory"; content:
   graphics/ccc.gif".."; reference:arachnids,137; reference:cve,CVE-1999-0183; classtype:bad-unknown; sid:
   graphics/ccc.gif519; rev:1;)
   
   [///]       Modified active:     [///]
   
   -> File "tftp.rules":
   Old: alert udp $EXTERNAL_NET any -> $HOME_NET 64 (msg:"TFTP Put"; content:"|00 
   graphics/ccc.gif02|"; offset:0; depth:2; reference:cve,CVE-1999-0183; reference:arachnids,148; classtype:
   graphics/ccc.gifbad-unknown; sid:518; rev:3;)
   New: alert udp $EXTERNAL_NET any -> $HOME_NET 69 (msg:"TFTP Put"; content:"|00 
   graphics/ccc.gif02|"; offset:0; depth:2; reference:cve,CVE-1999-0183; reference:arachnids,148; classtype:
   graphics/ccc.gifbad-unknown; sid:518; rev:3;)
   
   
   [*] Non-rule lines added/removed: [*]
   None.
   
   [*] Added files: [*]
   None.
   

The tool gives you a detailed report of actions taken during the update process. You can test this by deleting and modifying some rules and running the tool again. The following is a partial output seen when Oinkmaster adds and updates some rules.

Comparing new files to the old ones... done.

[***] Results from Oinkmaster started Wed Jul 10 12:25:37 2002 [***]

[*] Rules added/removed/modified: [*]

  [+++]           Added:           [+++]

    -> File "tftp.rules":
       alert udp any any -> any 69 (msg:"TFTP GET shadow"; content: "|0001|"; offset:0; 
graphics/ccc.gifdepth:2; content:"shadow"; nocase; classtype:successful-admin; sid:1442; rev:1;)
   alert udp any any -> any 69 (msg:"TFTP GET passwd"; content: "|0001|"; offset:0; 
   graphics/ccc.gifdepth:2; content:"passwd"; nocase; classtype:successful-admin; sid:1443; rev:1;)
   alert udp $EXTERNAL_NET any -> $HOME_NET 69 (msg:"TFTP parent directory"; content:
   graphics/ccc.gif".."; reference:arachnids,137; reference:cve,CVE-1999-0183; classtype:bad-unknown; sid:
   graphics/ccc.gif519; rev:1;)
   
   [///]       Modified active:     [///]
   
   -> File "tftp.rules":
   Old: alert udp $EXTERNAL_NET any -> $HOME_NET 64 (msg:"TFTP Put"; content:"|00 
   graphics/ccc.gif02|"; offset:0; depth:2; reference:cve,CVE-1999-0183; reference:arachnids,148; classtype:
   graphics/ccc.gifbad-unknown; sid:518; rev:3;)
   New: alert udp $EXTERNAL_NET any -> $HOME_NET 69 (msg:"TFTP Put"; content:"|00 
   graphics/ccc.gif02|"; offset:0; depth:2; reference:cve,CVE-1999-0183; reference:arachnids,148; classtype:
   graphics/ccc.gifbad-unknown; sid:518; rev:3;)
   
   
   [*] Non-rule lines added/removed: [*]
   None.
   
   [*] Added files: [*]
   None.
   

The script uses a configuration file where many options can be configured. Specifically you can configure the following in the configuration file oinkmaster.conf:

  • URL of the location from where it downloads the Snort rules. By default this URL is http://www.snort.org/downloads/signatures/snortrules.tar.gz or http://www.snort.org/downloads/snortrules.tar.gz. This is configured using the url keyword in the configuration file.

  • Files to be updated. By default files ending with .rules, .config, .conf, .txt and .map are updated and all other files are ignored. This is done using the update_files keyword.

  • Files to be skipped when updating rules. This is done using the skipfile keyword. You can use as many skipfiles lines as you like. This option is useful when you have customized rules in some files. When you skip these files, your customized rules will not be overwritten during the update process.

  • You can disable certain rules permanently using the disablesid keyword in the configuration file. The tool will not update these rules during the update.

Please use the README and INSTALL files that come with the tool. You can use this tool from a cron script to periodically update your rule set.

混合AI智能体与专家系统:自动化威胁情报到安全规则的智能转化 在网络安全领域,威胁情报的自动化处理是提升安全运营效率的关键。传统方法依赖人工分析,难以应对海量、非结构化的威胁数据。混合AI智能体与专家系统架构结合了大语言模型的语义理解能力和专家系统的确定性推理优势,实现了从情报语义化到规则生成的自动化管道。AI智能体负责从非结构化文本中提取关键安全实体和关系,专家系统则基于预置的安全知识库进行逻辑推理,生成精准的防火墙或WAF规则。这种架构不仅提升了响应速度,还通过可解释的推理过程保障了决策的可靠性,为SOC自动化、智能安全运维等场景提供了高效解决方案。 阅读详情

相关推荐

最新Snort3和Snort2安装详细教程

转移发布平台通知:将不再在优快云博客发布新文章,敬请移步知识星球... ...

橙留香Park的博客 8615

常见的CVE汇总

一、CVE-2014-0160(Heartbleed)二、CVE-2017-5638(Struts2 S2-045)三、CVE-2018-15473(OpenSSH User Enumeration)四、CVE-2019-19781(Citrix ADC and Gateway Remote Code Execution)五、CVE-2020-1472(ZeroLogon)六、CVE-2021-44228(Log4Shell)七、CVE-2017-11882(Microsoft Office Equatio

m0_57836225的博客 1878

【信息科学与工程学】计算机科学与自动化——第一百五十五篇 缓存系统设计01 基础知识

CPU:拥有 L1/L2/L3 多级缓存,用于暂存即将执行的指令和频繁访问的数据。GPU:包含显存、纹理缓存、常量缓存、指令缓存等,加速图形渲染和通用计算。RAID 卡 / 存储控制器:自带缓存(通常带电池保护),用于合并写操作、加速读写。打印机:内置内存缓存,用于暂存待打印的页面数据,避免反复从电脑传输。光驱 / 蓝光播放器:内部缓存用于平滑读取光盘数据,防止因寻道延迟导致卡顿。操作系统:页缓存(Page Cache):缓存文件系统数据,减少磁盘 I/O。目录缓存(dentry cache):加速路径查找

weixin_49199313的博客 290

最著名的十大漏洞

通过Internet进行的计算机系统大多数成功***都可以归结到很少数量的安全漏洞上。   在Solar Sunrise Pentagon***事件中被***的大多数系统都是因为同一个漏洞受到***。不久前分布式拒绝服务***中被利用的大部分计算机也是因为一个漏洞。最近基于WindowsNT的WEB服务器的大量***也可归结到一个众所周知的漏洞。另外有一个漏洞也被认为可以被用...

weixin_34270606的博客 2894

snortrules-snapshot-2980.tar.gz

snortrules-snapshot-2980.tar.gz是snort的规则包,在官网下载需要申请账号。

snortrules-snapshot-29120.tar.gz规则集

snortrules-snapshot-29120规则集 Snort已发展成为一个具有多平台(Multi-Platform)、实时(Real-Time)流量分析、网络IP数据包(Pocket)记录等特性的强大的网络入侵检测/防御系统(Network Intrusion Detection/Prevention System),即NIDS/NIPS

Best Practices for Speeding Up Your Web Site (from Yahoo! Developer Network)

http://developer.yahoo.com/performance/rules.html The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 34 best practices divided

PHP_CHRIS_BT1984的专栏 4347

snortrules-snapshot-2910

snort 监控规则/linux下snort规则文件snortrules-snapshot-CURRENT.tar

【网络安全实验】snort实现高级IDS

加深理解:我们说理解/etc/snort/sid-msg.map这个文件的意义非常重要,实体signature表示的是报警信息列表规范化,即将报警事件信息按规则编号(sig_id)、规则描述(sig_name)、规则分类编号(sig_class_id)规则优先级(sig_priority)规则版本号(sig_rev),规则在snort中的内部编号(sig_sid;根据上面命令执行结果会在/var/log/snort/目录下生成报警文件,大家可以看到报警文件格式都是snort.log.时间戳。

weixin_52553215的博客 2502

snortrules-snapshot-CURRENT(1).gz

一般般,希望能过帮助到其他人 ,我也只是使用过而已,并不是很齐全

Snort-Rules:Snort 23条规则的集合

Snort规则 描述 Snort 2和3规则很不错。 包括社区版和另一个Github存储库的快照克隆。 喷鼻息2 为了易于使用,该存储库已存储在snortrules-snapshot-2972.zip中。 还有公共版本的snort2-community-rules.tar。 喷鼻息3 社区规则的公共版本snort3-community-rules.tar。

snort3.0 获取注册规则(19000多条)

面对生活中的手机、电脑网络监控,很多人都是束手无策的,只不过雁过留声风过留痕,黑客路过就会留下入侵痕迹,比如手机没玩的时候,流量异常的增多,并且一直和某一个IP地址通信很频繁,可能是黑客正在下载手机上的图片,然而这些都是行为日志,只需要记录家庭路由器上所有的流量,便可以筛选出黑客的IP地址,snort3是从威胁的角度出发,对流量进行,个人注册的有19000多条规则~ailx101954 次咨询4.9网络安全优秀回答者互联网行业 安全攻防员去咨询。

ailx10 654

Snort 2.9.9.0 规则库 snortrules-snapshot-2990.tar.gz

最新版本的Snort规则库

Blender 3D Architecture, Buildings, and Scenery

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出版、作者信息和本声明。否则将追究法律责任。http://blog.youkuaiyun.com/topmvp - topmvpThis book will show you how to create realistic architectural models in Blender. Blender is an open-source 3D

TopMVP 16万+

snortrules-snapshot-29151.zip

该压缩包为Snort 2.9.15.1版本的规则文件。解压后放到/etc/snort目录下,可以根据自己的需要修改、添加规则文件

snortrules-snapshot-29160.tar.gz

从snort官网下载的免费规则库,时间时截至2020-5-10日,最新Snort规则包,压缩包约115MB。

snort rule snort rules snort 规则集 2900

snort官网上下载的规则集 版本2900 包括文本规则和so规则

snort rules

好东西,snort rules

上一篇: 如何编写snort的检测规则
下一篇: ndis hook开发日志(2)-获取网卡信息
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值