Skip to content

Commit

Permalink
changed nvidia-driver-capabilities and added action
Browse files Browse the repository at this point in the history
  • Loading branch information
cwilliams001 committed Dec 12, 2024
1 parent ee0423d commit 120b9af
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 38 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Push Docker Image

on:
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
push:
branches: [ main ]
workflow_dispatch: # Allow manual triggers

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
williamsct1/kasm-hashcat:latest
williamsct1/kasm-hashcat:${{ github.sha }}
- name: Update README
run: |
echo "# Kasm Hashcat Container" > README.md
echo "Last updated: $(date)" >> README.md
echo "Docker Hub: [williamsct1/kasm-hashcat](https://hub.docker.com/r/williamsct1/kasm-hashcat)" >> README.md
cat README_TEMPLATE.md >> README.md
- name: Commit README
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update README" || echo "No changes to commit"
git push || echo "No changes to push"
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ USER root
ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,display
ENV NVIDIA_DRIVER_CAPABILITIES=all
WORKDIR $HOME

######### Customize Container Here ###########
Expand Down Expand Up @@ -37,7 +37,9 @@ RUN wget https://gitlab.com/kalilinux/packages/wordlists/-/raw/kali/master/rocky
RUN mkdir -p /usr/local/wordlists && \
mv /home/kasm-user/Desktop/rockyou.txt /usr/local/wordlists/rockyou.txt


# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
######### End Customizations ###########

RUN chown 1000:0 $HOME
Expand Down
57 changes: 21 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,32 @@
# Hashcat Kasm Workspace
# Hashcat Kasm Container

This project aims to create a [Kasm Workspaces](https://kasmweb.com/) docker container that is capable of running [Hashcat](https://hashcat.net/hashcat/) with support for GPU-accelerated computation. The container is built on an Ubuntu (Jammy) base image with Hashcat and the NVIDIA CUDA toolkit installed.
A custom KASM workspace container with Hashcat, CUDA support, and the Adj-Noun Wordlist Generator pre-installed.

## Prerequisites
## Features

1. Docker installed on your machine.
2. An NVIDIA GPU with the appropriate drivers installed.
- Hashcat with NVIDIA CUDA support
- Pre-installed Adj-Noun Wordlist Generator
- Included rockyou.txt wordlist at `/usr/local/wordlists/rockyou.txt`
- Custom background image

## Building the Image
## Using the Adj-Noun Generator

To build the Docker image, follow these steps:
The Adj-Noun Generator is pre-installed and available as `adj` command. It generates wordlists combining adjectives and nouns with optional digits.

1. Clone this repository to your machine.
2. Navigate to the directory containing the Dockerfile.
3. Run the following command:
### Basic Usage

```bash
docker build -t hashcat-kasm-workspace .
```
# Basic usage (outputs adjective+noun+1digit and adjective+noun+3digits)
adj

This command builds the Docker image and tags it as `hashcat-kasm-workspace`.
# Pipe to hashcat
adj | hashcat -m 22000 hash.hc22000

## Running the Container
# Different digit combinations
adj -0 # No digits
adj -1 # 1 digit
adj -2 # 2 digits
adj -3 # 3 digits

To run the Docker container, use the following command:

```bash
docker run -it --rm \
--gpus all \
-e NVIDIA_DRIVER_CAPABILITIES=compute,utility,display \
hashcat-kasm-workspace
```

This command runs the Docker container with access to all GPUs and sets the appropriate NVIDIA driver capabilities.

## Notes

- This container operates under the assumption that the host's GPU drivers and CUDA toolkit are properly installed and configured.
- The Dockerfile updates the system, installs Hashcat and the NVIDIA CUDA toolkit, and configures OpenCL to use the NVIDIA driver.
- A custom background is added to the workspace. You can replace the URL with the path of your desired background image.

## Limitations

This project is intended for personal, educational, or research purposes only. Use of hashcat and similar tools should be limited to environments and scenarios where you have obtained the necessary permissions and approvals. Misuse can be in violation of laws and regulations.

Always ensure to follow ethical guidelines when using such tools, and do not use them for unauthorized access, data theft, or similar unethical activities.
# Use expanded wordlist
adj -full

0 comments on commit 120b9af

Please sign in to comment.