Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ This code now supports the armv7l architecture, referring to it as armhf in the context of Ubuntu's architecture naming. #1366

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
159 changes: 78 additions & 81 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
# Base image
FROM ubuntu:22.04

ARG GECKOVERSION=0.33.0
# Arguments for versions
ARG GECKOVERSION=0.35.0
ARG GOVERSION=1.21.5

RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" ! "arm64" ] || [ "${ARCH}" ! "amd64" ]; then \
echo "reNgine not supported, encountered unknown architecture: ${TARGETPLATFORM}" \
&& exit 1; \
fi
# Supported architectures
ARG SUPPORTED_ARCH="amd64 arm64 armv6 armv7 armhf i386"

# Labels and Credits
LABEL \
name="reNgine" \
author="Yogesh Ojha <[email protected]>" \
description="reNgine is a automated pipeline of recon process, useful for information gathering during web application penetration testing."
# Labels
LABEL name="reNgine" \
author="Yogesh Ojha <[email protected]>" \
description="reNgine is an automated pipeline for recon processes, useful for information gathering during web application penetration testing."

# Environment Variables
# Environment variables
ENV DEBIAN_FRONTEND="noninteractive" \
DATABASE="postgres"
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV GOROOT="/usr/local/go"
ENV GOPATH=$HOME/go
ENV PATH="${PATH}:${GOROOT}/bin:${GOPATH}/bin"

# Install Python
RUN apt update -y && \
apt install -y \
python3.10 \
python3-dev \
python3-pip

# Install essential packages
RUN apt install -y --no-install-recommends \
build-essential \
cmake \
geoip-bin \
geoip-database \
gcc \
git \
libpq-dev \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libpcap-dev \
netcat \
nmap \
x11-utils \
xvfb \
wget \
curl \
python3-netaddr \
software-properties-common

RUN add-apt-repository ppa:mozillateam/ppa

RUN ARCH=$(dpkg --print-architecture) \
&& wget https://go.dev/dl/go${GOVERSION}.linux-${ARCH}.tar.gz \
&& tar -xvf go${GOVERSION}.linux-${ARCH}.tar.gz -C /usr/local \
&& rm go${GOVERSION}.linux-${ARCH}.tar.gz

RUN ARCH=$(dpkg --print-architecture) \
&& if [ "${ARCH}" = "arm64" ]; then \
GECKOPATH="geckodriver-v${GECKOVERSION}-linux-aarch64.tar.gz"; \
elif [ "${ARCH}" = "amd64" ]; then \
GECKOPATH="geckodriver-v${GECKOVERSION}-linux64.tar.gz"; \
fi \
&& wget https://github.com/mozilla/geckodriver/releases/download/v${GECKOVERSION}/${GECKOPATH} \
&& tar -xvf ${GECKOPATH} \
&& rm ${GECKOPATH} \
&& mv geckodriver /usr/bin
DATABASE="postgres" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
HOME="/root" \
GOROOT="/usr/local/go" \
GOPATH="/root/go" \
PATH="$PATH:/usr/local/go/bin:/root/go/bin" \
GO111MODULE=on

# Install required packages and add Mozilla Team PPA
RUN ARCH=$(dpkg --print-architecture) \
&& echo "$SUPPORTED_ARCH" | grep -qw "$ARCH" || { \
echo "Unsupported architecture: $ARCH"; exit 1; \
} \
&& apt update -y \
&& apt install -y --no-install-recommends \
python3.10 python3-dev python3-pip \
build-essential cmake geoip-bin geoip-database \
gcc git libpq-dev libpango-1.0-0 libpangoft2-1.0-0 \
libpcap-dev netcat nmap x11-utils xvfb wget curl \
python3-netaddr software-properties-common \
gpg-agent \
&& add-apt-repository -y ppa:mozillateam/ppa \
&& apt update -y

# Install Go based on architecture
RUN ARCH=$(dpkg --print-architecture) \
&& case "$ARCH" in \
arm64) GOFILE="go${GOVERSION}.linux-arm64.tar.gz" ;; \
amd64) GOFILE="go${GOVERSION}.linux-amd64.tar.gz" ;; \
armhf|armv6|armv7) GOFILE="go${GOVERSION}.linux-armv6l.tar.gz" ;; \
i386) GOFILE="go${GOVERSION}.linux-386.tar.gz" ;; \
*) echo "Unsupported architecture: $ARCH"; exit 1 ;; \
esac \
&& wget https://go.dev/dl/${GOFILE} \
&& tar -xvf ${GOFILE} -C /usr/local \
&& rm ${GOFILE}

# Install Geckodriver based on architecture
RUN ARCH=$(dpkg --print-architecture) \
&& case "$ARCH" in \
arm64) GECKOPATH="geckodriver-v${GECKOVERSION}-linux-aarch64.tar.gz" \
GECKOREPO="https://github.com/khulnasoft-lab/geckodriver/releases/download/v${GECKOVERSION}/${GECKOPATH}" ;; \
armv7l) GECKOPATH="geckodriver-v${GECKOVERSION}-linux-armv7l.tar.gz" \
GECKOREPO="https://github.com/khulnasoft-lab/geckodriver/releases/download/v${GECKOVERSION}/${GECKOPATH}" ;; \
amd64) GECKOPATH="geckodriver-v${GECKOVERSION}-linux64.tar.gz" ;; \
armhf|armv6|i386) GECKOPATH="geckodriver-v${GECKOVERSION}-linux32.tar.gz" ;; \
*) echo "Unsupported architecture: $ARCH"; exit 1 ;; \
esac \
&& wget ${GECKOREPO:-https://github.com/mozilla/geckodriver/releases/download/v${GECKOVERSION}/${GECKOPATH}} \
&& tar -xvf ${GECKOPATH} -C /usr/local/bin \
&& rm ${GECKOPATH}

# Install Rust for orjson
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& echo "source $HOME/.cargo/env" >> $HOME/.bashrc

ENV PATH="/root/.cargo/bin:$PATH"

# Install Maturin for Python bindings
RUN pip3 install maturin

# Make directory for app
# Set working directory
WORKDIR /usr/src/app

ENV GO111MODULE=on
# Install Go tools
RUN printf "\
github.com/jaeles-project/gospider@latest\n\
github.com/tomnomnom/gf@latest\n\
Expand All @@ -98,24 +99,20 @@ RUN printf "\
github.com/projectdiscovery/katana/cmd/katana@latest\n\
github.com/dwisiswant0/crlfuzz/cmd/crlfuzz@latest\n\
github.com/sa7mon/s3scanner@latest\n" | \
xargs -L1 go install -ldflags="-s -w" -v && \
rm -rf /go/pkg/* && rm -rf /root/.cache/go-build

xargs -L1 go install -ldflags="-s -w" -v \
&& rm -rf /go/pkg/* /root/.cache/go-build

# Update Nuclei and Nuclei-Templates
RUN nuclei -update-templates

# Copy requirements
# Install Python dependencies
COPY ./requirements.txt /tmp/requirements.txt
RUN pip3 install --upgrade setuptools==72.1.0
RUN pip3 install -r /tmp/requirements.txt --no-cache-dir
RUN pip3 install --upgrade setuptools==72.1.0 \
&& pip3 install -r /tmp/requirements.txt --no-cache-dir

# install eyewitness
RUN pip3 install --no-cache-dir fuzzywuzzy \
selenium==4.9.1 \
python-Levenshtein \
pyvirtualdisplay \
netaddr
# Install eyewitness dependencies
RUN pip3 install --no-cache-dir \
fuzzywuzzy selenium==4.9.1 python-Levenshtein pyvirtualdisplay netaddr

# Copy source code
# Copy application code
COPY . /usr/src/app/