forked from sullo/nikto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (30 loc) · 1.21 KB
/
Dockerfile
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
FROM alpine:3.10.0
LABEL version="2.1.6" \
author="Author Paul Sec (https://github.com/PaulSec), Nikto User https://github.com/drwetter" \
docker_build="docker build -t sullo/nikto:2.1.6 ." \
docker_run_basic="docker run --rm sullo/nikto:2.1.6 -h http://www.example.com" \
docker_run_advanced="docker run --rm -v $(pwd):/tmp sullo/nikto:2.1.6 -h http://www.example.com -o /tmp/out.json"
COPY ["program/", "/nikto"]
ENV PATH=${PATH}:/nikto
RUN echo 'Selecting packages to Nikto.' \
&& apk update \
&& apk add --no-cache --virtual .build-deps \
perl \
perl-net-ssleay \
&& echo 'Cleaning cache from APK.' \
&& rm -rf /var/cache/apk/* \
&& echo 'Creating the nikto group.' \
&& addgroup nikto \
&& echo 'Creating the user nikto.' \
&& adduser -G nikto -g "Nikto user" -s /bin/sh -D nikto \
&& echo 'Changing the ownership.' \
&& chown -R nikto.nikto /nikto \
&& echo 'Creating a random password for root.' \
&& export RANDOM_PASSWORD=`tr -dc A-Za-z0-9 < /dev/urandom | head -c44` \
&& echo "root:$RANDOM_PASSWORD" | chpasswd \
&& unset RANDOM_PASSWORD \
&& echo 'Locking root account.' \
&& passwd -l root \
&& echo 'Finishing image.'
USER nikto
ENTRYPOINT ["nikto.pl"]