-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathdocker-entrypoint.sh
executable file
·45 lines (36 loc) · 1.29 KB
/
docker-entrypoint.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
#!/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/
set -e
echo [+] Starting tun0
sudo /etc/local.d/10-tun-network.start 2>&1 >/dev/null
echo [+] Starting NFS
sudo rpcbind -w
sudo rpcinfo
#sudo rpc.nfsd --no-nfs-version 2 --no-nfs-version 3 --nfs-version 4 --debug 4
sudo rpc.nfsd --debug 8
sudo rpc.nfsd --debug 8
sudo exportfs -rv
sudo exportfs
#sudo rpc.mountd --debug all --no-nfs-version 2 --no-nfs-version 3 --nfs-version 4
sudo rpc.mountd --debug all
#echo [+] Starting tinyproxy
#sudo tinyproxy
echo "[+] Setting up forwarded ports ${PORTFWD}"
IFS=',' read -ra PORTLIST <<< "${PORTFWD}"
for PORTPAIR in "${PORTLIST[@]}"
do
SPORT=$(echo ${PORTPAIR} | cut -d':' -f1)
DPORT=$(echo ${PORTPAIR} | cut -d':' -f2)
echo "[+] mapping port ${SPORT} -> 192.168.100.2:${DPORT}"
socat TCP-LISTEN:${SPORT},fork,reuseaddr TCP:192.168.100.2:${DPORT} &
done
echo ' ___ __ __ _ __ __'
echo ' / __| \/ | | |\ \/ / by Saumil Shah | The Exploit Laboratory'
echo ' | __| |\/| | |_| ) ( @therealsaumil | emux.exploitlab.net'
echo ' \___|_| |__\___/_/\_\'
echo
exec "$@"