-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
40 lines (37 loc) · 1.04 KB
/
run.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
source /home/kosim/TA/bin/activate
base_name="/home/kosim/elfs"
res_path="/home/kosim/elfs/done"
elf2014="${base_name}/elf2014"
elf2019="${base_name}/elf2019"
benign="${base_name}/benign"
log="/home/kosim/run.log"
i=0
for dir in "$base_name/"*; do
if [ "$dir" == "$elf2019" ]
then
for filepath in "$elf2019/"*; do
echo -e "${i}: $(date)\tSubmitting ${filepath}" >> $log
cuckoo submit ${filepath}
IFS='/' read -a Temp <<< "$filepath"
filename="${Temp[-1]}"
sleep 40s
echo -e "${i}: $(date): Moving ${filepath} to ${res_path}/elf2019/${filename}" >> $log
cp $filepath "${res_path}/elf2019/${filename}"
((i++))
done
fi
if [ "$dir" == "$benign" ]
then
for filepath in "$benign/"*; do
echo-e "${i}: $(date): \tSubmitting ${filepath}" >> $log
cuckoo submit ${filepath}
IFS='/' read -a Temp <<< "$filepath"
filename="${Temp[-1]}"
sleep 40s
echo -e "${i}: $(date): Moving ${filepath} to ${res_path}/benign/${filename}" >> $log
cp $filepath "${res_path}/benign/${filename}"
((i++))
done
fi
done
deactivate