Last active
June 16, 2021 01:13
-
-
Save Nuxij/b237bf57e60c5eeb60264c1df48a3470 to your computer and use it in GitHub Desktop.
[Docker] masscan on alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example: | |
# $ docker build -t masscan -f masscan.Dockerfile . | |
# $ docker run --rm -it --net=host masscan -p0-65535 192.168.0.0/16 --rate 1000000 | |
# --net=host is optional but I saw rate limit without it | |
# -v $(pwd):/opt if you want to feed result files back out | |
FROM alpine as builder | |
LABEL author "Peng Liu" | |
LABEL email "myme5261314@gmail.com" | |
ARG MASSCAN_GIT_URL=https://github.com/robertdavidgraham/masscan | |
RUN set -ex; \ | |
apk --update add --no-cache \ | |
ca-certificates \ | |
clang \ | |
clang-dev \ | |
gcc \ | |
git \ | |
libc-dev \ | |
linux-headers \ | |
make \ | |
libpcap-dev && \ | |
git clone "$MASSCAN_GIT_URL"; \ | |
cd masscan && \ | |
make -j4 && \ | |
cp bin/masscan /usr/local/bin/ && \ | |
cd .. && \ | |
rm -rf masscan | |
FROM alpine | |
LABEL author "Joe Eaves" | |
LABEL email "joe.eaves@shadowacre.ltd" | |
RUN apk --update add --no-cache libpcap-dev | |
COPY --from=builder /usr/local/bin/masscan /usr/local/bin/masscan | |
ENTRYPOINT ["/usr/local/bin/masscan"] | |
WORKDIR /opt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment