-
Notifications
You must be signed in to change notification settings - Fork 6
/
start
executable file
·49 lines (40 loc) · 1.22 KB
/
start
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
#! /bin/bash
DOCKER_HOME=/home/arsenal
ARSENAL_DIR=$(dirname $(readlink -f $0))
usage() {
echo Usage: ./$(basename $0) \[source\] \[destination\]
}
if [[ $1 == -h || $1 == --help ]]; then
usage
exit 0
fi
if [[ $# -eq 0 ]]; then
vol=$ARSENAL_DIR/shared:$DOCKER_HOME/shared
elif [[ $# -eq 1 ]]; then
vol=$1:$DOCKER_HOME/$(basename $1)
elif [[ $# -eq 2 ]]; then
vol=$1:$DOCKER_HOME/$2
else
usage
exit 1
fi
## GUI Support (https://stackoverflow.com/a/25280523)
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
## BURP Dir
burp_dir=$ARSENAL_DIR/_data/.java/.userPrefs/burp:$DOCKER_HOME/.java/.userPrefs/burp
burp_conf=$ARSENAL_DIR/_data/.BurpSuite:$DOCKER_HOME/.BurpSuite
## Ghidra Dir
ghidra_dir=$ARSENAL_DIR/_data/.ghidra:$DOCKER_HOME/.ghidra
## -u flag = https://github.com/moby/moby/issues/3206#issuecomment-152682860
docker run -it --rm -h arsenal --name arsenal \
-u $(id -u):$(id -g) \
-v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH \
-v $vol \
-v $ARSENAL_DIR/_data:$DOCKER_HOME/_data \
--network host \
--env="DISPLAY" \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
arsenal