-
Notifications
You must be signed in to change notification settings - Fork 1
/
ip_stego.zeek
45 lines (42 loc) · 1.4 KB
/
ip_stego.zeek
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
@load vtcs.zeek
global t_TOS: table[ID] of VTC = {};
#global id : ID;
event new_packet (c: connection, p: pkt_hdr){
if(p ?$ ip){
id = ID($src = p$ip$src, $dst = p$ip$dst);
if(id in t_TOS){
t_TOS[id]$a +=1;
print "a", t_TOS[id]$a;
print "c", t_TOS[id]$c;
if (t_TOS[id]$v != p$ip$tos){
if(network_time() - t_TOS[id]$t < 1min){
t_TOS[id]$c +=1;
print "dup";
print t_TOS[id]$a / t_TOS[id]$c;
if(|t_TOS[id]$a / t_TOS[id]$c | < 20 && t_TOS[id]$a > 20)
{
print "possible stego or someone is using VoIP too much :-)", t_TOS[id]$c;
NOTICE([$note=Possible_Steganography,
$conn = c,
$id = c$id,
$msg = "Possible Steganography",
$sub = "IP DSCP/ESN numbers are changing too often",
$ts = network_time()]);
t_TOS[id]$t = network_time();
t_TOS[id]$c = 0;
t_TOS[id]$a = 100;
}
}
else
{
t_TOS[id]$t = network_time();
t_TOS[id]$c = 0;
t_TOS[id]$a = 100;
}
}
}
else{
t_TOS[id] = VTC($v = p$ip$tos, $t = network_time(), $c = 0, $a=100);
}
}
}