Skip to content

Commit

Permalink
Minor docs fixes (#45)
Browse files Browse the repository at this point in the history
* makefile symlink to build client added; readme fix and main readme fix

* misspellings

* - fix pixel bug when running on WSL
- docs typos
- add update-submodules.yaml
- renaming old update-submodules.yaml to update-pull-requests.yaml
- lfs in docs
- adding daemon image

* update README.md

* Process Markdown copy, replace links, alerts, and generate PDF

* fix action

* Process Markdown copy, replace links, alerts, and generate PDF

* update actions

* update actions

* Process Markdown copy, replace links, alerts, and generate PDF

* update action

* Process Markdown copy, replace links, alerts, and generate PDF

---------

Co-authored-by: virgula0 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Virgula0 <[email protected]>
  • Loading branch information
4 people authored Jan 28, 2025
1 parent c7264b4 commit 64edb61
Show file tree
Hide file tree
Showing 14 changed files with 104 additions and 41 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
cd externals/gocat
sudo make install
sudo make set-user-permissions USER=${USER}
git reset --hard # needed for update-submodules.yaml
- name: Run golangci-lint:client
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
name: 'Submodules Sync'
name: 'Sync Branches'

on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize

jobs:
sync:
if: github.event.pull_request.draft != true

name: 'Submodules Sync'
name: 'Sync Branches'
runs-on: ubuntu-22.04

defaults:
Expand All @@ -28,11 +20,6 @@ jobs:
with:
submodules: recursive

# Update references
- name: Git Submodule Update
run: |
git submodule update --init --remote --recursive
- uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
43 changes: 43 additions & 0 deletions .github/workflows/update-submodules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Update submodules Branches'

on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight (UTC)
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize

jobs:
sync:
if: github.event.pull_request.draft != true

name: 'Sync Branches'
runs-on: ubuntu-22.04

defaults:
run:
shell: bash

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

# Update references
- name: Git Submodule Update
run: |
cd externals/gocat
git pull
cd ../../
cd externals/hcxtools
git pull
- name: Commit and Push Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update submodules"
file_pattern: externals/gocat/* externals/hcxtools/*
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@ Student: <font color='orange'>Angelo Rosa</font>
<img src="docs/images/Screenshots/2.png" width="400">
<img src="docs/images/Screenshots/3.png" width="400">
<img src="docs/images/Screenshots/4.png" width="400">
<img src="docs/images/Screenshots/5.png" width="400">

</p>

## Brief

> **H.D.S (Hashcat-Distributed-Service)** is a university project entirely written in **Go** that can find practical applications for collecting and then distributing hashes and handshakes cracking tasks on multiple hashcat clients through a control panel centre. Include a Deamon for collecting and verifying WPA handshakes from IOT devices.
> **H.D.S (Hashcat-Distributed-Service)** is a university project entirely written in **Go** that can find practical applications for collecting and then distributing hashes and handshakes cracking tasks on multiple hashcat clients through a control panel centre. Include a Daemon for collecting and verifying WPA handshakes from IOT devices.
You can have multiple clients for multiple tasks and each one operates independently on different machines.

For more information about the project capabilities, please read the [feature section](#project-features)
You can find releases compiled at: [https://github.com/Virgula0/H.D.S/releases](https://github.com/Virgula0/H.D.S/releases)

But remember to read the following compiling procedures anyway

- [Compile Deamon](raspberry-pi/README.md#compile-and-run-the-daemon)
- [Compile Daemon](raspberry-pi/README.md#compile-and-run-the-daemon)
- [Compile Server](server/README.md#compile-and-run)
- [Compile Client](client/README.md#compile-and-run)

Expand Down Expand Up @@ -70,6 +71,9 @@ sudo pacman -S xorg-xhost
git submodule init && \
git submodule update && \
git pull --recurse-submodules && \
# download wordlists
git lfs install && \
git lfs pull && \
# change display values as you need
export DISPLAY=:0.0 && \
xhost +local:docker && \
Expand Down Expand Up @@ -195,13 +199,14 @@ While security auditing and privacy were not primary objectives for this project
- A symmetric encryption key has been generated, but encryption is yet to be implemented.

2. **Daemon Authentication:**
- Daemon authenticates via **REST API** before establishing a **TCP** connection.
- ~~Daemon authenticates via **REST API** before establishing a **TCP** connection.~~ Fixed with https://github.com/Virgula0/H.D.S/pull/42
- ~~Credentials are sent via command-line arguments, which could be stolen easily if a malicious actor have access remotely to the machine.~~ Fixed with https://github.com/Virgula0/H.D.S/pull/39

3. **gRPC Security:**
- gRPC communication currently lacks **SSL/TLS certificates** for encryption.

### Security Measures Implemented:

- Basic protection against vulnerabilities like **SQL Injection** and **IDORs** has been considered.

> If you have suggestions or improvements, feel free to **open a pull request**.
Expand Down Expand Up @@ -480,4 +485,5 @@ Ignoring gRPC and other basic deps
- **Gopacket** `github.com/google/gopacket` Parse `.PCAP` files as layers
- **Wifi** `github.com/mdlayher/wifi` used by daemon for understanding if we're connected to our local network
- **Cobra** `github.com/spf13/cobra` used for parsing command line arguments easily in daemon
- **bubbletea** `github.com/charmbracelet/bubbletea` tui for login implemented in daemon
- Other dependencies could be implicitly downloaded and used because of these deps
9 changes: 4 additions & 5 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ RUN apt update -y && \
opencl-headers \
pocl-opencl-icd \
build-essential \
wget \
git \
ca-certificates \
libz-dev \
libssl-dev \
Expand All @@ -28,10 +26,10 @@ COPY externals/hcxtools /app/externals/hcxtools

# this trick needs to be improved, but needed for git commands in
# gocat Makefile. this copies a ton of GB inside the container
COPY .git /app/.git
COPY .git /app/.git

# create user
RUN useradd -ms /bin/bash client
RUN useradd -ms /bin/bash client

WORKDIR /app/externals/gocat
# Install hashcat 6.1.1
Expand All @@ -44,12 +42,13 @@ RUN make install && \
COPY client /app/client
COPY proto-definitions /app/proto-definitions
COPY proto.sh /app/proto.sh

WORKDIR /app/client

RUN chown -R client:client /app && \
# give permissions to run go on client
chown -R client:client /go

USER client

# install proto
Expand Down
13 changes: 13 additions & 0 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ links-build:
fi; \
if [ ! -e "build/hashcat.hctune" ]; then \
ln -s /usr/local/share/hashcat/hashcat.hctune build/hashcat.hctune; \
echo "Created symbolic link for hashcat.hctune"; \
fi; \
if [ ! -e "build/modules" ]; then \
ln -s /usr/local/share/hashcat/modules build/modules; \
echo "Created symbolic link for modules"; \
fi; \
if [ ! -e "build/hashcat.hcstat2" ]; then \
ln -s /usr/local/share/hashcat/hashcat.hcstat2 build/hashcat.hcstat2; \
echo "Created symbolic link for hashcat.hcstat2"; \
fi; \
}
.PHONY: links-build
Expand All @@ -34,9 +40,15 @@ links:
fi; \
if [ ! -e "hashcat.hctune" ]; then \
ln -s /usr/local/share/hashcat/hashcat.hctune hashcat.hctune; \
echo "Created symbolic link for hashcat.hctune"; \
fi; \
if [ ! -e "modules" ]; then \
ln -s /usr/local/share/hashcat/modules modules; \
echo "Created symbolic link for modules"; \
fi; \
if [ ! -e "hashcat.hcstat2" ]; then \
ln -s /usr/local/share/hashcat/hashcat.hcstat2 hashcat.hcstat2; \
echo "Created symbolic link for hashcat.hcstat2"; \
fi; \
}
.PHONY: links
Expand All @@ -46,6 +58,7 @@ clean:
rm -rf modules
rm -rf kernels
rm -f *.hctune
rm -f hashcat.hcstat2
rm -f *.dictstat*
rm -f main
.PHONY: clean
Expand Down
35 changes: 22 additions & 13 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,20 @@ While this solution works for our current requirements, future improvements coul
> The following dependencies needs to be installed before proceeding, even if you're using compiled binaries from releases
```bash
apt update -y && \
apt install -y --no-install-recommends \
protobuf-compiler
sudo apt update -y && \
sudo apt install -y --no-install-recommends \
protobuf-compiler \
libminizip-dev \
ocl-icd-libopencl1 \
opencl-headers \
git \
git-lfs \
pocl-opencl-icd \
build-essential \
wget \
git \
dumb-init \
ca-certificates \
libz-dev \
libssl-dev \
dbus \
# Graphic libraries for raylib
libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libwayland-dev libxkbcommon-dev
```

Expand All @@ -118,9 +116,9 @@ apt update -y && \
Follow these steps to compile and run the client, run it from project root dir

```bash
git submodule init
git submodule update --init --remote --recursive
git pull --recurse-submodule
git submodule update --init --remote --recursive && \
git lfs install && \
git lfs pull
```

1. **You need to install `hashcat` 6.1.1. This step is necesary only for the first time.**
Expand All @@ -132,24 +130,35 @@ sudo make set-user-permissions USER=${USER}
cd ../../
```

2. **Build with**
2. **Install protobuf**

> [!NOTE]
> This was tested out using go `1.23.4`. Other version may have problems.
```bash
go install google.golang.org/protobuf/cmd/[email protected] &&
go install google.golang.org/grpc/cmd/[email protected]
```

3. **Build client**

```bash
cd client
make build
```

Produces the following files tree
Produces the following files tree in `build`

```
├── client
├── hashcat.hctune -> /usr/local/share/hashcat/hashcat.hctune
├── hashcat.hcstat2 -> /usr/local/share/hashcat/hashcat.hcstat2
├── libhcxpcapngtool.so
├── modules -> /usr/local/share/hashcat/modules
└── OpenCL -> /usr/local/share/hashcat/OpenCL
```

3. **Run with**
4. **Run with**

```bash
make run-compiled
Expand Down
2 changes: 1 addition & 1 deletion client/internal/gui/process_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
windowWidth = 850
windowWidth = 851
windowHeight = 550
defaultLogHeight = 300

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ services:
- DB_PORT=3306
- DB_NAME=dp_hashcat
- ALLOW_REGISTRATIONS=True # Disable if needed
- DEBUG=False # This will enable seeds for having handshake, clients, and raspberryPI mocked
- DEBUG=True # This will enable seeds for having handshake, clients, and raspberryPI mocked
- RESET=True
- GRPC_URL=0.0.0.0:7777
- GRPC_TIMEOUT=10s
Expand Down
Binary file modified docs/docs.pdf
Binary file not shown.
Binary file added docs/images/Screenshots/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion externals/hcxtools
Submodule hcxtools updated 1 files
+4 −0 README.md
5 changes: 5 additions & 0 deletions raspberry-pi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ Make sure the following requirements are met before building and running the dae
> [!IMPORTANT]
> The daemon requires `libpcap0.8-dev` to be installed on your system, even if you're using compiled binaries from releases.
```bash
sudo apt update -y && \
sudo apt install -y libpcap0.8-dev
```

> [!IMPORTANT]
> The file `/etc/machine-id` must exist on your machine.
Expand Down
4 changes: 2 additions & 2 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ The **frontend** performs the following tasks:
### **1. Start Database**

```bash
cd database
docker build -t dp-database .
cd database && \
docker build -t dp-database . && \
docker run -d \
--name dp-database \
-e MYSQL_RANDOM_ROOT_PASSWORD=yes \
Expand Down

0 comments on commit 64edb61

Please sign in to comment.