forked from vs-uulm/nemesys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval-netzob-fms.sh
executable file
·57 lines (46 loc) · 1.43 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
#!/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/*-1000.pcap
input=input/maxdiff-fromOrig/ntp_SMIA-20111010_maxdiff-100.pcap
#input="input/maxdiff-fromOrig/smb_SMIA20111010-one-rigid1_maxdiff-1000.pcap"
L2PROTOS="input/awdl-* input/au-*"
prefix="netzob-format"
# AWDL
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=50
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
# 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!"