added katana/shortscan

This commit is contained in:
defparam 2024-07-16 22:42:27 -04:00
parent d3d70a6bab
commit 6f861bb483
3 changed files with 49 additions and 7 deletions

View File

@ -3,6 +3,7 @@ FROM --platform=linux/amd64 python:3.12-slim
# Set environment variables to avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
ENV GO111MODULE=on
# Install dependencies
RUN apt-get update && \
@ -25,9 +26,18 @@ RUN curl -sSL https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sa
./sam-installation/install && \
rm -rf sam-cli.zip sam-installation
# Install the latest version of Go
RUN wget "https://go.dev/dl/go1.22.5.linux-amd64.tar.gz" -O go.tar.gz && \
tar -C /usr/local -xzf go.tar.gz && \
rm go.tar.gz
# Set Go environment variables
ENV PATH="/usr/local/go/bin:${PATH}"
# Verify installations
RUN aws --version && \
sam --version && \
go version && \
python --version
WORKDIR /lambda

View File

@ -74,10 +74,26 @@ if [ "$arch" == "x86_64" ]; then
mv $tmpdir/nuclei ./app/tools/bin
rm -rf $tmpdir
echo "Installing katana..."
tmpdir=$(mktemp -d)
wget https://github.com/projectdiscovery/katana/releases/download/v1.1.0/katana_1.1.0_linux_amd64.zip -O $tmpdir/katana.zip > /dev/null 2>&1
unzip $tmpdir/katana.zip -d $tmpdir > /dev/null 2>&1
mv $tmpdir/katana ./app/tools
rm -rf $tmpdir
echo "Installing shortscan..."
git clone https://github.com/bitquark/shortscan.git > /dev/null 2>&1
cd shortscan
go mod tidy > /dev/null 2>&1
GOARCH=amd64 go build -o ../app/tools/shortscan ./cmd/shortscan > /dev/null 2>&1
cd ..
rm -rf shortscan
tmpdir=$(mktemp -d)
wget http://ftp.us.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-4_amd64.deb -O $tmpdir/busybox.deb > /dev/null 2>&1
dpkg -x $tmpdir/busybox.deb $tmpdir > /dev/null 2>&1
mv $tmpdir/bin/busybox ./app/tools/bin/
rm -rf $tmpdir
elif [ "$arch" == "arm64" ]; then
@ -123,17 +139,31 @@ elif [ "$arch" == "arm64" ]; then
mv $tmpdir/nuclei ./app/tools/bin
rm -rf $tmpdir
echo "Installing katana..."
tmpdir=$(mktemp -d)
wget https://github.com/projectdiscovery/katana/releases/download/v1.1.0/katana_1.1.0_linux_arm64.zip -O $tmpdir/katana.zip > /dev/null 2>&1
unzip $tmpdir/katana.zip -d $tmpdir > /dev/null 2>&1
mv $tmpdir/katana ./app/tools
rm -rf $tmpdir
echo "Installing shortscan..."
git clone https://github.com/bitquark/shortscan.git > /dev/null 2>&1
cd shortscan
go mod tidy > /dev/null 2>&1
GOARCH=arm64 go build -o ../app/tools/shortscan ./cmd/shortscan > /dev/null 2>&1
cd ..
rm -rf shortscan
tmpdir=$(mktemp -d)
wget http://ftp.us.debian.org/debian/pool/main/b/busybox/busybox_1.30.1-4_arm64.deb -O $tmpdir/busybox.deb > /dev/null 2>&1
dpkg -x $tmpdir/busybox.deb $tmpdir > /dev/null 2>&1
mv $tmpdir/bin/busybox ./app/tools/bin/
rm -rf $tmpdir
fi
echo "Installing nuclei-templates..."
tmpdir=$(mktemp -d)
wget https://github.com/projectdiscovery/nuclei-templates/archive/refs/tags/v9.9.1.zip -O ./app/tools/config/nuclei-templates.zip > /dev/null 2>&1
echo "Installing smuggler..."
git clone https://github.com/defparam/smuggler ./app/tools/bin/smuggler > /dev/null 2>&1
echo "Installing SecLists's common.txt wordlist..."
wget https://raw.githubusercontent.com/danielmiessler/SecLists/master/Discovery/Web-Content/common.txt -O ./app/tools/wordlists/common.txt > /dev/null 2>&1

View File

@ -16,8 +16,10 @@ export DISABLE_NUCLEI_TEMPLATES_AWS_DOWNLOAD=true
# Disable download from public / private Azure Blob Storage
export DISABLE_NUCLEI_TEMPLATES_AZURE_DOWNLOAD=true
$DIR/bin/busybox unzip -d /tmp $DIR/config/nuclei-templates.zip > /dev/null 2>&1
$DIR/bin/busybox wget https://github.com/projectdiscovery/nuclei-templates/archive/refs/tags/v9.9.1.zip -O /tmp/nuclei-templates.zip > /dev/null 2>&1
$DIR/bin/busybox unzip -d /tmp /tmp/nuclei-templates.zip > /dev/null 2>&1
# This will create a /tmp/nuclei-templates-X.X.X directory, change it to /tmp/nuclei-templates
mv /tmp/nuclei-templates-* /tmp/nuclei-templates > /dev/null 2>&1
mv /tmp/nuclei-templates-* /tmp/nuclei-templates > /dev/null 2>&1
$DIR/bin/nuclei $@