docker error workaround

MS-2855/keylogger-mettle-extension
Christian Mehlmauer 2018-02-16 17:39:20 +01:00
parent 6734e532f5
commit d19ee7a403
No known key found for this signature in database
GPG Key ID: DCF54A05D6E62591
2 changed files with 8 additions and 2 deletions

View File

@ -47,7 +47,7 @@ RUN apk update && \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
RUN adduser -g msfconsole -D $MSF_USER
RUN adduser -g msfconsole -D $MSF_USER -u 1000
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which nmap)

View File

@ -27,4 +27,10 @@ if [[ $PARAMS == *"--rebuild"* ]]; then
exit $?
fi
# workaround if current user id is not the same as in the container.
# Otherwise the ~/.msf4 folder is not writeable
if [[ $EUID -ne 1000 ]]; then
docker-compose run --rm -u root --service-ports ms ./msfconsole -r docker/msfconsole.rc "$PARAMS"
else
docker-compose run --rm --service-ports ms ./msfconsole -r docker/msfconsole.rc "$PARAMS"
fi