Skip to content

4. Installation and Setup

Raja Nagori edited this page Apr 30, 2025 · 3 revisions

Installation and Setup Guide for Nightingale

Welcome to the Installation and Setup Guide for Nightingale! This guide walks you through building and running the Nightingale Docker image. It also provides additional Docker tips and tricks to help you maximize the potential of this powerful open-source tool.


Prerequisites

Before you begin, ensure the following tools are installed on your system:


Steps to Build the Docker Image

For AMD Architecture

  1. Clone the Repository

    Clone the Nightingale repository using the following command:

    git clone --depth 1 https://github.com/RAJANAGORI/Nightingale.git

    The --depth 1 option ensures only the latest commit is cloned, speeding up the process and saving space.

  2. Navigate to the Repository

    Change your current directory to the Nightingale folder:

    cd Nightingale
  3. Build the Docker Image

    Build the Docker image with the following command:

    docker build -t rajanagori/nightingale:stable .

    This command creates an image tagged as rajanagori/nightingale:stable. The . at the end specifies the current directory containing the Dockerfile.


For ARM Architecture

  1. Clone the Repository

    Follow the same cloning step as described above.

  2. Navigate to the ARM64 Directory

    Change to the directory for ARM architecture:

    cd Nightingale/architecture/arm64/v8
  3. Build the ARM64 Image

    Use the following command to build the Docker image for ARM architecture:

    docker buildx build --platform linux/arm64 -t rajanagori/nightingale:arm64 .

    This command uses buildx to build an image compatible with ARM64 systems.


Using Pre-Built Docker Images

If you prefer not to build the image yourself, pre-built images are available for both AMD and ARM64 architectures.

For AMD Architecture

  1. Pull the Stable Release

    Use the following command to pull the pre-built image:

    docker pull ghcr.io/rajanagori/nightingale:stable
  2. Run the Container

    Start the container interactively:

    docker run -ti --hostname nightingale ghcr.io/rajanagori/nightingale:stable /bin/bash

    This command gives you terminal access to the container. The --hostname flag sets the container’s hostname to nightingale.

  3. Access the Container via Browser

    To access the terminal in a browser, run:

    docker run -it -p 8080:7681 -d ghcr.io/rajanagori/nightingale:stable ttyd -p 7681 bash

    Open http://localhost:8080 in your browser.

    After logging in, activate Python and Go modules:

    activate python
    activate go
  4. Run MobSF

    To use MobSF alongside Nightingale:

    docker run -it -p 8080:7681 -p 8081:8081 -d ghcr.io/rajanagori/nightingale:stable ttyd -p 7681 bash
    cd /home/tools_mobile_vapt/Mobile-Security-Framework-MobSF/
    source venv/bin/activate
    ./run 0.0.0.0:8081 &

    Ports 8080 and 8081 on the host map to 7681 and 8081 in the container.

  5. Bind Host Directories to the Container

    Use the following command to mount a host directory into the container:

    docker run -it -p 8080:7681 -p 8081:8081 -v /<your_host_directory>:/<your_container_directory> -d ghcr.io/rajanagori/nightingale:stable ttyd -p 7681 bash

For ARM64 Architecture (Including Mac)

Follow the same steps as above, replacing the stable tag with arm64.


Nightingale Standalone Binaries

If you prefer not to run Nightingale by creating Docker image in the local, you can download our pre-compiled Go binaries optimized for your platform and setup the Nightingale locally using our build images directly.

Understanding Your Built Binaries

We ship one binary per OS/architecture:

  • nightingale-go-linux-amd64 → Linux on Intel/AMD (x86_64)
  • nightingale-go-linux-arm64 → Linux on ARM (Raspberry Pi)
  • nightingale-go-mac-amd64 → macOS on Intel Macs
  • nightingale-go-mac-arm64 → macOS on Apple Silicon (M1/M2/M3)
  • nightingale-go-win-amd64.exe→ Windows on Intel/AMD (x86_64)

Downloading & Installing

  1. Make it executable & move into your PATH:
    mv nightingale-go-{OS}-{ARCH} nightingale
    chmod +x nightingale
    sudo mv nightingale /usr/local/bin/nightingale

Generating a Self-Signed TLS Certificate

To secure Nightingale’s web UI on localhost, generate a self-signed cert:

Make sure the target directory exists

mkdir -p nginx/certs

Generate a 1-year self-signed cert into that folder

openssl req -x509 -nodes -newkey rsa:4096 \
  -days 365 \
  -keyout nginx/certs/selfsigned.key \
  -out  nginx/certs/selfsigned.crt \
  -subj "/C=US/ST=State/L=City/O=MyOrg/OU=Dev/CN=localhost"
openssl req -x509 -nodes -newkey rsa:4096   -days 365   -keyout selfsigned.key   -out selfsigned.crt   -subj "/C=US/ST=State/L=City/O=MyOrg/OU=Dev/CN=localhost"
  • Private key: selfsigned.key
  • Certificate: selfsigned.crt
  • Customize the -subj fields (C, ST, L, O, OU, CN) to match your org or domain.

Configure .env based on your setup

see the .env file in the docker compose folder
- .env.arm64.example // for arm64
- .env.amd64.example // for amd64

Run Nightingale with the certs

For AMD Architecture

docker-compose --env-file .env.amd64 -f docker-compose.yml up -d 

For ARM Architecture

docker-compose --env-file .env.arm64 -f docker-compose.yml up -d 

This command starts Nightingale with the generated TLS certificate. You can access it via http://nightingale.


Optional Tool Activation

Once you have accessed the terminal via localhost:8080, you can use the activate command to enable additional tools.

Check Available Options

To view the available options, type the following command:

activate --help
Usage: /usr/local/bin/activate [option]
Options:
  zsh        Activate Zsh
  metasploit Activate Metasploit
  python     Activate Python modules
  go         Activate Go modules
  --help     Display this help message
  --list     List available tools

Activating Tools

  • To activate Zsh:

Run the following command:

activate zsh

This will install and activate Zsh for your container.

  • To activate Metasploit:

Run the following command:

activate metasploit

Environment Variables and Their Meanings

Understanding environment variables is crucial for configuring and running Nightingale effectively. Below is a list of common environment variables and their purposes:

  • TZ: Sets the timezone for the container.
  • DOCKER_REGISTRY: Specifies the Docker registry to pull images from.
  • USERNAME: Sets the username for the Github Account.
  • TOKEN: Sets the token for the Github Account.
  • COMMIT_HASH: Sets the commit hash for the Github Account.
  • TOOLS_WEB_VAPT: Sets the directory for web vulnerability assessment tools.
  • BINARIES: Sets the directory for binaries.
  • GREP_PATTERNS: Sets the directory for Grep patterns.
  • TOOLS_OSINT: Sets the directory for OSINT tools.
  • TOOLS_MOBILE_VAPT: Sets the directory for mobile vulnerability assessment tools.
  • TOOLS_NETWORK_VAPT: Sets the directory for network vulnerability assessment tools.
  • TOOLS_RED_TEAMING: Sets the directory for red teaming tools.
  • TOOLS_FORENSICS: Sets the directory for forensics tools.
  • WORDLIST: Sets the directory for wordlists.
  • METASPLOIT_CONFIG: Sets the directory for Metasploit configuration.
  • METASPLOIT_TOOL: Sets the directory for Metasploit tools.
  • SHELLS: Sets the directory for shells.

Make sure to set these variables appropriately to ensure optimal performance and functionality of Nightingale.


Additional Tips and Tricks

  1. List Running Containers

    docker ps
  2. Stop a Running Container

    docker stop <container_id>
  3. Remove a Container

    docker rm <container_id>
  4. View Logs

    docker logs <container_id>
  5. Access a Running Container’s Shell

    docker exec -it <container_id> /bin/bash
  6. Stop and Remove All Containers

    docker stop $(docker ps -q)docker rm $(docker ps -a -q)
  7. Persistent Data Using Volumes

    docker run -ti -v <host_dir>:<container_dir> ghcr.io/rajanagori/nightingale:stable /bin/bash
  8. Run Containers in Detached Mode

    docker run -d -p <host_port>:<container_port> ghcr.io/rajanagori/nightingale:stable /bin/bash
  9. Set Environment Variables

    docker run -e <ENV_VAR>=<value> -p <host_port>:<container_port> ghcr.io/rajanagori/nightingale:stable /bin/bash
  10. Access Host Network

    docker run --network host -p <host_port>:<container_port> ghcr.io/rajanagori/nightingale:stable /bin/bash
  11. Auto-Remove Containers

    docker run --rm -p <host_port>:<container_port> ghcr.io/rajanagori/nightingale:stable /bin/bash
  12. Assign a Name to Containers

    docker run --name <container_name> -p <host_port>:<container_port> ghcr.io/rajanagori/nightingale:stable /bin/bash
    

This guide should make it easier to install, configure, and get started with Nightingale. Feel free to contribute or raise issues on the GitHub repository.

Happy testing!