From 5ec6951eda3a03832fd14e3e2e00ab527f332de3 Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Thu, 22 Oct 2026 14:57:31 -0400 Subject: [PATCH] Updated for kali, ready for testing --- .gitignore | 2 + README.md | 6 +++ dotfiles/fstab | 1 + dotfiles/gibson | 3 ++ dotfiles/guest-restore.service | 9 ++++ dotfiles/{zshrc => rc_addition} | 7 --- dotfiles/slick-greeter.conf | 11 ----- lists/apt-packages | 2 + lists/flatpak-packages | 13 ++++++ lists/sources.list | 8 ---- scripts/install.sh | 82 +++++++++++++++++++++++++-------- scripts/ohmyzsh | 1 - scripts/restore-home | 9 ++-- scripts/save-home | 1 - 14 files changed, 105 insertions(+), 50 deletions(-) create mode 100644 .gitignore create mode 100644 dotfiles/fstab create mode 100644 dotfiles/gibson create mode 100644 dotfiles/guest-restore.service rename dotfiles/{zshrc => rc_addition} (73%) delete mode 100644 dotfiles/slick-greeter.conf create mode 100644 lists/flatpak-packages delete mode 100644 lists/sources.list delete mode 100644 scripts/ohmyzsh delete mode 100644 scripts/save-home diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9e38db --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +guest.tar.gz +guest.sqfs diff --git a/README.md b/README.md index 1d94ca8..4c021db 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # **H**ac**D**C **O**perating **S**ystem +Script to take a fresh Kali install to the base HacDC system environment + +```bash +sh -c "$(curl -fsSL https://git.corrupt.link/liz/hdos/install.sh)" +``` + [*More on the HacDC Wiki*](https://wiki.hacdc.org/en/Resources/HDOS) diff --git a/dotfiles/fstab b/dotfiles/fstab new file mode 100644 index 0000000..3d16a7a --- /dev/null +++ b/dotfiles/fstab @@ -0,0 +1 @@ +//10.11.3.44/Anna /mnt/gibson cifs uid=1000,gid=1900,credentials=/etc/gibson,iocharset=utf8 0 0 diff --git a/dotfiles/gibson b/dotfiles/gibson new file mode 100644 index 0000000..7e0653b --- /dev/null +++ b/dotfiles/gibson @@ -0,0 +1,3 @@ +user=laptop +password= +domain=WORKGROUP diff --git a/dotfiles/guest-restore.service b/dotfiles/guest-restore.service new file mode 100644 index 0000000..11afb9c --- /dev/null +++ b/dotfiles/guest-restore.service @@ -0,0 +1,9 @@ +[Unit] +Description=Restore Guest Home Directory + +[Service] +Type=oneshot +ExecStart=/usr/sbin/restore-home + +[Install] +WantedBy=multi-user.target diff --git a/dotfiles/zshrc b/dotfiles/rc_addition similarity index 73% rename from dotfiles/zshrc rename to dotfiles/rc_addition index 1b6c02a..4646686 100644 --- a/dotfiles/zshrc +++ b/dotfiles/rc_addition @@ -1,10 +1,3 @@ -# OhMyZSH -export ZSH="$HOME/.oh-my-zsh" -ZSH_THEME="bira" -COMPLETION_WAITING_DOTS="true" -DISABLE_UNTRACKED_FILES_DIRTY="true" -plugins=(git) -source $ZSH/oh-my-zsh.sh # NVM export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm diff --git a/dotfiles/slick-greeter.conf b/dotfiles/slick-greeter.conf deleted file mode 100644 index 5239144..0000000 --- a/dotfiles/slick-greeter.conf +++ /dev/null @@ -1,11 +0,0 @@ -[Greeter] -background=/etc/lightdm/htown.png -background-color=#000000 -show-hostname=true -show-power=true -show-a11y=true -show-clock=true -#logo= -group-filter= -[SeatDefaults] -session-setup-script=/opt/hdos/scripts/restore-home diff --git a/lists/apt-packages b/lists/apt-packages index 8af79d5..c21fcf9 100644 --- a/lists/apt-packages +++ b/lists/apt-packages @@ -98,6 +98,7 @@ previsat python3-all quisk rclone +squashfs-tools rtl-sdr screen sed @@ -119,6 +120,7 @@ tmux tty-solitaire tvtime udav +cifs-utils vlc vlc-plugin-access-extra welle.io diff --git a/lists/flatpak-packages b/lists/flatpak-packages new file mode 100644 index 0000000..688301b --- /dev/null +++ b/lists/flatpak-packages @@ -0,0 +1,13 @@ +com.getpostman.Postman +com.google.EarthPro +com.js8call.JS8Call +com.prusa3d.PrusaSlicer +com.rawtherapee.RawTherapee +io.github.ungoogled_software.ungoogled_chromium +io.gitlab.librewolf-community +org.blender.Blender +org.darktable.Darktable +org.freecad.FreeCAD +org.qgis.qgis +org.videolan.VLC +com.vscodium.codium-insiders diff --git a/lists/sources.list b/lists/sources.list deleted file mode 100644 index 2ae7e4a..0000000 --- a/lists/sources.list +++ /dev/null @@ -1,8 +0,0 @@ -deb http://mirror.cogentco.com/debian/ bookworm main non-free contrib non-free-firmware -deb-src http://mirror.cogentco.com/debian/ bookworm main non-free contrib non-free-firmware - -deb http://security.debian.org/debian-security bookworm-security main non-free contrib non-free-firmware -deb-src http://security.debian.org/debian-security bookworm-security main non-free contrib non-free-firmware - -deb http://mirror.cogentco.com/debian/ bookworm-updates main non-free contrib non-free-firmware -deb-src http://mirror.cogentco.com/debian/ bookworm-updates main non-free contrib non-free-firmware diff --git a/scripts/install.sh b/scripts/install.sh index 8cc518f..8634a9e 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -1,35 +1,81 @@ #!/bin/bash + +# Todo: +# - Add error handling for each step +read -p "Gibson Share Password: " GIBSON_PASS + HDOS_ROOT=/opt/hdos -rm -rf ${HDOS_ROOT} + +if [ -d ${HDOS_ROOT} ]; then + rm -rf ${HDOS_ROOT} +fi + +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root" + exit 1 +fi + +chmod +x ${HDOS_ROOT}/scripts/* apt install git sudo curl wget zsh -yqq git clone https://git.corrupt.link/liz/hdos.git ${HDOS_ROOT} chmod -R 755 ${HDOS_ROOT} -cp ${HDOS_ROOT}/lists/sources.list /etc/apt/sources.list - apt update -apt upgrade -yqq +apt full-upgrade -yqq -xargs apt install -y < ${HDOS_ROOT}/lists/apt-packages +INSTALLED=`dpkg --get-selections | grep -e " install$" | sed -e 's/\t\+install//'` +while read PACKAGE; do + if ! echo "$INSTALLED" | grep -q "^$PACKAGE$"; then + apt install -yqq "$PACKAGE" + fi +done < ${HDOS_ROOT}/lists/apt-packages apt autoremove -y -${HDOS_ROOT}/scripts/nvm -${HDOS_ROOT}/scripts/codium -${HDOS_ROOT}/scripts/ohmyzsh +cat ${HDOS_ROOT}/dotfiles/rc_addition >> /home/hacdc/.zshrc +groupadd --gid 1900 classroom +usermod -aG classroom hacdc +useradd -m -s /usr/bin/zsh -G dialout,cdrom,floppy,audio,video,wireshark,classroom guest +cp /home/hacdc/.zshrc /home/guest/.zshrc +chown guest:guest /home/guest/.zshrc -chsh root /usr/bin/zsh -chsh hacdc /usr/bin/zsh - -sudo -u hacdc ${HDOS_ROOT}/scripts/ohmyzsh sudo -u hacdc ${HDOS_ROOT}/scripts/nvm sudo -u hacdc ${HDOS_ROOT}/scripts/pyenv -sudo -u hacdc gpg --list-keys -cp ${HDOS_ROOT}/dotfiles/zshrc /root/.zshrc -cp ${HDOS_ROOT}/dotfiles/zshrc /home/hacdc/.zshrc -chown hacdc:hacdc /home/hacdc/.zshrc -cp ${HDOS_ROOT}/dotfiles/slick-greeter.conf /etc/lightdm/ -cp ${HDOS_ROOT}/dotfiles/htown.png /etc/lightdm/ +sudo -u guest ${HDOS_ROOT}/scripts/nvm +sudo -u guest ${HDOS_ROOT}/scripts/pyenv + +# Generate GPG framework +sudo -u hacdc gpg --list-keys +sudo -u guest gpg --list-keys + +# Setup Shared Directory +SHARED_DIR=/mnt/gibson +if [ ! -d ${SHARED_DIR} ]; then + mkdir -p ${SHARED_DIR} + cat ${HDOS_ROOT}/dotfiles/gibson > /etc/gibson + chmod 600 /etc/gibson + cat ${HDOS_ROOT}/dotfiles/fstab >> /etc/fstab + chmod 766 ${SHARED_DIR} + sed -i "s/password=/password=${GIBSON_PASS}/" /etc/gibson + systemctl daemon-reload + ln -s ${SHARED_DIR} /home/hacdc/Desktop/gibson + ln -s ${SHARED_DIR} /home/guest/Desktop/gibson + chown guest:guest /home/guest/Desktop/gibson + chown hacdc:hacdc /home/hacdc/Desktop/gibson + chmod 755 ${SHARED_DIR} +fi + +# Set login wallpaper +cp ${HDOS_ROOT}/dotfiles/htown.png /usr/share/backgrounds/htown.png +sed -i 's/^background=.*$/background=\/usr\/share\/backgrounds\/htown.png/' /usr/share/sddm/themes/*/theme.conf.user + +mksquashfs /home/guest ${HDOS_ROOT}/guest.sqfs --noappend +cp ${HDOS_ROOT}/scripts/restore-home /usr/sbin/restore-home +cp ${HDOS_ROOT}/dotfiles/guest-restore.service /etc/systemd/system/guest-restore.service +systemctl daemon-reload +systemctl enable guest-restore.service + + diff --git a/scripts/ohmyzsh b/scripts/ohmyzsh deleted file mode 100644 index c367155..0000000 --- a/scripts/ohmyzsh +++ /dev/null @@ -1 +0,0 @@ -sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended diff --git a/scripts/restore-home b/scripts/restore-home index aff7b66..9cc6833 100644 --- a/scripts/restore-home +++ b/scripts/restore-home @@ -1,4 +1,5 @@ -rm -rf /home/hacdc -tar -xf /opt/home.tar -C / -chown -R hacdc:hacdc /home/hacdc -chown -R hacdc:hacdc /home/hacdc/.* +#!/bin/bash + +rm -rf /home/guest +unsquashfs -d /home/guest /opt/hdos/guest.sqfs +chown -R guest:guest /home/guest diff --git a/scripts/save-home b/scripts/save-home deleted file mode 100644 index 44eb048..0000000 --- a/scripts/save-home +++ /dev/null @@ -1 +0,0 @@ -tar -cvpzf /opt/home.tgz /home/hacdc