• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This modules matches a given string by using some pattern matching strategy. It requires a linux kernel >= 2.6.14.
2.TP
3\fB\-\-algo\fP {\fBbm\fP|\fBkmp\fP}
4Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris)
5.TP
6\fB\-\-from\fP \fIoffset\fP
7Set the offset from which it starts looking for any matching. If not passed, default is 0.
8.TP
9\fB\-\-to\fP \fIoffset\fP
10Set the offset up to which should be scanned. That is, byte \fIoffset\fP-1
11(counting from 0) is the last one that is scanned.
12If not passed, default is the packet size.
13.TP
14[\fB!\fP] \fB\-\-string\fP \fIpattern\fP
15Matches the given pattern.
16.TP
17[\fB!\fP] \fB\-\-hex\-string\fP \fIpattern\fP
18Matches the given pattern in hex notation.
19.TP
20\fB\-\-icase\fP
21Ignore case when searching.
22.TP
23Examples:
24.IP
25# The string pattern can be used for simple text characters.
26.br
27iptables \-A INPUT \-p tcp \-\-dport 80 \-m string \-\-algo bm \-\-string 'GET /index.html' \-j LOG
28.IP
29# The hex string pattern can be used for non-printable characters, like |0D 0A| or |0D0A|.
30.br
31iptables \-p udp \-\-dport 53 \-m string \-\-algo bm \-\-from 40 \-\-to 57 \-\-hex\-string '|03|www|09|netfilter|03|org|00|'
32