Restructure Dockerfiles and add Oh My Zsh support
Major changes:
- Dockerfile now builds the REMnux-based image (was Dockerfile.remnux)
- Removed redundant Dockerfile.remnux
- Dockerfile.scratch builds from Ubuntu 20.04 (from scratch variant)
- Updated Makefile to reflect new structure:
- 'make build' for REMnux-based (default)
- 'make build-scratch' for Ubuntu-based
- Removed kali references
- Simplified targets and naming
Zsh improvements:
- Added Oh My Zsh auto-installation on first run
- Pre-install Oh My Zsh in Docker images for remnux user
- Custom prompt with 🔍 indicator for analysis work
- Fallback to minimal config for system users
- Includes plugins: git, docker, command-not-found, colored-man-pages
- Welcome message shows only once per session
- No more first-time configuration prompts
Shell experience:
- bash (default) - traditional, reliable
- zsh - now with Oh My Zsh, custom theme, plugins
- fish - friendly interactive shell
All shells include help aliases and analysis shortcuts.
This commit is contained in:
176
Dockerfile
176
Dockerfile
@@ -1,134 +1,88 @@
|
||||
FROM kalilinux/kali-rolling
|
||||
FROM remnux/remnux-distro:latest
|
||||
LABEL maintainer="tabledevil"
|
||||
|
||||
USER root
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Europe/Berlin
|
||||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y \
|
||||
autoconf \
|
||||
busybox \
|
||||
catdoc \
|
||||
docx2txt \
|
||||
exiftool \
|
||||
fd-find \
|
||||
fish \
|
||||
git \
|
||||
imagemagick \
|
||||
libboost-python-dev \
|
||||
libboost-thread-dev \
|
||||
libjpeg-dev \
|
||||
libreoffice \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
mc \
|
||||
mpack \
|
||||
npm \
|
||||
osslsigncode \
|
||||
p7zip-full \
|
||||
pdftk \
|
||||
pev \
|
||||
pkg-config \
|
||||
pipx \
|
||||
powershell \
|
||||
python3 \
|
||||
python3-lxml \
|
||||
python3-pip \
|
||||
ripgrep \
|
||||
ruby \
|
||||
unrtf \
|
||||
unzip \
|
||||
wget \
|
||||
zsh \
|
||||
zsh-autosuggestions \
|
||||
zsh-syntax-highlighting \
|
||||
; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Configure PIP´y
|
||||
# Install additional system packages that REMnux doesn't include
|
||||
RUN apt-get update && apt-get install -y \
|
||||
busybox \
|
||||
catdoc \
|
||||
docx2txt \
|
||||
fd-find \
|
||||
fish \
|
||||
fzf \
|
||||
mc \
|
||||
pipx \
|
||||
ripgrep \
|
||||
unrtf \
|
||||
zsh \
|
||||
zsh-autosuggestions \
|
||||
zsh-syntax-highlighting \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Configure pip
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ADD pip.conf /etc/pip.conf
|
||||
|
||||
# OLETOOLS & DIDIERSTEVENS
|
||||
RUN git clone https://github.com/DidierStevens/DidierStevensSuite /opt/didierstevenssuite
|
||||
RUN chmod +x /opt/didierstevenssuite/*py
|
||||
RUN python3 -m pip install --break-system-packages --upgrade pip ; true
|
||||
RUN python3 -m pip install --break-system-packages psutil oletools ; true
|
||||
# Install unfurl & dependencies via pipx (for URL analysis)
|
||||
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --include-deps dfir-unfurl \
|
||||
&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx inject dfir-unfurl requests six maclookup
|
||||
|
||||
# PDF
|
||||
RUN gem install origami
|
||||
# Install visidata via pipx (for data exploration)
|
||||
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --include-deps visidata
|
||||
|
||||
RUN sed -i '/PDF/s/"none"/"read|write"/' /etc/ImageMagick-6/policy.xml
|
||||
# Install offline help and cheat sheet tools
|
||||
RUN PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --include-deps cheat \
|
||||
&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install --include-deps tldr
|
||||
|
||||
# PowerShell: Install PSScriptAnalyzer module
|
||||
RUN pwsh -NoProfile -Command "Install-Module -Name PSScriptAnalyzer -Force"
|
||||
# Removed navi - focus on tldr and cheat for reliable help system
|
||||
|
||||
ENV PATH="${PATH}:/opt/didierstevenssuite/:/opt/pypy2.7-v7.3.5-linux64/bin"
|
||||
# Create data directory and set permissions
|
||||
RUN mkdir -p /data \
|
||||
&& chown remnux:remnux /data
|
||||
|
||||
# Add documentation and streamlined help system
|
||||
ADD files/README /opt/README
|
||||
ADD files/command_help /opt/command_help
|
||||
RUN echo 'cat /opt/README' >> /etc/bash.bashrc
|
||||
|
||||
# Add shell configurations
|
||||
ADD files/zshrc /etc/zsh/zshrc
|
||||
ADD files/fish_config.fish /etc/fish/conf.d/remnux.fish
|
||||
ADD scripts/create-offline-help-system.sh /usr/local/bin/create-offline-help-system.sh
|
||||
ADD scripts/find-tool /usr/local/bin/find-tool
|
||||
ADD scripts/fhelp /usr/local/bin/fhelp
|
||||
ADD scripts/import-remnux-cheatsheets.sh /usr/local/bin/import-remnux-cheatsheets.sh
|
||||
ADD scripts/convert-remnux-cheats.py /usr/local/bin/convert-remnux-cheats.py
|
||||
ADD scripts/add-tool-cheats.sh /usr/local/bin/add-tool-cheats.sh
|
||||
|
||||
# Add helper scripts for cheat sheet management
|
||||
ADD scripts/add-tool-cheats.sh /tmp/add-tool-cheats.sh
|
||||
RUN chmod +x /tmp/add-tool-cheats.sh && /tmp/add-tool-cheats.sh && rm /tmp/add-tool-cheats.sh
|
||||
# Create streamlined offline help system (tldr + cheat)
|
||||
RUN chmod +x /usr/local/bin/create-offline-help-system.sh /usr/local/bin/find-tool /usr/local/bin/fhelp /usr/local/bin/import-remnux-cheatsheets.sh \
|
||||
&& chmod +x /usr/local/bin/convert-remnux-cheats.py /usr/local/bin/add-tool-cheats.sh \
|
||||
&& /usr/local/bin/create-offline-help-system.sh \
|
||||
&& /usr/local/bin/add-tool-cheats.sh
|
||||
|
||||
# Install Oh My Zsh for remnux user
|
||||
RUN su - remnux -c 'sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended' || true
|
||||
|
||||
### VIPERMONKEY
|
||||
## install pypy
|
||||
RUN wget -O- https://downloads.python.org/pypy/pypy2.7-v7.3.5-linux64.tar.bz2 | tar -C /opt/ -xvj
|
||||
RUN ln -s $(which pypy) /usr/local/bin/python
|
||||
## install and upgrade pip
|
||||
RUN pypy -m ensurepip
|
||||
RUN pypy -m pip install -U pip
|
||||
#RUN pypy -m pip install -U peepdf
|
||||
#RUN pypy -m pip install -U https://github.com/decalage2/ViperMonkey/archive/master.zip
|
||||
#RUN ln -s /opt/pypy2.7-v7.3.5-linux64/site-packages/vipermonkey/vmonkey.py /usr/local/bin/vmonkey
|
||||
#RUN chmod +x /usr/local/bin/vmonkey
|
||||
RUN wget -O- https://github.com/mandiant/capa/releases/download/v7.4.0/capa-v7.4.0-linux.zip | busybox unzip -d /usr/bin -
|
||||
RUN chmod +x /usr/bin/capa
|
||||
# Update bashrc with welcome message and comprehensive help info
|
||||
RUN echo 'cat /opt/README' >> /etc/bash.bashrc \
|
||||
&& echo 'echo ""' >> /etc/bash.bashrc \
|
||||
&& echo 'echo "📚 Comprehensive Help System:"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " fhelp - Complete file analysis help"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " fhelp tools pdf - Find PDF analysis tools"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " fhelp cheat pdfid.py - Show command examples"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " fhelp examples - Browse all examples"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " fhelp pdf - PDF analysis workflow"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo ""' >> /etc/bash.bashrc \
|
||||
&& echo 'echo " Shells: bash (default), zsh (with Oh My Zsh), fish"' >> /etc/bash.bashrc \
|
||||
&& echo 'echo ""' >> /etc/bash.bashrc \
|
||||
&& echo 'alias analyse="fhelp"' >> /etc/bash.bashrc \
|
||||
&& echo 'alias ?="fhelp"' >> /etc/bash.bashrc
|
||||
|
||||
### JS Sandbox
|
||||
RUN npm install box-js --global --production
|
||||
|
||||
### Update flask
|
||||
RUN pip uninstall -y --break-system-packages flask-restx && pip install --break-system-packages flask-restx
|
||||
|
||||
### LATER TODO
|
||||
#RUN git clone https://github.com/buffer/pyv8.git ; cd pyv8 ; python setup.py build && python setup.py install && cd .. && rm -rf pyv8
|
||||
#RUN git clone https://github.com/buffer/libemu.git ; cd libemu ; autoreconf -v -i && ./configure --prefix=/opt/libemu && make install && cd .. && rm -rf libemu2
|
||||
|
||||
### Create User
|
||||
RUN groupadd -g 1000 -r user && \
|
||||
useradd -u 1000 -r -g user -d /home/user -s /sbin/nologin -c "Nonroot User" user && \
|
||||
mkdir /home/user && \
|
||||
cp /root/.bashrc /home/user/ && \
|
||||
chown -R user:user /home/user
|
||||
|
||||
### Create nonroot
|
||||
RUN groupadd -g 1001 -r nonroot && \
|
||||
useradd -u 1001 -r -g nonroot -d /home/nonroot -s /sbin/nologin -c "Nonroot User" nonroot && \
|
||||
mkdir /home/nonroot && \
|
||||
cp /root/.bashrc /home/nonroot/ && \
|
||||
chown -R nonroot:nonroot /home/nonroot
|
||||
|
||||
### Set UP Environment
|
||||
USER nonroot
|
||||
ENV LANG de_DE.UTF-8
|
||||
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/didierstevenssuite/:/opt/pypy2.7-v7.3.5-linux64/bin:/home/nonroot/.local/bin
|
||||
# Switch to remnux user (REMnux default user)
|
||||
USER remnux
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/remnux/.local/bin
|
||||
WORKDIR /data
|
||||
|
||||
### Install unfurl & dependencies
|
||||
RUN pipx install --include-deps dfir-unfurl
|
||||
RUN pipx inject dfir-unfurl requests six maclookup
|
||||
|
||||
### Install visidata
|
||||
RUN pipx install --include-deps visidata
|
||||
|
||||
### Install oletools
|
||||
RUN pipx install --include-deps oletools
|
||||
|
||||
CMD /bin/bash
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
Reference in New Issue
Block a user