-
Notifications
You must be signed in to change notification settings - Fork 87
/
run-emux-docker
executable file
·42 lines (35 loc) · 1.02 KB
/
run-emux-docker
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
#!/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/
OWNERNAME="therealsaumil"
IMAGENAME="emux"
TAGNAME="03-2023"
VOL="harambe"
PORTSTRING=""
if [ "${PORTFWD}" = "" ]
then
PORTFWD="20080:80,20443:443,28080:8080,24433:4433,9999:9999"
fi
PORTFWD=$(echo ${PORTFWD} | tr -cd [0-9,:])
IFS=',' read -ra PORTLIST <<< "${PORTFWD}"
for PORTPAIR in "${PORTLIST[@]}"
do
SPORT=$(echo ${PORTPAIR} | cut -d':' -f1)
PORTSTRING="${PORTSTRING} -p ${SPORT}:${SPORT}"
done
docker run \
-it \
${PORTSTRING} \
-e PORTFWD="${PORTFWD}" \
--rm \
--cap-add=NET_ADMIN \
--cap-add=SYS_ADMIN \
--security-opt apparmor=unconfined \
--device=/dev/net/tun \
--name emux-docker \
--mount "type=volume,src=${VOL},dst=/emux" \
--mount "type=bind,src=$(pwd)/workspace,dst=/home/r0/workspace" \
$OWNERNAME/$IMAGENAME:$TAGNAME $*