Book Image

Kali Linux Intrusion and Exploitation Cookbook

By : Dhruv Shah, Ishan Girdhar
Book Image

Kali Linux Intrusion and Exploitation Cookbook

By: Dhruv Shah, Ishan Girdhar

Overview of this book

With the increasing threats of breaches and attacks on critical infrastructure, system administrators and architects can use Kali Linux 2.0 to ensure their infrastructure is secure by finding out known vulnerabilities and safeguarding their infrastructure against unknown vulnerabilities. This practical cookbook-style guide contains chapters carefully structured in three phases – information gathering, vulnerability assessment, and penetration testing for the web, and wired and wireless networks. It's an ideal reference guide if you’re looking for a solution to a specific problem or learning how to use a tool. We provide hands-on examples of powerful tools/scripts designed for exploitation. In the final section, we cover various tools you can use during testing, and we help you create in-depth reports to impress management. We provide system engineers with steps to reproduce issues and fix them.
Table of Contents (18 chapters)
Title Page
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Installing Docker on Kali Linux


In this recipe, we will be to and setting-up on Kali Linux.

Getting ready

To step through this recipe, you will need a running Kali Linux in Oracle Virtualbox or VMware, and an Internet connection. No other prerequisites are required.

How to do it...

For this recipe, you need to perform the following steps:

  1. At the time of writing this book, Kali Linux 2.0 Rolling is based on Debian Wheezy and therefore these steps will only work for Debian Wheezy based Kali Linux. In future, if Kali is updated, then kindly check the latest steps to install Docker from the Docker documentation.
  2. In your terminal window open /etc/apt/sources.list.d/backports.list in your favorite editor. If the file doesn't exist, create it.
  3. Remove any existing entries and add an entry for backports on Debian wheezy:
      deb http://http.debian.net/debian wheezy-backports main
  1. Update the package information and ensure that APT works with the HTTPS method, and that CA certificates are installed:
      $ apt-get update
      $ apt-get install apt-transport-https ca-certificates
  1. Add the GPG key:
      $ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80  
      --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  1. Open /etc/apt/sources.list.d/docker.list in your favorite editor. If the file doesn't exist, create it.
  2. Remove any existing entries and add an entry for backports on Debian wheezy:
      $ deb https://apt.dockerproject.org/repo debian-wheezy main
  1. Update the package information and verify that APT is pulling from the right repository:
      $ apt-get update && apt-cache policy docker-engine
  1. Install Docker:
      $ apt-get install docker-engine
  1. Start the Docker daemon:
      $ service docker start
  1. Verify that Docker is installed properly:
      $ docker run hello-world

Since, you're already logged in as root in your Kali Linux installation, you don't need to use sudo. But it is important to note that the docker daemon always runs as the root user and the docker daemon binds to a Unix socket instead of a TCP port. By default, that Unix socket is owned by the user root, and so, you will need to use the preceding commands with sudo, if you are not logged in as root.

How it works...

In this recipe, we have added the docker source list so that we can fetch the Docker updates every time we use the apt-get update command on our system. Then, update the apt-get sources and install the prerequisites required for installing Docker. We added the GPG key to ensure that whatever updates we are installing are valid official unchanged packages. After all this basic configuration, we ran a basic apt-cache to ensure APT is fetching the docker-engine from the right repository. Finally, we installed docker-engine using apt-get.