diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e65b282 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Use Ubuntu as the base image +FROM rust:latest + +# Install required packages, including Chromium +RUN apt-get update && apt-get install -y git sudo wget p7zip-full + +# Set the working directory +WORKDIR /app + +# Clone the repository directly into the working directory +RUN git clone https://github.com/cosmic-zip/witch_craft --branch=feature/dockerfile --depth=1 + +# Change the working directory to the cloned repository +WORKDIR /app/witch_craft + +# Ensure the build.sh script has execute permissions +RUN chmod +x build.sh + +# Run the build.sh script +RUN ./build.sh +RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +RUN apt-get install -y ./google-chrome-stable_current_amd64.deb + +# Default command +CMD ["bash"] diff --git a/build.sh b/build.sh index db9861b..ddc3a96 100755 --- a/build.sh +++ b/build.sh @@ -2,39 +2,17 @@ set -e echo && echo "Install dependencies" -#!/bin/bash - -# Check if the package manager is apt or yum -if command -v apt &> /dev/null; then - package_manager="apt" -elif command -v yum &> /dev/null; then - package_manager="yum" -else - echo "Unsupported package manager. Please install the packages manually." - exit 1 -fi - -# Install packages -if [ "$package_manager" == "apt" ]; then - echo && echo "Trying to install chromium, its used for social media OSINT!" - sudo snap install chromium - - echo && echo "Install apt depedencies" - sudo apt update - sudo apt install -y nmap whois dirb dnsenum libc-bin iproute2 xxd iptables coreutils wget curl \ - dnsutils traceroute openssl openssh-server xattr libimage-exiftool-perl tor foremost pkg-config \ - libssl-dev steghide doas nala libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev 7zip \ - libayatana-appindicator3-dev librsvg2-dev -elif [ "$package_manager" == "yum" ]; then - sudo yum update -y - sudo yum install -y nmap dirb dnsenum glibc-utils xxd iptables-utils iproute wget curl bind-utils traceroute -fi +sudo apt update +sudo apt install -y nmap whois dirb dnsenum libc-bin iproute2 xxd iptables coreutils wget curl \ +dnsutils traceroute openssl openssh-server xattr libimage-exiftool-perl tor foremost pkg-config \ +libssl-dev steghide libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev 7zip \ +libayatana-appindicator3-dev librsvg2-dev # Install data echo && echo "Install witch_spells data" sudo cp -r archive/ /var/ sudo chown -R $(whoami):$(whoami) /var/archive -7z x /var/archive/witch_spells/osint/archive.7z.001 +7z x /var/archive/witch_spells/osint/Archive.7z.001 echo 'export WITCH_SPELLS_ROOT_DIR=/var/archive/witch_spells/' >> ~/.bash_profile export WITCH_SPELLS_ROOT_DIR=/var/archive/witch_spells/ @@ -48,13 +26,3 @@ echo && echo "Cargo build" cargo build --release --manifest-path witch_craft/Cargo.toml chmod +x ./witch_craft/target/release/witch_craft sudo cp -r ./witch_craft/target/release/witch_craft /bin - - -# Test and print status for each binary -witch_craft -if [ $? -eq 0 ]; then - echo "Exit code is 0, all good!" -else - echo "Exit code is not 0, something went wrong." - exit -fi diff --git a/witchcraft.sh b/witchcraft.sh new file mode 100755 index 0000000..f2ddffa --- /dev/null +++ b/witchcraft.sh @@ -0,0 +1,5 @@ +echo && echo "Build docker container" +docker buildx build . -t witchcraft + +echo && echo "Run witchcraft inside a docker container" +docker run -it witchcraft bash