Sign inSign up

h4shelldocker/pentester

By h4shelldocker

Updated 3 months ago

Image
Networking
Security
Web servers
1

3.9K

h4shelldocker/pentester repository overview

Pentester Docker Container

Overview

The Pentester Docker container is a comprehensive penetration testing environment built on Kali Linux Rolling. It provides a complete toolkit for security professionals, ethical hackers, and cybersecurity students. The container includes both command-line tools and a full desktop environment accessible via VNC.

Features

Core Security Tools
  • Network Scanning: nmap, nuclei, hping3
  • Web Application Testing: burpsuite, nikto, wpscan, whatweb
  • Password Attacks: hydra, hashcat, cupp
  • Exploitation Framework: metasploit-framework
  • Stress Testing: siege
  • Proxy Tools: tor, proxychains4
Development Environment
  • Code Editor: VSCodium (Visual Studio Code OSS)
  • Languages: Python 3 with pip and venv support
  • Version Control: git
  • Utilities: wget, curl, netcat, tmux, nano
Desktop Environment
  • Window Manager: XFCE4 with full desktop experience
  • VNC Access: KasmVNC server for remote desktop access
  • Browser: Firefox ESR
  • Themes: Kali Linux themes and customizations
Network & Connectivity
  • VPN Support: OpenVPN client
  • Tunneling: Cloudflared tunnel support
  • SSH Server: Pre-configured SSH access
  • Network Tools: iptables, iproute2, net-tools

Quick Start

Basic Container Launch
# Pull the container
docker pull docker.io/h4shelldocker/pentester:latest

# Run with basic configuration
docker run -d --name pentester-lab \
  -p 8444:8444 \
  -p 2222:22 \
  docker.io/h4shelldocker/pentester:latest
VNC Desktop Access
# Run with VNC access
docker run -d --name pentester-desktop \
  -p 8444:8444 \
  -p 2222:22 \
  --privileged \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_ADMIN \
  docker.io/h4shelldocker/pentester:latest

Access the desktop via web browser at: https://localhost:8444

SSH Access
# Connect via SSH
ssh root@localhost -p 2222
# Password: password
Advanced Configuration
# Run with custom volumes and network access
docker run -d --name pentester-advanced \
  -p 8444:8444 \
  -p 2222:22 \
  -v /host/projects:/root/projects \
  -v /host/wordlists:/root/wordlists \
  --privileged \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_ADMIN \
  --network=host \
  docker.io/h4shelldocker/pentester:latest

Port Configuration

PortServiceDescription
8444KasmVNCWeb-based VNC desktop access
22SSHSecure Shell access

Default Credentials

  • Root User: root
  • Password: password
  • SSH: Enabled with root login

Usage Examples

Network Reconnaissance
# Enter the container
docker exec -it pentester-lab bash

# Network discovery
nmap -sn 192.168.1.0/24

# Port scanning
nmap -sV -sC target.com

# Web application enumeration
whatweb target.com
nikto -h target.com
Web Application Testing
# Start Burp Suite (in desktop environment)
# Access via VNC at https://localhost:8444

# WordPress scanning
wpscan --url http://target.com --enumerate u,p,t

# Directory brute forcing
nuclei -u http://target.com -t /root/nuclei-templates/
Password Attacks
# Generate custom wordlists
cupp -i

# Hydra brute force
hydra -l admin -P passwords.txt ssh://target.com

# Hashcat password cracking
hashcat -m 0 hashes.txt wordlist.txt
Proxy and Anonymity
# Start Tor service
service tor start

# Use proxychains
proxychains4 nmap target.com

# Check external IP
myip  # Custom alias for curl api.ipify.org

Volume Mounting

# Mount common directories
docker run -d --name pentester-volumes \
  -p 8444:8444 \
  -p 2222:22 \
  -v $(pwd)/projects:/root/projects \
  -v $(pwd)/wordlists:/root/wordlists \
  -v $(pwd)/results:/root/results \
  -v $(pwd)/scripts:/root/scripts \
  --privileged \
  docker.io/h4shelldocker/pentester:latest
Persistent Configuration
# Preserve SSH keys and configurations
docker run -d --name pentester-persistent \
  -p 8444:8444 \
  -p 2222:22 \
  -v pentester-ssh:/root/.ssh \
  -v pentester-config:/root/.config \
  -v pentester-vnc:/root/.vnc \
  --privileged \
  docker.io/h4shelldocker/pentester:latest

Environment Variables

The container supports several environment variables for customization:

# Example with environment variables
docker run -d --name pentester-custom \
  -p 8444:8444 \
  -p 2222:22 \
  -e VNC_RESOLUTION=1920x1080 \
  -e VNC_PASSWORD=newpassword \
  --privileged \
  docker.io/h4shelldocker/pentester:latest

Docker Compose

Basic Compose File
version: '3.8'
services:
  pentester:
    image: pentester:latest
    container_name: pentester-lab
    ports:
      - "8444:8444"
      - "2222:22"
    volumes:
      - ./projects:/root/projects
      - ./wordlists:/root/wordlists
      - ./results:/root/results
    privileged: true
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
    restart: unless-stopped
Advanced Compose with Multiple Services
version: '3.8'
services:
  pentester:
    image: docker.io/h4shelldocker/pentester:latest
    container_name: pentester-main
    ports:
      - "8444:8444"
      - "2222:22"
    volumes:
      - pentester-projects:/root/projects
      - pentester-wordlists:/root/wordlists
      - pentester-results:/root/results
      - pentester-config:/root/.config
    privileged: true
    cap_add:
      - NET_ADMIN
      - SYS_ADMIN
    networks:
      - pentest-network
    restart: unless-stopped

  target-app:
    image: dvwa/dvwa
    container_name: test-target
    ports:
      - "8080:80"
    networks:
      - pentest-network

networks:
  pentest-network:
    driver: bridge

volumes:
  pentester-projects:
  pentester-wordlists:
  pentester-results:
  pentester-config:

Security Considerations

Container Privileges

This container requires elevated privileges for networking tools:

# Minimal required privileges
docker run -d --name pentester-minimal \
  --cap-add=NET_ADMIN \
  --cap-add=NET_RAW \
  --cap-add=SYS_ADMIN \
  docker.io/h4shelldocker/pentester:latest
Network Isolation
# Isolated network testing
docker network create pentest-isolated
docker run -d --name pentester-isolated \
  --network pentest-isolated \
  -p 8444:8444 \
  docker.io/h4shelldocker/pentester:latest

Troubleshooting

Common Issues
  1. VNC Connection Issues

    # Check VNC service status
    docker exec pentester-lab ps aux | grep vnc
    
    # Restart VNC service
    docker exec pentester-lab /entrypoint.sh
    
  2. SSH Connection Refused

    # Check SSH service
    docker exec pentester-lab service ssh status
    
    # Start SSH service
    docker exec pentester-lab service ssh start
    
  3. Permission Issues

    # Fix volume permissions
    docker exec pentester-lab chown -R root:root /root/projects
    
Logs and Debugging
# Container logs
docker logs pentester-lab

# Interactive debugging
docker exec -it pentester-lab bash

# Service status check
docker exec pentester-lab systemctl status ssh

Performance Optimization

Resource Limits
# Run with resource limits
docker run -d --name pentester-limited \
  -p 8444:8444 \
  -p 2222:22 \
  --memory=4g \
  --cpus=2 \
  --privileged \
  docker.io/h4shelldocker/pentester:latest
Storage Optimization
# Use tmpfs for temporary files
docker run -d --name pentester-optimized \
  -p 8444:8444 \
  -p 2222:22 \
  --tmpfs /tmp:rw,size=1g \
  --tmpfs /var/tmp:rw,size=1g \
  --privileged \
  docker.io/h4shelldocker/pentester:latest

Best Practices

  1. Regular Updates: Keep the container image updated
  2. Secure Credentials: Change default passwords
  3. Network Segmentation: Use isolated networks for testing
  4. Data Persistence: Use volumes for important data
  5. Resource Monitoring: Monitor container resource usage
  6. Legal Compliance: Only use for authorized testing

Contributing

To extend or modify the container:

# Build custom image
docker build -t pentester-custom .

# Tag and push
docker tag pentester-custom your-registry/pentester-custom
docker push your-registry/pentester-custom

This container is intended for educational purposes and authorized penetration testing only. Users are responsible for complying with all applicable laws and regulations. Unauthorized use against systems you do not own or have explicit permission to test is illegal and unethical.

EXPORT container

docker tag docker-pentester-pentester h4shelldocker/pentester:$(date +%d%m%Y)
docker push h4shelldocker/pentester:$(date +%d%m%Y)

GITEA PROJECT

https://gitea.h4sh.it/h4shell/docker-Pentester

Tag summary

Content type

Image

Digest

sha256:6a323bea3

Size

2.5 GB

Last updated

3 months ago

docker pull h4shelldocker/pentester