/
DESIGN
391 lines (334 loc) · 9.78 KB
/
DESIGN
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
cd anthidium && autoreconf && ./configure && make dist && tar -xvzf anthidium-0.1.tar.gz && cd anthidium-0.1/ && CFLAGS="-g" ./configure && make
su
ulimit -c 1000000
#LD_LIBRARY_PATH=eocene_modules/eocene_libev:eocene_modules/eocene_bdb:eocene_modules/eocene_sockets:eocene/.libs:eocene_modules/eocene_ethernet/.libs:eocene_modules/eocene_ipv4/.libs:eocene_modules/eocene_stp/.libs:eocene_modules/eocene_output_text/.libs:eocene_modules/eocene_bridge_network/.libs anthidium/.libs/anthidium -c ../anthidium.conf.sample
LD_LIBRARY_PATH=eosimias/.libs:eocene/.libs:eonessa/.libs anthidium/.libs/anthidium -c ../anthidium.conf.sample
gdb anthidium/.libs/anthidium core.xxxx
LD_LIBRARY_PATH=eocene_modules/eocene_libev:eocene_modules/eocene_bdb:eocene_modules/eocene_sockets:eonessa/.libs:eocene/.libs:eocene_modules/eocene_ethernet/.libs:eocene_modules/eocene_ipv4/.libs:eocene_modules/eocene_stp/.libs:eocene_modules/eocene_output_text/.libs:eocene_modules/eocene_bridge_network/.libs gdb anthidium/.libs/anthidium
(gdb) set args -c ../anthidium.conf.sample
(gdb) break eocene_ethernet.c:293
No source file named eocene_ethernet.c.
Make breakpoint pending on future shared library load? (y or [n]) y
(gdn) run
(gdb) print ethernet_listeners[0]
$1 = (eocene_ethernet_listener *) 0x7ffff58f2795 <my_eocene_ethernet_listener>
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5af4ca5 in eocene_ethernet_LTX_parse (buf=0x611f00 "\377\377\377\377\377\377", n=60,
capture_type=1) at eocene_ethernet.c:293
293 (*ethernet_listeners[i]) (frame);
=========================
anthidium
eonessa
Database Design:
Active Sockets:
pack(server_ip, server_port, client_ip, client_port): index to secondary table
key struct:
uint32_t host1;
uint16_t port1;
uint32_t host2;
uint16_t port2;
value: index
Active Servers by IP:
pack(server_ip): secondary table (multiple values)
Active Clients by IP:
pack(server_ip): secondary table (multiple values)
Active Servers by Option 82:
pack(server_ip) secondary table (multiple values)
Active Clients by Option 82:
pack(server_ip) secondary table (multiple values)
Active Sockets:
secondary index
value struct:
active_hosts <- index to
uint16_t server_port;
active_hosts <- index to
uint16_t client_port;
uint8_t socket_type;
uint8_t state; (e.g. CLOSED, SYN_SENT, SYN_RECEIVED, ESTABLISHED, FIN_WAIT_1, FIN_WAIT_2, CLOSE_WAIT, CLOSING, LAST_ACK, TIME_WAIT)
struct data_transfer:
uint64_t
Active Hosts:
key: index
value:
struct {
IP Address
Option 82;
Mac Address;
Client ID;
clock_skew;
Historical Sockets:
pack(server_ip, server_port, client_ip, client_port): index to secondary tables
TCP Sequences:
Next server sequence number:
index: sequence_number
Next client sequence number:
index: sequence_number
Active Host:
ip_address: host detail index
host details:
hardware type:
host_detail_index: hardware type
transaction ids:
host_detail_index: transaction id
circuit id:
host_detail_index: circuit id
remote id:
host_detail_index: remote id
client id:
host_detail_index: client id
yiaddr:
host_detail_index: yiaddr
siaddr:
host_detail_index: siaddr
giaddr:
host_detail_index: giaddr
chaddr:
host_detail_index: chaddr
sname:
host_detail_index: sname
file:
host_detail_index: file
subnet_mask:
host_detail_index: subnet_mask
router:
host_detail_index: router
time server:
host_detail_index: time server
ien_116_nameserver:
host_detail_index: ien 116 nameserver
domain nameserver:
host_detail_index: nameserver
log server:
host_detail_index: log server
cookie server:
host_detail_index: cookie server
lpr:
host_detail_index: lpr
impress:
host_detail_index: impress
resource location:
host_detail_index: resource location
hostname:
host_detail_index: hostname
boot_file_size:
host_detail_index: boot_file_size
merit_dump_file:
host_detail_index: merit_dump_file
domainname:
host_detail_index: domainname
swap_server:
host_detail_index: swap_server
root_path:
host_detail_index: root_path
extentions_path:
host_detail_index: extentions_path
ip_forwarding:
host_detail_index: ip_forwarding
non_local_routing:
host_detail_index: non_local_routing
policy_filter:
host_detail_index: policy_filter
max_datagram_size:
host_detail_index: max_datagram_size
ttl:
host_detail_index: ttl
mtu_aging_timeout:
host_detail_index: mtu_aging_timeout
mtu_plateau:
host_detail_index: mtu_plateau
interface_mtu:
host_detail_index: interface_mtu
all_subnets_local:
host_detail_index: all_subnets_local
broadcast_addr:
host_detail_index: broadcast_addr
perform_mask_disc:
host_detail_index: perform_mask_disc
mask_supplier:
host_detail_index: mask_supplier
perform_router_disc:
host_detail_index: perform_router_disc
router_solicitation:
host_detail_index: router_solicitation
static_route:
host_detail_index: static_route
trailer_encap:
host_detail_index: trailer_encap
arp_cache_timeout:
host_detail_index: arp_cache_timeout
ethernet_encap:
host_detail_index: ethernet_encap
tcp_default_ttl:
host_detail_index: tcp_default_ttl
tcp_keepalive_int:
host_detail_index: tcp_keepalive_int
tcp_keepalive_garb:
host_detail_index: tcp_keepalive_garb
nis_domain:
host_detail_index: nis_domain
nis_servers:
host_detail_index: nis_servers
ntp_servers:
host_detail_index: ntp_servers
vendor_specific:
host_detail_index: vendor_specific
netbios_nameserver:
host_detail_index: netbios_nameserver
netbios_dist_server:
host_detail_index: netbios_dist_server
netbios_node_type:
host_detail_index: netbios_node_type
netbios_scope:
host_detail_index: netbios_scope
x_font_server:
host_detail_index: x_font_server
x_display_manager:
host_detail_index: x_display_manager
requested_ip:
host_detail_index: requested_ip
lease_time:
host_detail_index: lease_time
overload:
host_detail_index: overload
message_type:
host_detail_index: message_type
server_identification:
host_detail_index: server_identification
parameter_req_list:
host_detail_index: parameter_req_list
error_message:
host_detail_index: error_message
max_dhcp_size:
host_detail_index: max_dhcp_size
t1_renewal_time:
host_detail_index: t1_renewal_time
t2_rebinding_time:
host_detail_index: t2_rebinding_time
vendor_class_identifier:
host_detail_index: vendor_class_identifier
client_identifier:
host_detail_index: client_identifier
nis_plus_domain:
host_detail_index: nis_plus_domain
nis_plus_servers:
host_detail_index: nis_plus_servers
tftp_server:
host_detail_index: tftp_server
bootfile:
host_detail_index: bootfile
mobile_home_agent:
host_detail_index: mobile_home_agent
smtp_server:
host_detail_index: smtp_server
pop3_server:
host_detail_index: pop3_server
nntp_server:
host_detail_index: nntp_server
www_server:
host_detail_index: www_server
finger_server:
host_detail_index: finger_server
irc_server:
host_detail_index: irc_server
streettalk_server:
host_detail_index: streettalk_server
stda_server:
host_detail_index: stda_server
site_specific_128:
host_detail_index: site_specific_128
site_specific_254:
host_detail_index: site_specific_254
TCP Hosts:
Today:
When TCP Streams:
1 minute table:
index: <null>
-----
module_path = "/usr/lib/eocene/";
load_modules = [ "eocene_libev", "eocene_bdb", "eocene_sockets", "eocene_http" ];
sources = ( {
type = "pcap-live";
source = "wlan0";
filter = "";
promiscuous = 1;
color = "blue";
}, {
type = "pcap-live";
source = "br0";
filter = "";
promiscuous = 1;
color = "red";
} );
};
servers = ( {
domain = "AF_INET";
type = "SOCK_STREAM";
protocol = 0;
local_ip = "127.0.0.1";
local_port = "5010";
} );
};
top_level_modules = [ "eocene_sockets" ];
data_store_module = "eocene_bdb";
event_module = "libev";
eocene_bdb: {
environment = "/tmp";
};
eocene_sockets: {
# in seconds
syn_ack_timeout = 5;
submodules = [ "eocene_http" ];
};
eocene_http: {
};
application:
{
window:
{
title = "My Application";
size = { w = 640; h = 480; };
pos = { x = 350; y = 250; };
};
list = ( ( "abc", 123, true ), 1.234, ( /* an empty list */) );
books = ( { title = "Treasure Island";
author = "Robert Louis Stevenson";
price = 29.95;
qty = 5; },
{ title = "Snow Crash";
author = "Neal Stephenson";
price = 9.99;
qty = 8; } );
misc:
{
pi = 3.141592654;
bigint = 9223372036854775807L;
columns = [ "Last Name", "First Name", "MI" ];
bitmask = 0x1FC3;
};
};
=========================
Stuff to store:
libpcap files
mbox formatted email files
some kind of audio output from voip calls
transport stream output from video streams
telemetry logging of textual based connection oriented protocols (imap)
Break up http communications into something easy to digest
=========================
Query for interfaces:
tag01 {
enumerate_active_interfaces();
};
tag01 {
/* enumerate_active_interfaces(); */
interfaces = [ "eth0", "eth1" ];
};
tag02 {
if (interface == "eth0" &&
ip.addr == 192.168.1.1 &&
ip.addr == 192.168.1.4) {
};
};
tag02 {
};