Skip to content

Instantly share code, notes, and snippets.

@brisbanewebdeveloper
Created April 16, 2018 06:45
Show Gist options
  • Save brisbanewebdeveloper/9911208b807eaf0d16fb84ef88902940 to your computer and use it in GitHub Desktop.
Save brisbanewebdeveloper/9911208b807eaf0d16fb84ef88902940 to your computer and use it in GitHub Desktop.
Docker with Kali Linux
# https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes
# https://docs.docker.com/compose/compose-file/
#
# [ How to delete Dangling Images (which are layers that have no relationship to any tagged images) ]
# docker rmi $(docker images -f dangling=true -q)
#
# [How to login the container]
# docker run -t -i kali_kali /bin/bash
#
# [About Metasploit]
# https://www.offensive-security.com/metasploit-unleashed/msfconsole-commands/
# https://null-byte.wonderhowto.com/how-to/hack-like-pro-metasploit-for-aspiring-hacker-part-12-web-delivery-for-linux-mac-0168734/
#
# msfconsole
# use xxx
# show options
# info
# set target X
# exploit
#
version: "3"
services:
kali:
build:
context: .
dockerfile: kali.dockerfile
restart: always
#
# Nothing to mention here so far.
#
FROM kalilinux/kali-linux-docker
# Avoid seeing error message from "debconf" command
ENV DEBIAN_FRONTEND noninteractive
# Utilities
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get update \
&& apt-get install -y \
aptitude \
sudo \
less \
vim \
ssh \
rsync \
net-tools \
zip \
unzip \
wget \
curl \
moreutils \
dnsutils \
metasploit-framework \
&& rm -rf /var/lib/apt/lists/*
RUN wget \
-O - \
'https://gist.github.com/djaiss/4033452/archive/0865bcfee319953a0f74838677d69884b456605c.zip' \
> /root/500-worst-passwords.zip
RUN unzip -o -d /root/tmp /root/500-worst-passwords.zip
RUN mv /root/tmp/*/gistfile1.txt /root/500-worst-passwords.txt
RUN rm -fr /root/tmp/*
# Cron
RUN apt-get update \
&& apt-get install -y cron \
&& rm -rf /var/lib/apt/lists/*
# Bash
RUN echo "alias rm='rm -i'" >> /root/.bashrc
RUN echo "alias cp='cp -i'" >> /root/.bashrc
RUN echo "alias mv='mv -i'" >> /root/.bashrc
RUN echo "alias ls='ls -vaF'" >> /root/.bashrc
# Not working
#RUN echo "msfconsole" >> /root/.bash_login
# Vim
RUN echo "set expandtab" >> /root/.vimrc
RUN echo "set tabstop=4" >> /root/.vimrc
#RUN echo "set shiftwidth=4" >> /root/.vimrc
RUN echo "set number" >> /root/.vimrc
#!/bin/bash
docker run -t -i kali_kali /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment