Skip to content

Commit

Permalink
Merge pull request #4 from XaviTorello/feature/improve_and_new_tools
Browse files Browse the repository at this point in the history
Better build + integrate w3af, nodejs and vscode-server
  • Loading branch information
XaviTorello authored Mar 26, 2019
2 parents e5905c0 + f08664a commit 9fe40ba
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 26 deletions.
69 changes: 44 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,62 @@ MAINTAINER Xavi Torelló <info@xaviertorello.cat>
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm-256color

RUN rm -fR /var/lib/apt/
RUN apt-get clean
RUN apt-get update -y
RUN apt-get install -y software-properties-common && apt-get update -y
RUN apt-get install -y kali-linux-full --fix-missing
# Install Kali Full
RUN rm -fR /var/lib/apt/ && \
apt-get clean && \
apt-get update -y && \
apt-get install -y software-properties-common kali-linux-full --fix-missing && \
echo 'VERSION_CODENAME=kali-rolling' >> /etc/os-release

# secLists!
RUN git clone https://github.com/danielmiessler/SecLists /usr/share/seclists
# Add NodeJS repo
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash -

# Some system tools
RUN git clone https://github.com/arialdomartini/oh-my-git.git ~/.oh-my-git && echo source ~/.oh-my-git/prompt.sh >> /etc/profile
RUN apt-get install -y git colordiff colortail unzip vim tmux xterm zsh curl telnet strace ltrace tmate less build-essential wget python3-setuptools python3-pip tor proxychains proxychains4 zstd net-tools bash-completion iputils-tracepath
RUN updatedb
RUN apt-get install -y git colordiff colortail unzip vim tmux xterm zsh curl telnet strace ltrace tmate less build-essential wget python3-setuptools python3-pip tor proxychains proxychains4 zstd net-tools bash-completion iputils-tracepath nodejs npm yarnpkg

# Oh-my-git!
RUN git clone https://github.com/arialdomartini/oh-my-git.git ~/.oh-my-git && \
echo source ~/.oh-my-git/prompt.sh >> /etc/profile

# secLists!
RUN git clone https://github.com/danielmiessler/SecLists /usr/share/seclists

# nodejs, npm and yarn
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - ; apt-get install -y nodejs npm yarnpkg
# w3af
RUN git clone https://github.com/andresriancho/w3af.git /opt/w3af && \
apt-get install -y libssl-dev libxml2-dev libxslt1-dev zlib1g-dev python-dev python-pybloomfiltermmap ; \
/opt/w3af/w3af_console ; \
bash /tmp/w3af_dependency_install.sh ; \
echo 'export PATH=/opt/w3af:$PATH' >> /etc/profile

# ngrok
RUN curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | gunzip - > /usr/bin/ngrok
RUN chmod +x /usr/bin/ngrok
RUN curl https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip | gunzip - > /usr/bin/ngrok && \
chmod +x /usr/bin/ngrok

# code-server
RUN mkdir -p /opt/code-server && \
curl -Ls https://api.github.com/repos/codercom/code-server/releases/latest | grep "browser_download_url.*linux" | cut -d ":" -f 2,3 | tr -d \" | xargs curl -Ls | tar xz -C /opt/code-server --strip 1 && \
echo 'export PATH=/opt/code-server:$PATH' >> /etc/profile

# virtualenv config
RUN pip install virtualenvwrapper
RUN echo 'export WORKON_HOME=$HOME/.virtualenvs' >> /etc/profile
RUN echo 'export PROJECT_HOME=$HOME/projects' >> /etc/profile && mkdir /root/projects
RUN echo 'export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh' >> /etc/profile
RUN bash /usr/local/bin/virtualenvwrapper.sh
RUN echo 'source /usr/local/bin/virtualenvwrapper.sh' >> /etc/profile
RUN pip install virtualenvwrapper && \
echo 'export WORKON_HOME=$HOME/.virtualenvs' >> /etc/profile && \
echo 'export PROJECT_HOME=$HOME/projects' >> /etc/profile && mkdir /root/projects && \
echo 'export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh' >> /etc/profile && \
bash /usr/local/bin/virtualenvwrapper.sh && \
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> /etc/profile

# Tor refresh every 5 requests
RUN echo MaxCircuitDirtiness 10 >> /etc/tor/torrc
# Tor start at init
RUN update-rc.d tor enable
RUN echo MaxCircuitDirtiness 10 >> /etc/tor/torrc && \
update-rc.d tor enable

# Use random proxy chains / round_robin_chain for pc4
RUN sed -i 's/^strict_chain/#strict_chain/g;s/^#random_chain/random_chain/g' /etc/proxychains.conf
RUN sed -i 's/^strict_chain/#strict_chain/g;s/^round_robin_chain/round_robin_chain/g' /etc/proxychains4.conf
RUN sed -i 's/^strict_chain/#strict_chain/g;s/^#random_chain/random_chain/g' /etc/proxychains.conf && \
sed -i 's/^strict_chain/#strict_chain/g;s/^round_robin_chain/round_robin_chain/g' /etc/proxychains4.conf

# Update DB and clean'up!
RUN updatedb && \
apt-get autoremove -y && \
apt-get clean

# Welcome message
RUN echo "echo 'Kali full container!\n\n- If you need proxychains over Tor just activate tor service with:\n$ service tor start\n'" >> /etc/profile
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Be patient, this will install all Kali tools (just for the first install, at ima
- configured to provide a new IP every 10 seconds
- configurable via `MaxCircuitDirtiness` at `/etc/tor/torrc`
- [SecLists](https://github.com/danielmiessler/SecLists) at `/usr/share/seclists`
- w3af (dropped out of Kali repos)
- [code-server](https://github.com/codercom/code-server)
- a VSCode served at `tcp/8443` (http://localhost:8443)
- [ngrok](http://ngrok.com)
- python virtualenvs via `virtualenvwrapper`
- projects placed at /`root/projects`
Expand All @@ -31,6 +34,7 @@ Be patient, this will install all Kali tools (just for the first install, at ima
- python3-setuptools python3-pip
- bash-completion
- oh-my-git integration
- nodejs, npm and yarn


## Usage
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ services:
- NET_ADMIN
stdin_open: true
tty: true
ports:
- "8443:8443"
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

docker-compose run --rm kali
docker-compose run --rm --service-ports kali

0 comments on commit 9fe40ba

Please # to comment.