File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ RUN apk update && \
47
47
&& apk del .ruby-builddeps \
48
48
&& rm -rf /var/cache/apk/*
49
49
50
- RUN adduser -g msfconsole -D $MSF_USER
50
+ RUN adduser -g msfconsole -D $MSF_USER -u 1000
51
51
52
52
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
53
53
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)
Original file line number Diff line number Diff line change @@ -27,4 +27,10 @@ if [[ $PARAMS == *"--rebuild"* ]]; then
27
27
exit $?
28
28
fi
29
29
30
- docker-compose run --rm --service-ports ms ./msfconsole -r docker/msfconsole.rc " $PARAMS "
30
+ # workaround if current user id is not the same as in the container.
31
+ # Otherwise the ~/.msf4 folder is not writeable
32
+ if [[ $EUID -ne 1000 ]]; then
33
+ docker-compose run --rm -u root --service-ports ms ./msfconsole -r docker/msfconsole.rc " $PARAMS "
34
+ else
35
+ docker-compose run --rm --service-ports ms ./msfconsole -r docker/msfconsole.rc " $PARAMS "
36
+ fi
You can’t perform that action at this time.
0 commit comments