Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dockerfile #87

Merged
merged 6 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
44 changes: 6 additions & 38 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand All @@ -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
5 changes: 5 additions & 0 deletions witchcraft.sh
Original file line number Diff line number Diff line change
@@ -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
Loading