1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
|
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\language english
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize default
\spacing single
\papersize a4paper
\paperpackage a4wide
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language polish
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\layout Title
FireFlier Protocol:
\layout Comment
Protokollversion: 2.0
\layout Section
Server to Client
\layout Standard
\noindent
Message = type (sendpacket | sendsource | senduserspacerules | sendiptablesrules
| auth_result).
\layout Standard
\noindent
\emph on
Send a message metainformation to client
\layout Standard
\noindent
sendpacket = len packet_id arrived datalen sourceIP destinationIP protocol
sourcePort sourcePort destinationPort tcp_flags icmp_type chain mac_addr_len
mac_addr interface_in interface_out program_name_len program_name.
\layout Standard
\noindent
\emph on
Send message body to client (for viewing source)
\layout Standard
\noindent
sendsource = msgdata.
\layout Standard
\noindent
\emph on
Send the userspace rules as an ASCII string with newline terminators.
\layout Standard
\noindent
senduserspacerules = len char{len}.
\layout Standard
\noindent
\emph on
Send the iptables rules as an ASCII string with newline terminators.
\layout Standard
\noindent
sendiptablesrules = len char{len}.
\layout Standard
\noindent
\emph on
Send answer to authentication request
\layout Standard
\noindent
auth_result = byte.
\layout Itemize
\noindent
0 = authentication failed
\layout Itemize
\noindent
1 = authentication succeeded
\layout Itemize
2 = authentication failed - already a logged in user
\layout Standard
\noindent
byte = 0..255.
\layout Standard
\noindent
unsigned int = 0..(255^4).
\layout Standard
\noindent
unsigned short = 0..65535.
\layout Standard
\noindent
type = byte.
\layout Itemize
\noindent
0 = metainformation (sendpacket)
\layout Itemize
\noindent
1 = packet source (sendsource)
\layout Itemize
\noindent
2 = iptables rules
\layout Itemize
\noindent
6 = userspace rules
\layout Itemize
\noindent
8 = authentication
\layout Standard
\noindent
len = unsigned short.
\layout Standard
\noindent
\emph on
Unique packet ID as we get it from libipq
\layout Standard
\noindent
packet_id = unsigned int.
\layout Standard
\noindent
\emph on
timestamp of packet
\layout Standard
\noindent
arrived = unsigned int.
\layout Standard
\noindent
\emph on
length of data (including IP+TCP/UDP header)
\layout Standard
\noindent
datalen = unsigned short.
\layout Standard
\noindent
sourceIP = unsigned int.
\layout Standard
\noindent
destinationIP = unsigned int.
\layout Standard
\noindent
protocol = byte.
\layout Itemize
\noindent
ICMP = 1
\layout Itemize
\noindent
TCP = 6
\layout Itemize
\noindent
UDP = 17
\layout Itemize
\noindent
GRE = 47
\layout Standard
\noindent
sourcePort = unsigned short.
\layout Standard
\noindent
destinationPort = unsigned short.
\layout Standard
\noindent
\emph on
Flags as we find it in the TCP header
\layout Standard
\noindent
tcp_flags = unsigned short.
\layout Standard
\noindent
\emph on
Icmp subtype as in ICMP header
\layout Standard
\noindent
icmp_type = byte.
\layout Standard
\noindent
\emph on
Firewall Chain
\layout Standard
\noindent
chain = byte.
\layout Itemize
\noindent
INPUT = 1
\layout Itemize
\noindent
FORWARD = 2
\layout Itemize
\noindent
OUTPUT = 3
\layout Standard
\noindent
mac_addr_len = byte.
\layout Standard
\noindent
\emph on
MAC address of local network interface card
\layout Standard
\noindent
mac_addr = byte{8}.
\layout Standard
\noindent
\emph on
Name of the incoming interface
\layout Standard
\noindent
interface_in = char{16}.
\layout Standard
\noindent
\emph on
Name of the outgoing interface (only incoming OR outgoing is set)
\layout Standard
\noindent
interface_out = char{16}.
\layout Standard
\noindent
program_name_len = byte.
\layout Standard
\noindent
\emph on
program on local computer corresponding to this connection
\layout Standard
\noindent
program_name = char{program_name_len} chr(0).
\layout Standard
\noindent
\emph on
raw message data
\layout Standard
\noindent
msgdata = {char}.
\layout Section
Client to server
\layout Standard
\noindent
Message = type [( rulecmd | delete_userspace_rule | delete_iptables_rule
| auth)].
\layout Itemize
\noindent
1 = request source of current packet
\layout Itemize
\noindent
2 = request iptables rules
\layout Itemize
\noindent
3, 4 = allow/deny packets, create rules.
in this case rulecmd has to follow
\layout Itemize
\noindent
5 = delete iptables rule.
in this case delete_iptables_rule has to follow
\layout Itemize
\noindent
6 = request userspace rules
\layout Itemize
\noindent
7 = delete userspace rule.
in this case delete_userspace_rule has to follow
\layout Itemize
\noindent
8 = authenticate request.
in this case auth has to follow
\layout Standard
\noindent
rulecmd = cmd want_ip_src want_ip_dst want_port_src want_port_dst want_interface
_in want_interface_out want_mac_addr want_protocol want_connection_tracking
want_programname want_timeout.
\layout Standard
\noindent
cmd = byte.
\layout Itemize
\noindent
1 = command for one packet
\layout Itemize
\noindent
2 = command for queued packets
\layout Itemize
\noindent
3 = create rule
\layout Standard
\noindent
boolean: 0 | 1.
\layout Itemize
\noindent
0 = false
\layout Itemize
\noindent
1 = true
\layout Standard
\noindent
\emph on
want_* is true if you want the corresponding information to be evaluated
in this rule (ie only important if cmd == 3)
\layout Standard
\noindent
want_*: boolean.
\layout Standard
\noindent
The following constraints should always be considered:
\layout Itemize
\noindent
if want_port_* is true then want_protocol should be true
\layout Itemize
\noindent
want_programname and want_connection_tracking may never be true at the same
time.
\layout Itemize
\noindent
connection tracking works only with TCP and UDP
\layout Standard
\noindent
delete_userspace_rule = chr(0) rulenum.
\layout Standard
\noindent
delete_iptables_rule = chain rulenum.
\layout Standard
\noindent
\emph on
number of rule to be deleted
\layout Standard
\noindent
rulenum = unsigned short.
\layout Standard
\noindent
auth = username_len username password_len password.
\layout Standard
\noindent
\emph on
username and password are NOT zero terminated.
\layout Standard
\noindent
username_len = unsigned short.
\layout Standard
\noindent
username = char{username_len}.
\layout Standard
\noindent
password_len = unsigned short.
\layout Standard
\noindent
password = char{password_len}.
\the_end
|