commit bc2201284626a84a8b921a443d4cacc858ad4231 Author: Ondrej Hladuvka Date: Wed May 21 21:21:06 2025 +0300 cviko auth diff --git a/auth/Dockerfile b/auth/Dockerfile new file mode 100644 index 0000000..de5cb3b --- /dev/null +++ b/auth/Dockerfile @@ -0,0 +1,40 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y build-essential git libssl-dev && \ + #git clone https://github.com/openwall/john -b bleeding-jumbo john-jumbo && \ + #cd john-jumbo/src && \ + #./configure && \ + #make -sj 12 && \ + #ln -s /john-jumbo/run/keepass2john /usr/local/bin/keepass2john && \ + cd / && \ + #add-apt-repository ppa:eugenesan/ppa && apt update && apt-get install keepass2 && \ + apt-get install -y \ + wget \ + apache2 \ + openssl \ + john \ + hydra \ + libssl-dev \ + keepass2 \ + build-essential \ + keepass2 \ + && apt-get clean + +RUN wget https://github.com/brannondorsey/naive-hashcat/releases/download/data/rockyou.txt -O /rockyou.txt + +COPY password_crack.sh /opt/password_crack.sh +COPY keepass_crack.sh /opt/keepass_crack.sh +COPY apache_config.sh /opt/apache_config.sh +COPY steve_passwords.kdbx /opt/steve_passwords.kdbx + +RUN chmod +x /opt/*.sh + +RUN mkdir -p /var/www/web.ssb && echo "

Hello world

" > /var/www/web.ssb/index.html + +RUN /opt/apache_config.sh + +CMD ["bash"] + diff --git a/auth/apache_config.sh b/auth/apache_config.sh new file mode 100644 index 0000000..cb3d077 --- /dev/null +++ b/auth/apache_config.sh @@ -0,0 +1,38 @@ +#!/bin/bash +APACHE_CONF="/etc/apache2/sites-available/000-default.conf" + +a2enmod ssl +a2ensite default-ssl + +mkdir -p /etc/apache2/ssl +openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ + -keyout /etc/apache2/ssl/apache.key \ + -out /etc/apache2/ssl/apache.crt \ + -subj "/C=US/ST=State/L=City/O=Organization/OU=Unit/CN=wev.ssb" + +echo ' + + ServerAdmin admin@localhost + + DocumentRoot /var/www/web.ssb + ServerName web.ssb + ServerAlias www.web.ssb + SSLEngine on + SSLCertificateFile /etc/apache2/ssl/apache.crt + SSLCertificateKeyFile /etc/apache2/ssl/apache.key + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + AuthType Basic + AuthName "Restricted Content" + AuthUserFile /etc/apache2/.htpasswd + Require valid-user + + +' > $APACHE_CONF + +htpasswd -cb /etc/apache2/.htpasswd test admin + +service apache2 restart + diff --git a/auth/keepass_crack.sh b/auth/keepass_crack.sh new file mode 100644 index 0000000..f5e7fdf --- /dev/null +++ b/auth/keepass_crack.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +john --wordlist=/rockyou.txt <(keepass2john /opt/steve_passwords.kdbx) + diff --git a/auth/password_crack.sh b/auth/password_crack.sh new file mode 100644 index 0000000..7e8ae37 --- /dev/null +++ b/auth/password_crack.sh @@ -0,0 +1,3 @@ +#!/bin/bash +john --fork=8 --wordlist=/rockyou.txt --format=crypt <(echo '$1$randsalt$1FzqFfQs5tCdStIZl215/.') + diff --git a/auth/steve_passwords.kdbx b/auth/steve_passwords.kdbx new file mode 100644 index 0000000..38ca904 Binary files /dev/null and b/auth/steve_passwords.kdbx differ