Skip to content

Commit

Permalink
Fix: Major Updates with all the tools installations and minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RAJANAGORI committed Nov 7, 2024
1 parent 7c7b2ad commit 176ac9e
Show file tree
Hide file tree
Showing 20 changed files with 199 additions and 117 deletions.
99 changes: 37 additions & 62 deletions .github/workflows/docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Docker Image CI

on:
push:
Expand All @@ -17,76 +17,51 @@ on:
env:
DOCKER_REGISTRY: ghcr.io
DOCKERFILES_PATH: Dockerfiles
IMAGE_NAME: ${{ github.repository }}

ACTIONS_RUNNER_DEBUG: true
ACTIONS_STEP_DEBUG: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Github Login
env:
GITHUB_TOKEN: ${{secrets.TOKEN}}

- name: GitHub Login
run: echo "${{ secrets.TOKEN }}" | docker login ghcr.io -u ${{ secrets.USERNAME }} --password-stdin

- name: Set Username to Lowercase
run: |
echo "${{secrets.TOKEN}}" | docker login ghcr.io -u ${{secrets.USERNAME}} --password-stdin
# Clear apt cache
USERNAME_LOWER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo "USERNAME=$USERNAME_LOWER" >> $GITHUB_ENV

- name: Clear apt cache
run: sudo apt-get clean

# # Build Docker images
# - name: Build nightingale_programming_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/programming_langauge.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_programming_image:stable
# # # Push Docker images
# - name: Push nightingale_programming_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_programming_image:stable"
- name: Get Commit Hash
id: vars
run: echo "COMMIT_HASH=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV

# - name: Build nightingale_forensic_and_red_teaming
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/forensics_and_redteam.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_forensic_and_red_teaming:stable

# - name: Push nightingale_forensic_and_red_teaming1
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_forensic_and_red_teaming:stable"

# - name: Build nightingale_web_vapt_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/web_vapt.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_web_vapt_image:stable

# - name: Push nightingale_web_vapt_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_web_vapt_image:stable"

# - name: Build nightingale_network_vapt_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/network_vapt.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_network_vapt_image:stable

# - name: Push nightingale_network_vapt_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_network_vapt_image:stable"

# - name: Build nightingale_osint_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/osint_tools.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_osint_tools_image:stable

# - name: Push nightingale_osint_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_osint_tools_image:stable"

# - name: Build nightingale_mobile_vapt_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/mobile_vapt.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_mobile_vapt_image:stable

# - name: Push nightingale_mobile_vapt_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_mobile_vapt_image:stable"

# - name: Build nightingale_wordlist_image
# run: |
# docker build . --no-cache --file $DOCKERFILES_PATH/wordlist.Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale_wordlist_image:stable

# - name: Push nightingale_wordlist_image
# run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale_wordlist_image:stable"

- name: Build nightingale_stable_image
# Build and Push Docker images with main and commit hash tags only
- name: Build and Push Images
run: |
docker build . --no-cache --file Dockerfile --label branch=stable --label owner=RAJANAGORI --tag $DOCKER_REGISTRY/rajanagori/nightingale:stable
- name: Push nightingale_stable_image
run: docker push "$DOCKER_REGISTRY/rajanagori/nightingale:stable"
IMAGES=(
"nightingale_programming_image:$DOCKERFILES_PATH/programming_langauge.Dockerfile"
"nightingale_forensic_and_red_teaming:$DOCKERFILES_PATH/forensics_and_redteam.Dockerfile"
"nightingale_web_vapt_image:$DOCKERFILES_PATH/web_vapt.Dockerfile"
"nightingale_network_vapt_image:$DOCKERFILES_PATH/network_vapt.Dockerfile"
"nightingale_osint_tools_image:$DOCKERFILES_PATH/osint_tools.Dockerfile"
"nightingale_mobile_vapt_image:$DOCKERFILES_PATH/mobile_vapt.Dockerfile"
"nightingale_wordlist_image:$DOCKERFILES_PATH/wordlist.Dockerfile"
"nightingale:Dockerfile"
)
for IMAGE in "${IMAGES[@]}"; do
IFS=":" read -r IMAGE_NAME DOCKERFILE_PATH <<< "$IMAGE"
docker build . --no-cache --file $DOCKERFILE_PATH \
--label branch=main --label owner=RAJANAGORI \
--tag $DOCKER_REGISTRY/${{ env.USERNAME }}/$IMAGE_NAME:stable \
--tag $DOCKER_REGISTRY/${{ env.USERNAME }}/$IMAGE_NAME:${{ env.COMMIT_HASH }}
docker push "$DOCKER_REGISTRY/${{ env.USERNAME }}/$IMAGE_NAME:stable"
docker push "$DOCKER_REGISTRY/${{ env.USERNAME }}/$IMAGE_NAME:${{ env.COMMIT_HASH }}"
done
26 changes: 15 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update -y --fix-missing && \
locate \
snapd \
tree \
zsh \
figlet \
unzip \
p7zip-full \
Expand Down Expand Up @@ -62,11 +63,11 @@ RUN apt-get update -y --fix-missing && \
# Stage 2: Copy Scripts and Configurations
FROM base as intermediate

COPY shells/banner.sh /temp/banner.sh
COPY shells/banner.sh /tmp/banner.sh
COPY configuration/nodejs-env/ /temp/

RUN dos2unix ${HOME}/.bashrc && \
cat /temp/banner.sh >> ${HOME}/.bashrc && \
cat /tmp/banner.sh >> ${HOME}/.bashrc && \
mkdir -p /home/tools_web_vapt /home/tools_osint /home/tools_mobile_vapt /home/tools_network_vapt \
/home/tools_red_teaming /home/tools_forensics /home/wordlist /home/binaries /home/.gf /home/.shells

Expand All @@ -83,14 +84,14 @@ ENV TOOLS_WEB_VAPT=/home/tools_web_vapt \
METASPLOIT_TOOL=/home/metasploit \
SHELLS=/home/.shells

COPY --from=ghcr.io/rajanagori/nightingale_web_vapt_image:development ${TOOLS_WEB_VAPT} ${TOOLS_WEB_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_web_vapt_image:development ${GREP_PATTERNS} ${GREP_PATTERNS}
COPY --from=ghcr.io/rajanagori/nightingale_osint_tools_image:development ${TOOLS_OSINT} ${TOOLS_OSINT}
COPY --from=ghcr.io/rajanagori/nightingale_mobile_vapt_image:development ${TOOLS_MOBILE_VAPT} ${TOOLS_MOBILE_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_network_vapt_image:development ${TOOLS_NETWORK_VAPT} ${TOOLS_NETWORK_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_forensic_and_red_teaming:development ${TOOLS_RED_TEAMING} ${TOOLS_RED_TEAMING}
COPY --from=ghcr.io/rajanagori/nightingale_forensic_and_red_teaming:development ${TOOLS_FORENSICS} ${TOOLS_FORENSICS}
COPY --from=ghcr.io/rajanagori/nightingale_wordlist_image:development ${WORDLIST} ${WORDLIST}
COPY --from=ghcr.io/rajanagori/nightingale_web_vapt_image:stable ${TOOLS_WEB_VAPT} ${TOOLS_WEB_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_web_vapt_image:stable ${GREP_PATTERNS} ${GREP_PATTERNS}
COPY --from=ghcr.io/rajanagori/nightingale_osint_tools_image:stable ${TOOLS_OSINT} ${TOOLS_OSINT}
COPY --from=ghcr.io/rajanagori/nightingale_mobile_vapt_image:stable ${TOOLS_MOBILE_VAPT} ${TOOLS_MOBILE_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_network_vapt_image:stable ${TOOLS_NETWORK_VAPT} ${TOOLS_NETWORK_VAPT}
COPY --from=ghcr.io/rajanagori/nightingale_forensic_and_red_teaming:stable ${TOOLS_RED_TEAMING} ${TOOLS_RED_TEAMING}
COPY --from=ghcr.io/rajanagori/nightingale_forensic_and_red_teaming:stable ${TOOLS_FORENSICS} ${TOOLS_FORENSICS}
COPY --from=ghcr.io/rajanagori/nightingale_wordlist_image:stable ${WORDLIST} ${WORDLIST}

# Stage 3: Install Python and Go Modules
FROM intermediate as modules
Expand All @@ -111,7 +112,9 @@ RUN chmod +x ${BINARIES}/* && \
wget -L https://github.com/tsl0922/ttyd/archive/refs/tags/1.7.2.zip && \
unzip 1.7.2.zip && \
cd ttyd-1.7.2 && mkdir build && cd build && \
cmake .. && make && make install
cmake .. && make && make install &&\
## Install tools using curl or wget
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin

# Stage 4: Setup Metasploit
FROM modules as metasploit
Expand All @@ -129,6 +132,7 @@ EXPOSE 5432 8080 8081 7681
RUN apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /tmp/* /var/lib/apt/lists/* && \
ln -s ${TOOLS_WEB_VAPT}/hashcat/hashcat /usr/local/bin/hashcat && \
echo 'export PATH="$PATH:/root/.local/bin"' >> ~/.bashrc

WORKDIR /home
24 changes: 10 additions & 14 deletions Dockerfiles/programming_langauge.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Base stage
FROM debian:buster-slim as base
FROM debian:buster-slim AS base

# Install common dependencies
RUN apt-get update -y --fix-missing && \
Expand All @@ -11,10 +11,10 @@ RUN apt-get update -y --fix-missing && \
ca-certificates

# Stage 2: Python 2 stage
FROM python:2.7-slim as python2
FROM python:2.7-slim AS python2

# Stage 3: Python 3 stage
FROM python:3.10.12-slim as python3
FROM python:3.10.12-slim AS python3

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -28,27 +28,24 @@ RUN apt-get update && \
pip install --upgrade pip && \
pip install setuptools==58.2.0 && \
pip install pipx

ENV PATH="/opt/venv3/bin:$PATH"

# Stage 4: Ruby stage
FROM ruby:3.0.3-slim as ruby-builder
FROM ruby:3.0.3-slim AS ruby-builder

RUN gem install nokogiri

# Stage 5: Go stage
FROM base as go-builder
FROM base AS go-builder

WORKDIR /home
RUN wget -q https://go.dev/dl/go1.21.5.linux-amd64.tar.gz -O go.tar.gz && \
RUN wget -q https://go.dev/dl/go1.23.2.linux-amd64.tar.gz -O go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz

# Stage 6: Java stage
FROM openjdk:23-jdk-oracle as java
FROM openjdk:23-jdk-oracle AS java

# Stage 7: Final stage
FROM debian:stable-slim as final
FROM debian:stable-slim AS final

COPY configuration/nodejs-env/node-installation-script.sh /temp/node-installation-script.sh

Expand Down Expand Up @@ -107,10 +104,9 @@ COPY --from=go-builder /home /home
COPY --from=java /usr/java/openjdk-23 /usr/java/openjdk-23

# Set environment variables
ENV PATH="/usr/java/openjdk-23/bin:/opt/venv3/bin:$PATH"
ENV PYTHON2="/usr/local/bin/python2.7"
ENV PYTHON3="/usr/bin/python3"
ENV GOROOT="/usr/local/go"
ENV GOPATH="/home/go"
ENV PATH="$PATH:$GOPATH/bin:$GOROOT/bin"
ENV JAVA_HOME="/usr/java/openjdk-23"
ENV JAVA_HOME="/usr/java/openjdk-23"
ENV PATH="$GOPATH/bin:$GOROOT/bin:$PYTHON3:$PYTHON2:$JAVA_HOME:$PATH"
31 changes: 29 additions & 2 deletions Dockerfiles/web_vapt.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ RUN \
#git clone jwt_tool
git clone --depth 1 https://github.com/ticarpi/jwt_tool.git &&\
#git clone whatweb
git clone --depth 1 https://github.com/urbanadventurer/WhatWeb.git
git clone --depth 1 https://github.com/urbanadventurer/WhatWeb.git &&\
#Install git leaks
git clone --depth 1 https://github.com/gitleaks/gitleaks.git &&\
# Install Ghauri
git clone --depth 1 https://github.com/r0oth3x49/ghauri.git &&\
# Install Hashcat
git clone https://github.com/hashcat/hashcat.git


### Installing Tools
RUN \
Expand Down Expand Up @@ -96,6 +103,26 @@ RUN \
rm -rf /tmp/* &&\
rm -rf /var/lib/apt/lists/* &&\
echo 'export PATH="$PATH:/root/.local/bin"' >> ~/.bashrc


RUN \
### Installing Trufflehog
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin


RUN \
## Installing Git leaks
cd gitleaks &&\
make build

RUN \
## Installing Ghauri
cd ghauri &&\
while read p; do pipx install --include-deps "$p"; done < requirements.txt &&\
python3 setup.py install

RUN \
cd hashcat && \
make && \
ln -s ${TOOLS_WEB_VAPT}/hashcat/hashcat /usr/local/bin/hashcat

WORKDIR /home
4 changes: 1 addition & 3 deletions Dockerfiles/wordlist.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Taking Image from Docker Hub for Programming language support
# Taking Image from Docker Hub for Programming language support
FROM ghcr.io/rajanagori/nightingale_programming_image:stable
ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -23,8 +23,6 @@ RUN git clone --depth 1 https://github.com/xmendez/wfuzz.git && \
git clone --depth 1 https://github.com/daviddias/node-dirbuster.git && \
git clone --depth 1 https://github.com/v0re/dirb.git && \
curl -L -o rockyou.txt https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt && \
curl -L -o all.txt https://gist.githubusercontent.com/jhaddix/86a06c5dc309d08580a018c66354a056/raw/96f4e51d96b2203f19f6381c8c545b278eaa0837/all.txt && \
curl -L -o fuzz.txt https://raw.githubusercontent.com/Bo0oM/fuzz.txt/master/fuzz.txt && \
# Cleaning Unwanted libraries
apt-get -y autoremove && \
apt-get -y clean && \
Expand Down
Loading

0 comments on commit 176ac9e

Please sign in to comment.