Git Product home page Git Product logo

docker-hashtopolis-server's Introduction

Hastopolis Server Docker image

Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers. The main goals for Hashtopolis's development are portability, robustness, multi-user support, and multiple groups management. This repository is a dockerized version of Hashtopolis using MariaDB.

RUNNING IT

Preparation

Clone this repository to your machine:

git clone https://github.com/kpeiruza/docker-hashtopolis-server.git
cd docker-hashtopolis-server/

Then, edit the docker-compose.yaml to fit your needs (using nano, vi, vim, or emacs if your'e feeling adventurous)

Build the image (optional)

Build the Hashtopolis image from scratch:

docker build -t htp:latest

Run it!

Bring the whole thing up:

docker compose up -d

or on older systems:

docker-compose up -d

This is the preferred method of running this, and includes volume persistence.

NOTE: the first time you run this, MariaDB will initialize its database. This can take a while. You can monitor progress using docker logs <IMAGE ID> -f. The Hashtopolis container should return Setup finished, pruning /install folder! when it is done.

Run it the hard(er) way!

Run using individual docker commands:

docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=changemeRoot mariadb:10.11
docker run -d \
  -e MYSQL_ROOT_PASSWORD=changemeRoot \
  -e MYSQL_DB=hashtopolis \
  -e MYSQL_HOST=mysql \
  -e MYSQL_PORT=3306 \
  -e H8_USER=root \
  -e H8_PASS=changemeHTPuser \
  -e H8_EMAIL="root@localhost" \
  --link mysql:mysql -p 80:80 \
  kpeiruza/hashtopolis

NOTE: --link has been deprecated, and may be removed from docker in the future. Additionally, these commands do not deal with persistence. If you need this, you'll have to add it where necessary using the -v switch.

ENVIRONMENT VARIABLES

MYSQL_HOST

This is a host where your database is hosted. Defaults to mysql.

MYSQL_PORT

The port where mysql listens on. Defaults 3306 (<-- not working, fixed to 3306)

MYSQL_DB

The name of your database. Defaults to hashtopolis.

MYSQL_ROOT_PASSWORD

This specifies the password that will be set for the MariaDB root superuser account. This should be the same value for your hashtopolis container.

MYSQL_USER

You can set your own username to be used for database access if not using the root user. You don't need it if you are using the root password.

MYSQL_PASSWORD

Password for MYSQL_USER. Cannot be unset if MYSQL_USER is defined.

H8_USER

Username for the Hastopolis administrator account to be created on first run. Defaults to a 256 char random string.

H8_PASS

Password for the Hashtopolis administrator account. Defaults to a 256 char random string.

H8_EMAIL

Email for the Hashtopolis administrator account.

PHP_MAIL_HOST

SMTP server, defaults to php.ini

PHP_MAIL_PORT

SMTP port, defaults to php.ini

PHP_MAIL_FROM

Sender for email, defaults to php.ini

HTP_MEMORY_LIMIT

Allows setting the memory limit on the server (default 128M).

HTP_UPLOAD_MAX_SIZE

Sets the maximum allows upload file size (default 2M).

HTP_SERVER_NAME

Sets a server (sub)domain name (default none).

PERSISTENCE

Remember to map MariaDB's /var/lib/mysql for usage in production. Hashtopolis upload folders should be mapped as well.

  • mysql:/var/lib/mysql
  • import:/var/www/html/import
  • files:/var/www/html/files
  • inc:/var/www/html/inc
  • locks:/var/www/html/inc/utils/locks

Please provide feedback about any trouble encountered as well as your success in deployment. Any feedback with regards to improvements is also highly appreciated.

Enjoy!

docker-hashtopolis-server's People

Contributors

gitoffomalawn avatar kpeiruza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-hashtopolis-server's Issues

PHP Errors any time php?id=xx is used. Browser shows error 500

System:

Ubuntu 20.04.1 LTS
docker-compose version 1.25.0, build unknown
Docker version 19.03.8, build afacb8b7f0
added an nginx proxy config to wrap it in ssl for remote agents - behavior is the same using this or not, both ports are exposed locally.

Either a system update broke this, or the updated image, and I just didnt notice.

docker-compose.yaml
version: '3.7'
services:
mysql:
image: mysql:5.7
volumes:
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: anotherpw
restart: unless-stopped
hashtopolis:
image: kpeiruza/hashtopolis:latest
environment:
H8_USER: root
H8_PASS: somepw
H8_EMAIL: root@localhost
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_ROOT_PASSWORD: anotherpw
MYSQL_DB: hashtopolis
volumes:
- import:/var/www/html/import
- files:/var/www/html/files
- inc:/var/www/html/inc
- locks:/var/www/html/inc/utils/locks
ports:
- "8008:80"
restart: unless-stopped
nginx:
image: nginx:stable
container_name: production_nginx
volumes:
- './nginx/default.conf:/etc/nginx/conf.d/default.conf'
- './nginx/certs/ca.crt:/etc/nginx/certs/ca.crt'
- './nginx/certs/server.crt:/etc/nginx/certs/server.crt'
- './nginx/certs/server.key:/etc/nginx/certs/server.key'
ports:
- 8334:8334
restart: unless-stopped
volumes:
import: {}
files: {}
inc: {}
locks: {}
mysql: {}

When clicking an actual agent in agent lists:
PHP Fatal error: Uncaught Error: Undefined class constant 'CPU_UTIL' in /var/www/html/agents.php:91\nStack trace:\n#0 {main}\n thrown in /var/www/html/agents.php on line 91, referer: http://127.0.0.1:8008/agents.php

When clicking a task that is part of a hashlist
PHP Fatal error: Uncaught Error: Undefined class constant 'SET_STATUS_TIMER' in /var/www/html/inc/templating/Statement.class.php(190) : eval()'d code:1\nStack trace:\n#0 /var/www/html/inc/templating/Statement.class.php(190): eval()\n#1 /var/www/html/inc/templating/Statement.class.php(139): Statement->evalResult('$DTaskAction::S...', Array, false)\n#2 /var/www/html/inc/templating/Statement.class.php(92): Statement->renderVariable('[[$DTaskAction:...', Array, false)\n#3 /var/www/html/inc/templating/Statement.class.php(71): Statement->renderContent('\n <f...', Array)\n#4 /var/www/html/inc/templating/Statement.class.php(30): Statement->render(Array)\n#5 /var/www/html/inc/templating/Template.class.php(53): Statement->render(Array)\n#6 /var/www/html/tasks.php(427): Template->render(Array)\n#7 {main}\n thrown in /var/www/html/inc/templating/Statement.class.php(190) : eval()'d code on line 1, referer: https://127.0.0.1:8334/hashlists.php?id=2

Database Connections Fails

I wasn't able to connect to my database with my docker compose file. I received the error: "php_network_getaddresses: getaddrinfo failed: Name or service not known"

I ended up having to hard code my database parameters into /var/www/html/inc/conf.php and setting the INSTALL mode to false. Following this I was able to establish a DB connection and complete setup.

Here's the compose file (usernames and passwords intentionally blanked out):

version:  '3.3'
services:
   hashtopolis:
       container_name:  hashtopolis
       image:  kpeiruza/hashtopolis:latest
       restart:  unless-stopped
       environment:
           MYSQL_HOST:  mariadb10
           MYSQL_PORT:  3306
           MYSQL_DB:  hashtopolis
           MYSQL_USER:  
           MYSQL_PASSWORD:  
           H8_USER:  
           H8_PASS:  
           H8_EMAIL:  root@localhost
       volumes:
           -  hashtopolis_import:/var/www/html/import
           -  hashtopolis_files:/var/www/html/files
           -  hashtopolis_inc:/var/www/html/inc
           -  hashtopolis_locks:/var/www/html/inc/utils/locks
       expose:
           -  '80/tcp'
volumes:
   hashtopolis_import:
       name:  hashtopolis_import
   hashtopolis_files:
       name:  hashtopolis_files
   hashtopolis_inc:
       name:  hashtopolis_inc
   hashtopolis_locks:
       name:  hashtopolis_locks
networks:
   default:
       external:
           name:  nginx-proxy

latest doesn't accept any voucher

playing a bit around with your hashtopolis docker server, but the stable version I have no problems connecting new agents with a voucher. The latest version just doesn't except any voucher.

When using a non existent voucher I get the correct answer from the hashtopolis server;
Registering failed: {'action': 'register', 'response': 'ERROR', 'message': 'Provided voucher does not exist.'}

But with a voucher that does exists;
No token found! Please enter a voucher to register your agent:
floating
{'action': 'register', 'voucher': 'floating', 'name': 'some_host_name'}
Resetting dropped connection: hashtopolis-server
http://hashtopolis-server:80 "POST /api/server.php HTTP/1.1" 500 0
Status code from server: 500
Request failed!

Even with the setting on that voucher doesn't expire. Might be related to the resetting dropped connection, but odd that I only get that on a good voucher (agent is ubuntu 18,04). Also I have not setup the latest version of hashtopolis outside docker, so it might be related not to your docker project.

New Docker image pushed, Hashtopolis 0.13

New Docker image pushed, Hashtopolis has been updated as well, please try it out

The new image works just fine.

However, updating from 0.12 to 0.13 by removing the container and spinning up a new one using the new image doesn't. You have to throw everything away in order to do that, though I don't understand why. Removing the container and spinning up a new one on top of the persistent volumes with a new image results in a blank webpage. Spinning up a completely new instance works.

Build image for ARM

Hi!

Can you build and update the docker hub image for ARM devices (odroid, raspberry, etc)?
Right now the image on dockerhub can be used only on x86 arch

EDIT: Thank you for the work :)

Failed connecting to the database using Docker compose

I am trying to get this up and running with docker compose, here is my docker-compose.yml

version: '3'

services:

  hash_mysql:
    container_name: hash_mysql
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: verySecret

  hastopolis:
    container_name: hashtopolis
    image: kpeiruza/hashtopolis
    environment:
      H8_USER: root
      H8_PASS: verySecret
      H8_EMAIL: root@localhost
    links:
      - hash_mysql:mysql
    ports:
     - "80:80"

I am getting the error:

Failed connecting to the database.... Sleeping 5s and retrying 11 more.

I thought this might be an issue with my compose setup (which it still may be) but I have tried running with the basic setup listed in the readme:

docker run --name mydb -e MYSQL_ROOT_PASSWORD=PleaseChangeMe -d mysql:5.7
docker run --link mydb:mysql -d -p 80:80 kpeiruza/hashtopolis

and I get the same error.

Is this an issue with my setup?

Docker crashes when rebooted

Hey,

I might be bit noob in docker world and that might be problem number1.

But me and my friend have successfully installed docker for first time and everything is working fine until we reboot server and start container again. It will only loop and generate error that database with name Hashtopolis is already created and cannot be created again. After that container crashes.

How do we can edit container so it does not try to create new DB after rebooting?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.