Snort Rule Infographic
Snort Rule Infographic
Official Documentation
-----------------------------------------------------------
SNORTOLOGY 101
THE ANATOMY OF A SNORT RULE
WHAT IS SNORT?
Snort is an open source network intrusion prevention system (IPS) by Cisco. It is capable of performing real-time traffic analysis and packet logging on IP networks. It can perform protocol analysis, content searching and matching, and detect a variety of attacks and probes. Snort can be used as a straight packet sniffer like tcpdump, a packet logger (useful for network traffic debugging), or as a full-blown network intrusion prevention system.
LET’S BREAK IT DOWN
BASIC OUTLINE OF A SNORT RULE
[action][protocol][sourceIP][sourceport] -> [destIP][destport] ( [Rule options] )
|___________________ Rule Header _________________|

RULE HEADER
The rule header contains the rule's action, protocol,
source and destination IP addresses and netmasks,
and the source and destination ports information.
alert Action to take (option) The first item in a rule
is the rule action. The rule action tells Snort what to do
when it finds a packet that matches the rule criteria
(usually alert).
tcp Type of traffic (protocol) The next field in a rule
is the protocol. There are four protocols that Snort
currently analyzes for suspicious behavior
- TCP, UDP, ICMP, and IP.
$EXTERNAL_NET Source address(es) variable or literal
$HTTP_PORTS Source port(s) variable or literal
-> Direction operator The direction operator ->
indicates the orientation of the traffic to which
the rule applies.
$HOME_NET Destination address(es) variable or literal
any Destination port(s) variable or literal
RULE OPTIONS
Rule options form the heart of Snort’s intrusion detection engine combining ease of use with power and flexibility. All Snort rule options are separated from each other using a semicolon (;). Rule option keywords are separated from their arguments with a colon (:).
GENERAL RULE OPTIONS
Message A meaningful message typically includes what the rule is detecting.
The msg rule option tells Snort what to output when the rule matches.
It is a simple text string.
Flow For the rule to fire, specifies which direction the network traffic is going.
The flow keyword is used in conjunction with TCP stream reassembly.
It allows rules to only apply to certain directions of the traffic flow.
Reference The reference keyword allows rules to include references
to external sources of information.
Classtype The classtype keyword is how Snort shares what the effect
of a successful attack would be.
sid/rev The snort id is a unique identifier for each rule. This information
allows output plugins to identify rules easily and should be used with
the rev (revision) keyword.
DETECTION OPTIONS
Content This important feature allows the user to set rules that search for
specific content in the packet payload and trigger response based on that
data. The option data can contain mixed text and binary data.
distance/offset These keywords allow the rule writer to specify where
to start searching relative to the beginning of the payload or the
beginning of a content match.
within/depth These keywords allow the rule write to specify how far
forward to search relative to the end of a previous content match and,
once that content match is found, how far to search for it.
PCRE The pcre keyword allows rules to be written using perl compatible
regular expressions which allows for more complex matches than simple
content matches.
Byte test The byte_test options allows a rule to test a number of bytes
against a specific value in binary.

EXAMPLE Rule Header alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any Message msg: “BROWSER-IE Microsoft Internet Explorer CacheSize exploit attempt”; Flow flow: to_client,established; Detection file_data;
content:"recordset"; offset:14; depth:9;
content:".CacheSize"; distance:0; within:100;
pcre:"/CacheSize\s*=\s*/";
byte_test:10,>,0x3ffffffe,0,relative,string; Metadata policy max-detect-ips drop, service http; References reference:cve,2016-8077; Classification classtype: attempted-user; Signature ID sid:65535;rev:1;

例如:alert tcp any any -> any 80 (msg:"http critical file type(sh) Blocked"; content:".sh"; sid:10101; rev:1;)

=================== End
Snort Rule Infographic的更多相关文章
- SNORT入侵检测系统
SNORT入侵检测系统 YxWa · 2015/10/09 10:38 0x00 一条简单的规则 alert tcp 202.110.8.1 any -> 122.111.90.8 80 (ms ...
- How to compile and install Snort from source code on Ubuntu
http://www.tuicool.com/articles/v6j2Ab Snort is by far the most popular open-source network intrusio ...
- 如何编写snort的检测规则
如何编写snort的检测规则 2013年09月08日 ⁄ 综合 ⁄ 共 16976字 前言 snort是一个强大的轻量级的网络入侵检测系统.它具有实时数据流量分析和日志IP网络数据包的能力,能够进行协 ...
- Snort Inline IPS Mode
Snort Inline IPS Mode https://forum.netgate.com/topic/143812/snort-package-4-0-inline-ips-mode-intro ...
- snort_inline
snort_inline Link http://snort-inline.sourceforge.net/oldhome.html What is snort_inline? snort_inl ...
- BlackArch-Tools
BlackArch-Tools 简介 安装在ArchLinux之上添加存储库从blackarch存储库安装工具替代安装方法BlackArch Linux Complete Tools List 简介 ...
- snort installation, configuration and test
snort installation: https://www.snort.org/#get-started wget https://www.snort.org/rules/snortrules-s ...
- Snort - 配置文件
Snort.conf 版本 2.9.8.3 编译可用选项: --enable-gre --enable-mpls --enable-targetbased --enable-ppm --enable- ...
- Snort - manual 笔记(一)
Chapter 1 Snort Overview This manual is based on Writing Snort Rules by Martin Roesch and further wo ...
随机推荐
- Spring cloud微服务安全实战-6-1本章概述
这一章来讲一下,微服务之间的通讯安全. 当前这个架构还存在的问题 在网关上做限流还是有一些问题的.例如我的订单服务限流是100,库存服务限流也是100.但是我的订单服务会调用我的库存服务.那么在网关这 ...
- [译]如何在GitHub仓库创建一个标签tag, 并推送到远程分支?
问: 我在GitHub上有一个仓库,我需要给他打个tag.我在shell打了tag,但是在Github上没有显示出来.我还要做其他什么么? 我在shell中使用的命令是: git tag 2.0 当我 ...
- Django安全配置(settings.py)详解
必须配置项 PASSWORD_HASHER 这个配置是在使用Django自带的密码加密函数的时候会使用的加密算法的列表.默认如下: PASSWORD_HASHERS = ( 'django.contr ...
- Day1作业1:登陆接口(加入日志、注册功能)
流程图如下: 最先考虑使用python中的list,以能取到user_list中的用户信息,但中途发现没有比较好的方法截取取密码,还是新手的缘故,最终选择了使用dict,以方便截取用户名以及相应的密码 ...
- HR数据分析常用的50个公式
HR数据分析常用的50个公式 HR经常需要和数据打交道,如入职率.离职率.加班费计算等.虽然日常工作中,单个数据的计算并不麻烦,但几十上百个累计在一起,确实很容易混淆,甚至计算失误.今天小编急HR之所 ...
- 【docker 使用】创建镜像docker build
创建镜像命令 docker build -t [镜像name]:[镜像tag] -f [dockerfile路径] [资源目录] 执行该命令后,docker会将[资源目录]打包,之后在dockerfi ...
- sonar:查询全部项目的bug和漏洞总数(只查询阻断/严重/主要级别)
1.统计所有项目主要以上的漏洞和bug -- 统计所有项目主要以上的漏洞和bug ,) AND severity IN('BLOCKER','CRITICAL','MAJOR') 2.统计所有某个项目 ...
- mysql日期加一个天数获得新的日期
原文地址:https://476057266-qq-com.iteye.com/blog/2047671 在当前的日期上加三天,天数随便改: SELECT date_add(CURRENT_DATE( ...
- Linux 线程实现机制分析(转载)
自从多线程编程的概念出现在 Linux 中以来,Linux 多线应用的发展总是与两个问题脱不开干系:兼容性.效率.本文从线程模型入手,通过分析目前 Linux 平台上最流行的 LinuxThreads ...
- java properties文件转义字符和中文乱码解决
properties文件的分隔符是 =或者 : 第一次出现的就是分割符,第二次出现的也不需要转义,也即是(忽略掉[],只是着重描述字符) [\=] [\:] 或者 [=] [:] ...