Skip to content

Commit

Permalink
feat: build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 15, 2020
1 parent 59665d3 commit e9485be
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 24 deletions.
36 changes: 25 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
FROM kalilinux/kali-rolling:latest
LABEL maintainer="Artis3n"
LABEL maintainer="Artis3n <dev@artis3nal.com>"

ENV TERM=xterm

RUN apt-get update \
&& apt-get install -y --no-install-recommends systemd seclists \
python3 python3-pip python3-wheel python3-setuptools \
git curl less vim metasploit-framework nmap ssh-client \
manpages file zip john hydra lsof exploitdb awscli sqlmap \
&& apt-get install -y --no-install-recommends amass awscli curl \
exploitdb file git hydra john less lsof man-db \
metasploit-framework nmap python3 python3-pip python3-setuptools \
python3-wheel ssh-client sslyze sqlmap systemd vim zip \
# autorecon dependencies
samba gobuster nikto whatweb onesixtyone oscanner enum4linux smbclient \
proxychains4 smbmap smtp-user-enum snmpcheck sslscan tnscmd10g \
enum4linux gobuster nikto onesixtyone oscanner proxychains4 samba \
smbclient smbmap smtp-user-enum snmpcheck sslscan tnscmd10g whatweb \
# Has to run after systemd is installed
# Needed for msfdb init
&& apt-get install -y --no-install-recommends systemctl \
# Slim down container size
# Slim down layer size
&& apt-get autoremove -y \
&& apt-get autoclean -y \
# Remove apt-get cache from the layer to reduce container size
&& rm -rf /var/lib/apt/lists/*

RUN service postgresql start && msfdb init

# Install and configure AutoRecon
RUN mkdir /tools \
# Install and configure AutoRecon
&& git clone --depth 1 https://github.com/Tib3rius/AutoRecon.git /tools/AutoRecon \
&& cd /tools/AutoRecon && pip3 install -r requirements.txt \
&& cd /tools/AutoRecon \
&& pip3 install -r requirements.txt \
&& ln -s /tools/AutoRecon/autorecon.py /usr/local/bin/autorecon

RUN service postgresql start && msfdb init
# Install Seclists
RUN mkdir -p /usr/share/seclists \
# This clone takes a million years.
# The apt-get install seclists command doesn't work from the Dockerfile, however.
&& git clone --depth 1 https://github.com/danielmiessler/SecLists.git /usr/share/seclists

# Prepare rockyou wordlist
RUN mkdir -p /usr/share/wordlists \
&& cp /usr/share/seclists/Passwords/Leaked-Databases/rockyou.txt.tar.gz /usr/share/wordlists/ \
&& cd /usr/share/wordlists \
&& tar -xzf rockyou.txt.tar.gz

# Need to start postgresql any time the container comes up
# systemctl enable postgresql doesn't seem to take effect
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/make

.PHONY: install
install:
if [ ! -f /usr/local/bin/dive ]; then wget https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.deb && sudo apt install ./dive_0.9.2_linux_amd64.deb && rm dive*.deb; else echo "Dive installed, taking no action"; fi;

.PHONY: size
size:
dive build --no-cache -t test/kali .
56 changes: 43 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@ A kalilinux/kali-rolling container with extra juice.
[![GitHub followers](https://img.shields.io/github/followers/artis3n?style=social)](https://github.com/artis3n/)
[![Twitter Follow](https://img.shields.io/twitter/follow/artis3n?style=social)](https://twitter.com/Artis3n)

The [kalilinux/kali-rolling](https://www.kali.org/docs/containers/official-kalilinux-docker-images/) container comes with few pre-installed services. It is meant to be lightweight and clocks in around 118 MB. This container is around 1.9 GB. It installs and pre-configures a number of frequently uses Kali tools. It is meant to allow you to get up and running with a Kali environment on an ephemeral host. Don't spend time configuring and tweaking - pull, run, execute, pwn.

A premium is placed on keeping this image as small as is reasonable given its intended purpose. For example, `searchploit` is installed in this image but `searchsploit -u` is not run to install exploitdb-papers because this increases the image size to 7.9 GB - a 6GB increase. Efficiency of the build image is checked with [dive](https://github.com/wagoodman/dive):
The [kalilinux/kali-rolling](https://www.kali.org/docs/containers/official-kalilinux-docker-images/) container comes with no pre-installed services.
It is meant to be lightweight and clocks in around 118 MB.
This container, uncompressed, is around 3.5 GB.
It installs and pre-configures a number of frequently uses Kali tools.
It is meant to allow you to quickly get up and running with a Kali environment on an ephemeral host.
Don't spend time configuring and tweaking - pull, run, execute, pwn.

A premium is placed on keeping this image as small as is reasonable given its intended purpose.
For example, `searchploit` is installed in this image but `searchsploit -u` is not run to install exploitdb-papers because this increases the image size by 6GB increase.
However, `seclists` is installed even though it increases the build image by 1.6 GB because those wordlist files are commonly used.
Efficiency of the build image is checked with [dive](https://github.com/wagoodman/dive):

![Dive image efficiency](resources/dive-efficiency.png)

<small>Last checked: 2020-03-05</small>
<small>Last checked: 2020-03-15</small>

The container is not meant for a persistent attacker environment.
The intention is for a quick environment to run attacks and document the results outside of the container.
The container does not mount a volume for persistent storage - although, like any container, storage inside the container will remain until you `docker rm`.

## Usage

Expand All @@ -37,7 +49,7 @@ Run the container:
```bash
docker run --name kali -it --rm artis3n/kali:latest
# Or detach the container and run commands through it
docker run --name kali -id --rm artis3n/kali:latest
docker run --name kali -id artis3n/kali:latest
docker exec -t kali nmap -p- 127.0.0.1
```

Expand All @@ -53,18 +65,29 @@ docker exec -it kali /bin/bash

![Docker TTY](/resources/docker-tty.png)

Remove the backgrounded container:
Stop the backgrounded container, turn it back on whenever you need to run a command:

```bash
docker stop kali
docker start kali
```

![Docker Stop](resources/docker-stop.png)
Kill the backgrounded container:

```bash
docker stop kali && docker rm kali
```

Alias a command to your container, run commands through the container from your terminal:

```bash
alias kali="docker exec -t kali"
kali searchsploit tomcat
```

## Configured tools

- Metasploit / Meterpreter
- PostgreSQL 12
- Amass
- [AutoRecon](https://github.com/Tib3rius/AutoRecon)
- curl
- enum4linux
Expand All @@ -83,14 +106,21 @@ docker stop kali
- tnscmd10g
- whatweb
- wkhtmltoimage
- Hydra
- JohnTheRipper (jumbo)
- Metasploit / Meterpreter
- PostgreSQL 12
- Proxychains4 ([proxychains-ng](https://github.com/rofl0r/proxychains-ng))
- Rockyou wordlist (/usr/share/wordlists/rockyou.txt)
- Searchsploit ([ExploitDB](https://www.exploit-db.com/searchsploit))
- JohnTheRipper (jumbo)
- Seclists wordlist (/usr/share/seclists)
- SSLyze
- SQLMap
- Hydra

## Contributions

Missing a tool you would like pre-configured? File a ticket and I will add it. A pull request is also welcome.
Missing a tool you would like pre-configured? File a ticket and I will add it.
A pull request is also welcome.

For any new tools, you must add validation tests to `.github/workflows/ci.yml`. Use the existing tests as a baseline. These tests ensure the tools are installed and pre-configured correctly.
For any new tools, you must add validation tests to `.github/workflows/ci.yml`. Use the existing tests as a baseline.
These tests ensure the tools are installed and pre-configured correctly.
Binary file modified resources/dive-efficiency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/docker-exec-autorecon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/docker-exec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/docker-stop.png
Binary file not shown.
Binary file modified resources/docker-tty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e9485be

Please sign in to comment.