From 4c5374d4ac8c3cf5babdb2ab250bbf9cecd1861e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:00:50 +0000 Subject: [PATCH 1/4] Initial plan From cc62fde0679599293d8185dce8026167f63d6102 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:15:30 +0000 Subject: [PATCH 2/4] Fix Docker build issues - use Debian Go and install nikto from GitHub Co-authored-by: The-XSS-Rat <2901706+The-XSS-Rat@users.noreply.github.com> --- Dockerfile | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f2eda9..afd3d92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ # Multi-platform Dockerfile for subScraper reconnaissance tool # Supports linux/amd64, linux/arm64, linux/arm/v7 -FROM --platform=$BUILDPLATFORM python:3.11-slim AS base +FROM python:3.11-slim AS base # Set environment variables ENV PYTHONUNBUFFERED=1 \ - DEBIAN_FRONTEND=noninteractive \ - GO_VERSION=1.21.5 + DEBIAN_FRONTEND=noninteractive -# Install system dependencies +# Install system dependencies and Go from Debian repository +# This ensures compatibility across all platforms and avoids download issues RUN apt-get update && apt-get install -y \ curl \ wget \ @@ -16,22 +16,12 @@ RUN apt-get update && apt-get install -y \ build-essential \ libssl-dev \ ca-certificates \ + golang \ + unzip \ && rm -rf /var/lib/apt/lists/* -# Install Go (required for many recon tools) -ARG TARGETARCH -RUN case ${TARGETARCH} in \ - "amd64") GO_ARCH="amd64" ;; \ - "arm64") GO_ARCH="arm64" ;; \ - "arm") GO_ARCH="armv6l" ;; \ - *) echo "Unsupported architecture: ${TARGETARCH}" && exit 1 ;; \ - esac && \ - wget -q https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GO_ARCH}.tar.gz - -ENV PATH="/usr/local/go/bin:${PATH}" \ - GOPATH="/root/go" \ +# Set Go environment variables +ENV GOPATH="/root/go" \ GOBIN="/root/go/bin" ENV PATH="${GOBIN}:${PATH}" @@ -53,8 +43,10 @@ RUN go install -v github.com/ffuf/ffuf/v2@latest # Install gowitness for screenshots RUN go install -v github.com/sensepost/gowitness@latest -# Install findomain (binary release) -RUN case ${TARGETARCH} in \ +# Install findomain (binary release) - optional, architecture-specific +# Declare TARGETARCH for architecture detection +ARG TARGETARCH +RUN case ${TARGETARCH:-amd64} in \ "amd64") FINDOMAIN_ARCH="x86_64" ;; \ "arm64") FINDOMAIN_ARCH="aarch64" ;; \ "arm") FINDOMAIN_ARCH="armv7" ;; \ @@ -64,13 +56,22 @@ RUN case ${TARGETARCH} in \ unzip -q findomain.zip && \ chmod +x findomain && \ mv findomain /usr/local/bin/ && \ - rm findomain.zip || echo "Findomain installation skipped for ${TARGETARCH}" + rm findomain.zip || echo "Findomain installation skipped for ${TARGETARCH:-amd64}" # Install Python-based tools -RUN pip install --no-cache-dir sublist3r nikto-parser +RUN pip install --no-cache-dir sublist3r -# Install nikto (Perl-based) -RUN apt-get update && apt-get install -y nikto && rm -rf /var/lib/apt/lists/* +# Install nikto (Perl-based) from GitHub +# First install Perl and dependencies +RUN apt-get update && apt-get install -y \ + perl \ + libnet-ssleay-perl \ + libjson-perl \ + libxml-writer-perl \ + && rm -rf /var/lib/apt/lists/* && \ + git clone https://github.com/sullo/nikto /opt/nikto && \ + ln -s /opt/nikto/program/nikto.pl /usr/local/bin/nikto && \ + chmod +x /opt/nikto/program/nikto.pl # Install nmap RUN apt-get update && apt-get install -y nmap && rm -rf /var/lib/apt/lists/* From 7bb63bd69c0b26c7291ee4d1f0a7f79cfc53d4a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:17:54 +0000 Subject: [PATCH 3/4] Update Docker documentation with first-time setup instructions Co-authored-by: The-XSS-Rat <2901706+The-XSS-Rat@users.noreply.github.com> --- DOCKER_BUILD.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/DOCKER_BUILD.md b/DOCKER_BUILD.md index 08c10e9..4eb7dd2 100644 --- a/DOCKER_BUILD.md +++ b/DOCKER_BUILD.md @@ -77,8 +77,37 @@ docker buildx build --platform linux/arm/v7 \ ## Running the Container +### First-Time Setup (Required) + +On the first run, you need to create an admin account. Run the container in interactive mode: + +```bash +# Create recon_data directory first (if it doesn't exist) +mkdir -p recon_data + +# Run in interactive mode to create admin account +docker run -it \ + --name subscraper \ + -p 8342:8342 \ + -v $(pwd)/recon_data:/app/recon_data \ + subscraper:latest + +# Follow the prompts to: +# 1. Create an admin account (username and password) +# 2. Configure basic settings (or skip and configure later via web UI) +``` + +After the admin account is created and the server starts, you can: +- Press `Ctrl+C` to stop the server +- Remove the container: `docker rm subscraper` +- Run in detached mode (see "Basic Run" below) + +**Important**: The admin account and all configuration is stored in the `recon_data` volume, so you only need to do this once. + ### Basic Run +After initial setup, run in detached mode: + ```bash docker run -d \ --name subscraper \ @@ -212,7 +241,9 @@ All completed job reports, scan results, and configuration will be preserved. ## Docker Compose (Optional) -Create a `docker-compose.yml` file for easier management: +### First-Time Setup with Docker Compose + +Create a `docker-compose.yml` file: ```yaml version: '3.8' @@ -239,10 +270,16 @@ services: start_period: 5s ``` -Then run: +**First Run**: Create admin account in interactive mode: ```bash -# Start the service +# Build and run in interactive mode for first-time setup +docker-compose run --rm subscraper + +# Follow the prompts to create admin account +# After setup, stop with Ctrl+C + +# Then start normally in detached mode docker-compose up -d # View logs @@ -260,6 +297,24 @@ docker-compose down ## Troubleshooting +### Issue: "ERROR: No admin account exists" + +If the container exits immediately with this error, you need to create an admin account first: + +```bash +# Run in interactive mode to create admin account +docker run -it \ + --name subscraper \ + -p 8342:8342 \ + -v $(pwd)/recon_data:/app/recon_data \ + subscraper:latest + +# Or with docker-compose: +docker-compose run --rm subscraper +``` + +Follow the prompts to create an admin account. The account is saved in `recon_data/users.json` and persists across container restarts. + ### Issue: "no matching manifest" This means the image wasn't built for your platform. Rebuild with: From cc04c459667399251e97b3ea31bd48e448f7b77d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:19:05 +0000 Subject: [PATCH 4/4] Address code review feedback - improve comments and documentation Co-authored-by: The-XSS-Rat <2901706+The-XSS-Rat@users.noreply.github.com> --- DOCKER_BUILD.md | 3 ++- Dockerfile | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/DOCKER_BUILD.md b/DOCKER_BUILD.md index 4eb7dd2..d756632 100644 --- a/DOCKER_BUILD.md +++ b/DOCKER_BUILD.md @@ -274,7 +274,8 @@ services: ```bash # Build and run in interactive mode for first-time setup -docker-compose run --rm subscraper +# Use --service-ports to expose port 8342 during setup +docker-compose run --rm --service-ports subscraper # Follow the prompts to create admin account # After setup, stop with Ctrl+C diff --git a/Dockerfile b/Dockerfile index afd3d92..ad96d0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,8 @@ RUN go install -v github.com/ffuf/ffuf/v2@latest RUN go install -v github.com/sensepost/gowitness@latest # Install findomain (binary release) - optional, architecture-specific -# Declare TARGETARCH for architecture detection +# Declare TARGETARCH for architecture detection (defaults to amd64 if not set by buildx) +# Note: When building without buildx, TARGETARCH will default to amd64 ARG TARGETARCH RUN case ${TARGETARCH:-amd64} in \ "amd64") FINDOMAIN_ARCH="x86_64" ;; \ @@ -58,7 +59,8 @@ RUN case ${TARGETARCH:-amd64} in \ mv findomain /usr/local/bin/ && \ rm findomain.zip || echo "Findomain installation skipped for ${TARGETARCH:-amd64}" -# Install Python-based tools +# Install Python-based tool (sublist3r) +# Note: nikto-parser was removed as it doesn't exist in PyPI RUN pip install --no-cache-dir sublist3r # Install nikto (Perl-based) from GitHub