Skip to content

Commit

Permalink
Ability to install into raw linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnamee committed Aug 4, 2021
1 parent 1e4ccd9 commit 61203ba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
11 changes: 7 additions & 4 deletions docker-to-bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ cat Dockerfile >> $FILENAME

# Remove Docker keywords
sed -i'.bak' -e 's/RUN //g' $FILENAME
sed -i'.bak' -e 's/ENV //g' $FILENAME
sed -i'.bak' -e 's/ENV /export /g' $FILENAME

# Remove whole lines
sed -i'.bak' -e '/^FROM/d' $FILENAME
sed -i'.bak' -e '/^LABEL/d' $FILENAME
sed -i'.bak' -e '/^WORKDIR/d' $FILENAME
sed -i'.bak' -e '/^COPY/d' $FILENAME
sed -i'.bak' -e '/^ENTRYPOINT/d' $FILENAME
sed -i'.bak' -e '/^CMD/d' $FILENAME

Expand All @@ -45,9 +46,11 @@ sed -i'.bak' -e 's/apt-get clean && .*/echo "Placeholder"/g' $FILENAME
# We don't want the script interupted to switch Shells
sed -i'.bak' -e 's/chsh -s $(which zsh)/echo "Placeholder"/g' $FILENAME

# Remove last 2 lines (could be improved)
tac $FILENAME | sed '1,2d' | tac > "${FILENAME}.bak"
cat "${FILENAME}.bak" > $FILENAME
# Add PATH
echo "echo \"export PATH=\${PATH}\" >> ~/.zshrc" >> $FILENAME

# Change default shell right at the end
echo "chsh -s \$(which zsh)" >> $FILENAME

# Remove Backup file
rm "${FILENAME}.bak"
32 changes: 18 additions & 14 deletions install-in-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/bash

# Environment Variables
HOME=/root
TOOLS="/opt"
ADDONS="/usr/share/addons"
WORDLISTS="/usr/share/wordlists"
GO111MODULE=on
GOROOT=/usr/local/go
GOPATH=/go
PATH=${GOPATH}/bin:${GOROOT}/bin:${PATH}
DEBIAN_FRONTEND=noninteractive
export HOME=/root
export TOOLS="/opt"
export ADDONS="/usr/share/addons"
export WORDLISTS="/usr/share/wordlists"
export GO111MODULE=on
export GOROOT=/usr/local/go
export GOPATH=/go
export PATH=${HOME}/:${GOPATH}/bin:${GOROOT}/bin:${PATH}
export DEBIAN_FRONTEND=noninteractive

# Create working dirs
mkdir $WORDLISTS && mkdir $ADDONS

# --- Common Dependencies ---

# Install Essentials
apt-get update \
&& apt-get install -y --no-install-recommends \
apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
apt-utils \
awscli \
build-essential \
Expand Down Expand Up @@ -52,7 +52,8 @@ apt-get update \
echo "Placeholder"

# Install tools & dependencies
apt-get update && apt-get install -y --no-install-recommends --fix-missing \
apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
brutespray \
crunch \
dirb \
Expand Down Expand Up @@ -100,7 +101,7 @@ curl -sL https://deb.nodesource.com/setup_14.x | bash - \
# Install Pip (for Python2)
curl -sSL https://bootstrap.pypa.io/pip/3.4/get-pip.py -o get-pip.py && \
python get-pip.py && \
echo "PATH=$HOME/.local/bin/:$PATH" >> ~/.bashrc && \
echo "PATH=$HOME/.local/bin/:$PATH" >> ~/.zshrc && \
rm get-pip.py

# Install Python3 common dependencies
Expand Down Expand Up @@ -345,7 +346,6 @@ git clone --depth 1 https://gitlab.com/kalilinux/packages/webshells.git /usr/sha
ln -s /usr/share/webshells $ADDONS/webshells

# Copy the startup script across
COPY ./startup.sh /startup.sh

# --- Config ---

Expand Down Expand Up @@ -376,3 +376,7 @@ sed -i 's^ZSH_THEME="robbyrussell"^ZSH_THEME="bira"^g' ~/.zshrc && \
git config --global oh-my-zsh.hide-info 1

# --- Finished ---

# Start up commands
echo "export PATH=${PATH}" >> ~/.zshrc
chsh -s $(which zsh)

0 comments on commit 61203ba

Please sign in to comment.