-
Notifications
You must be signed in to change notification settings - Fork 87
/
clean-emux-files
executable file
·34 lines (31 loc) · 1.04 KB
/
clean-emux-files
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
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# EMUX (formerly ARMX) by Saumil Shah
# https://emux.exploitlab.net/
cd files/
echo "Cleaning files/emux/share/qemu"
rm -Rf emux/share/qemu
echo "Cleaning files/emux/hostfs/hostfs-[a-z]*.ext2"
rm -f emux/hostfs/hostfs.ext2
echo "Cleaning files/emux/debuglogs"
rm -f emux/debuglogs
echo "Cleaning files/emux/logs/*.log"
rm -f emux/logs/*.log
echo "Cleaning up flash[01].bin files"
find . -name "flash[01].bin" -print -exec rm {} \;
echo "Cleaning up run-binsh/run-init files"
find . -name "run-binsh" -print -exec rm {} \;
find . -name "run-init" -print -exec rm {} \;
echo "Cleaning up extracted rootfs"
for i in $(find emux -name "config" -print)
do
path=$(dirname $i)
rootfs=$(cat $i | grep rootfs | cut -d'=' -f2)
if [ -d ${path}/${rootfs} ]
then
echo "removing ${path}/${rootfs}"
rm -Rf "${path}/${rootfs}"
fi
done