Docker Usage Guide for subenum

This guide explains how to use subenum with Docker for a containerized subdomain enumeration setup.

Prerequisites

Building the Docker Image

Using docker build

# Clone the repository (if you haven't already)
git clone https://github.com/TMHSDigital/subenum.git
cd subenum

# Build the Docker image
docker build -t subenum .

Using make

If you have Make installed, you can use the provided Makefile:

make docker-build

Running subenum with Docker

Basic Usage

# Run subenum with a wordlist in the data directory
docker run --rm -v $(pwd)/data:/data subenum -w /data/wordlist.txt example.com

Using Docker Compose

The project includes a docker-compose.yml file for easier management:

# Start container with the default configuration
docker-compose up

# Run with custom parameters
docker-compose run --rm subenum -w /data/custom-wordlist.txt -v -t 200 yourdomain.com

Volume Mounting

The Docker container is configured with a volume mount point at /data. This allows you to:

  1. Use your own wordlists
  2. Save output from the container to your host system

Example of mounting a custom directory:

docker run --rm -v /path/to/your/files:/data subenum -w /data/your-wordlist.txt -v target.com

Docker Environment Structure

Saving Results to a File

Use -o to write discovered subdomains to a file on the host via the /data volume:

docker run --rm -v $(pwd)/data:/data subenum \
  -w /data/wordlist.txt \
  -o /data/results.txt \
  example.com

Using Multiple Attempts for Unreliable Networks

The -attempts flag sets the total DNS resolution attempts per subdomain:

docker run --rm -v $(pwd)/data:/data subenum \
  -w /data/wordlist.txt \
  -attempts 3 \
  -timeout 2000 \
  example.com

Safe Simulation Mode

Test the tool without making any real DNS queries:

docker run --rm subenum \
  -simulate \
  -hit-rate 20 \
  -w /root/examples/sample_wordlist.txt \
  example.com

Or via Make:

make docker-simulate

Troubleshooting

DNS Resolution Issues

If you’re experiencing DNS resolution problems in the container:

# Try using a different DNS server
docker run --rm -v $(pwd)/data:/data subenum -w /data/wordlist.txt -dns-server 1.1.1.1:53 example.com

File Permission Problems

If you encounter permission issues with mounted volumes:

# Run the container with your user ID
docker run --rm -v $(pwd)/data:/data --user $(id -u):$(id -g) subenum -w /data/wordlist.txt example.com

Security Notes

Remember that subenum is provided for educational and legitimate security testing purposes only. All the ethical guidelines and legal restrictions from the main project apply equally when using the Docker version.

Always ensure you have explicit permission to scan any domain.

Home Architecture Developer Guide Docker Contributing