-
Notifications
You must be signed in to change notification settings - Fork 12
/
eval-netzob-fms.sh
executable file
·61 lines (50 loc) · 1.47 KB
/
eval-netzob-fms.sh
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
#!/usr/bin/env bash
#input=input/*-100.pcap
#input=input/*-1000.pcap
#input="input/*-100.pcap input/*-1000.pcap"
#input=input/maxdiff-filtered/*-1000.pcap
input="input/maxdiff-fromOrig/*-100*.pcap"
#input="input/maxdiff-fromOrig/ntp_SMIA-20111010_maxdiff-100.pcap"
L2PROTOS="input/awdl-* input/au-*"
prefix="netzob-format"
numpad="206"
for f in reports/${prefix}-* ; do
if [ -e "$f" ] ; then
numnext=$(expr 1 + $(ls -d reports/${prefix}-* | sed "s/^.*${prefix}-\([0-9]*\)-.*$/\1/" | sort | tail -1))
numpad=$(printf "%03d" ${numnext})
fi
break
done
currcomm=$(git log -1 --format="%h")
report=reports/${prefix}-${numpad}-fms-${currcomm}
mkdir ${report}
smin=57
pids=()
for fn in ${input} ; do
# relative to IP layer
optargs="-r" # --smax 80
for proto in ${L2PROTOS} ; do
if [[ "${fn}" == ${proto} ]] ; then
# replace at layer 2 absolute
optargs="-l 2"
# optargs="-l 2 --smax 75"
fi
done
for proto in ${L1PROTOS} ; do
if [[ "${fn}" == ${proto} ]] ; then
# replace
optargs="-l1"
fi
done
# python src/netzob_fms.py --smin ${smin} ${optargs} ${fn} > "${report}/$(basename -s .pcap ${fn}).log" &
python src/netzob_fms.py ${optargs} ${fn} >> "${report}/$(basename -s .pcap ${fn}).log" &
pids+=( $! )
done
for pid in "${pids[@]}"; do
printf 'Waiting for %d...' "$pid"
wait $pid
echo 'done.'
done
mv reports/*clByAlign* ${report}/
python reports/combine-nemesys-fms.py ${report}/
spd-say "Bin fertig!"