Flow Keywords
=============
-Flowbits
+flowbits
~~~~~~~~
Flowbits consists of two parts. The first part describes the action it
It is possible to use flowbits several times in a rule and combine the
different functions.
-Flow
+flow
~~~~
The flow keyword can be used to match on direction of the flow, so to/from
.. image:: flow-keywords/Flow2.png
-Flowint
+flowint
~~~~~~~
For information, read the information on the :doc:`flowint` page.
-Flowint
+flowint
=======
Flowint is a precursor to the Global Variables task we will be adding
alert ip $EXTERNAL_NET any -> $HOME_NET any (msg:"GPL MISC 0 ttl"; :example-rule-emphasis:`ttl:0;` reference:url,support.microsoft.com/default.aspx?scid=kb#-#-EN-US#-#-q138268; reference:url,www.isi.edu/in-notes/rfc1122.txt; classtype:misc-activity; sid:2101321; rev:9;)
-Ipopts
+ipopts
^^^^^^
With the ipopts keyword you can check if a specific ip option is
ip_proto:PIM
-Id
+id
^^
With the id keyword, you can match on a specific IP ID value. The ID
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"ET DELETED F5 BIG-IP 3DNS TCP Probe 1"; :example-rule-emphasis:`id: 1;` dsize: 24; flags: S,12; content:"\|00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\|"; window: 2048; reference:url,www.f5.com/f5products/v9intro/index.html; reference:url,doc.emergingthreats.net/2001609; classtype:misc-activity; sid:2001609; rev:13;)
-Geoip
+geoip
^^^^^
The geoip keyword enables (you) to match on the source, destination or
Fragments
---------
-Fragbits
+fragbits
^^^^^^^^
With the fragbits keyword, you can check if the fragmentation and
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"ET EXPLOIT Invalid non-fragmented packet with fragment offset>0"; :example-rule-emphasis:`fragbits: M;` fragoffset: >0; reference:url,doc.emergingthreats.net/bin/view/Main/2001022; classtype:bad-unknown; sid:2001022; rev:5; metadata:created_at 2010_07_30, updated_at 2010_07_30;)
-Fragoffset
+fragoffset
^^^^^^^^^^
With the fragoffset keyword you can match on specific decimal values
.. note:: The following characters must be escaped inside the msg:
``;`` ``\`` ``"``
-Sid (signature id)
+sid (signature ID)
------------------
The keyword sid gives every signature its own id. This id is stated with a number.
In this example the red, bold-faced part is the sid.
-Rev (Revision)
+rev (Revision)
--------------
The sid keyword is almost every time accompanied by rev. Rev
In this example the red, bold-faced part is the rev.
-Gid (group id)
+gid (group ID)
--------------
The gid keyword can be used to give different groups of signatures
This is an example from the fast.log.
In the part [1:2008124:2], 1 is the gid (2008124 is the the sid and 2 the rev).
-Classtype
+classtype
---------
The classtype keyword gives information about the classification of
In this example the red, bold-faced part is the classtype.
-Reference
+reference
---------
The reference keywords direct to places where information about the
In this example the red, bold-faced part is the action.
-Priority
+priority
--------
The priority keyword comes with a mandatory numeric value which can
priority:1;
-Metadata
+metadata
--------
Suricata ignores the words behind meta data. Suricata supports this
metadata:......;
-Target
+target
------
The target keyword allows the rules writer to specify which side of the
Payload keywords inspect the content of the payload of a packet or
stream.
-Content
+content
-------
The content keyword is very important in signatures. Between the
.. note:: The following characters must be escaped inside the content:
``;`` ``\`` ``"``
-Nocase
+nocase
------
If you do not want to make a distinction between uppercase and
It has no influence on other contents in the signature.
-Depth
+depth
-----
The depth keyword is a absolute content modifier. It comes after the
.. image:: payload-keywords/content4.png
-Offset
+offset
------
The offset keyword designates from which byte in the payload will be
.. image:: payload-keywords/content6.png
-Distance
+distance
--------
The keyword distance is a relative content modifier. This means it
.. image:: payload-keywords/distance3.png
-Within
+within
------
The keyword within is relative to the preceding match. The keyword
.. image:: payload-keywords/within_distance2.png
-Isdataat
+isdataat
--------
The purpose of the isdataat keyword is to look if there is still data
.. image:: payload-keywords/isdataat1.png
-Dsize
+dsize
-----
With the dsize keyword, you can match on the size of the packet
alert udp $EXTERNAL_NET any -> $HOME_NET 111 (msg:"RPC portmap request yppasswdd"; :example-rule-emphasis:`rpc:100009,*,*;` reference:bugtraq,2763; classtype:rpc-portmap-decode; sid:1296; rev:4;)
-Replace
+replace
-------
The replace content modifier can only be used in ips. It adjusts