Skip to content

Commit

Permalink
update to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Abyss-W4tcher committed Jan 10, 2025
1 parent e3a55d4 commit b663d41
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
13 changes: 6 additions & 7 deletions vol_ez_install/Dockerfile-vol3
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ FROM alpine:3.17

RUN apk update

RUN apk add python3 python3-dev py-pip snappy-dev make gcc capstone musl-dev linux-headers openssl-dev libusb-dev

RUN wget https://github.com/volatilityfoundation/volatility3/raw/develop/requirements.txt -O /tmp/requirements.txt && wget https://github.com/volatilityfoundation/volatility3/raw/develop/requirements-minimal.txt -O /tmp/requirements-minimal.txt

# 26/09/2023 : higher versions cannot compile with pip ("leechcorepyc.c:6:10: fatal error: leechcorepyc.h: No such file or directory")
RUN sed -i 's/leechcorepyc>=2.4.0/leechcorepyc==2.15.1/g' /tmp/requirements.txt
RUN apk add git python3 python3-dev py-pip snappy-dev make gcc capstone musl-dev linux-headers openssl-dev libusb-dev

RUN pip3 install wheel

RUN pip3 install -r /tmp/requirements.txt
WORKDIR /tmp
# https://stackoverflow.com/a/58801213
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
RUN git clone https://github.com/volatilityfoundation/volatility3.git && cd volatility3/ && pip3 install .[full]
RUN rm -rf volatility3
4 changes: 4 additions & 0 deletions vol_ez_install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Bored of spending more time installing volatility than actually using it ? Here

One container for each volatility version will be setup. The volatility code will be **hosted directly on your host**, in the home directory ("\~/vol2" and "\~/vol3"). Containers will be able to access it via a binded mount.

## Disclaimer

The use of a dockerized setup for Volatility3 is not worth the Docker overhead, as Volatility3 dependencies integrate well with recent systems. It is still available for specific scenarios however.

## Setup

**Requirements :**
Expand Down
25 changes: 15 additions & 10 deletions vol_ez_install/vol_ez_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ vol2_install() {
# Clone volatility2
git clone https://github.com/volatilityfoundation/volatility.git ~/vol2/volatility2
# Add aliases
grep -q 'wvol' ~/.zshrc ~/.bashrc || add_rc 'wvol() { echo "/bind"$(printf "%q" "$(realpath ""$1"")"); }'
grep -q 'vol2d' ~/.zshrc ~/.bashrc || add_rc 'alias vol2d="sudo docker run --rm -v /:/bind/ vol2_dck python2 $(wvol ~/vol2/volatility2/vol.py)"'
grep -q 'wvol' ~/.zshrc ~/.bashrc &>/dev/null || add_rc 'wvol() { echo "/bind"$(printf "%q" "$(realpath ""$1"")"); }'
grep -q 'vol2d' ~/.zshrc ~/.bashrc &>/dev/null || add_rc 'alias vol2d="sudo docker run --rm -v /:/bind/ vol2_dck python2 $(wvol ~/vol2/volatility2/vol.py)"'

echo 'volatility2 setup completed !'
}
Expand All @@ -58,20 +58,20 @@ vol3_install() {
# Add volume for cache
sudo docker volume create vol3-cache
# Clone volatility3
git clone https://github.com/volatilityfoundation/volatility3.git ~/vol3/volatility3
git clone https://github.com/volatilityfoundation/volatility3.git ~/vol3/volatility3 || (echo "Running git pull in ~/vol3/volatility3..." && cd ~/vol3/volatility3 && git pull)
# Add aliases
grep -q 'wvol' ~/.zshrc ~/.bashrc || add_rc 'wvol() { echo "/bind"$(printf "%q" "$(realpath ""$1"")"); }'
grep -q 'vol3d' ~/.zshrc ~/.bashrc || add_rc 'alias vol3d="sudo docker run --rm -v vol3-cache:/root/.cache/volatility3/ -v /:/bind/ vol3_dck python3 $(wvol ~/vol3/volatility3/vol.py)"'
grep -q 'volshell3d' ~/.zshrc ~/.bashrc || add_rc 'alias volshell3d="sudo docker run --rm -it -v vol3-cache:/root/.cache/volatility3/ -v /:/bind/ vol3_dck python3 $(wvol ~/vol3/volatility3/volshell.py)"'
grep -q 'wvol' ~/.zshrc ~/.bashrc &>/dev/null || add_rc 'wvol() { echo "/bind"$(printf "%q" "$(realpath ""$1"")"); }'
grep -q 'vol3d' ~/.zshrc ~/.bashrc &>/dev/null || add_rc 'alias vol3d="sudo docker run --rm -v vol3-cache:/root/.cache/volatility3/ -v /:/bind/ vol3_dck python3 $(wvol ~/vol3/volatility3/vol.py)"'
grep -q 'volshell3d' ~/.zshrc ~/.bashrc &>/dev/null || add_rc 'alias volshell3d="sudo docker run --rm -it -v vol3-cache:/root/.cache/volatility3/ -v /:/bind/ vol3_dck python3 $(wvol ~/vol3/volatility3/volshell.py)"'

echo 'volatility3 setup completed !'

}

# A bit ugly, but straight to the point
type docker &>/dev/null || { echo "Please install docker before proceeding"; exit 1; }
type sudo &>/dev/null || { echo "Please install sudo before proceeding"; exit 1; }
type git &>/dev/null || { echo "Please install git before proceeding"; exit 1; }
for cmd in docker sudo git wget; do
type $cmd &>/dev/null || { echo "Please install $cmd before proceeding"; exit 1; }
done


install=false
for arg in "$@"; do
Expand All @@ -90,3 +90,8 @@ if [ "$install" = true ]; then
else
Help
fi

# Testing:
# docker run --rm -it -v "${DOCKER_HOST#unix://}":/var/run/docker.sock -v $(pwd):/vol_dock ubuntu:latest bash
# apt update && apt install -y wget sudo docker.io
# cd /vol_dock/vol_ez_install/ && ./vol_ez_install.sh vol3_install

0 comments on commit b663d41

Please sign in to comment.