Skip to content

A simple terraform exploit lab with vulnerable container from Vulhub + Kali Linux

Notifications You must be signed in to change notification settings

nericksen/terraform-exploit-lab-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terraform Exploit Lab Example

This repository serves as a basic example for creating a simple containerized exploit lab in AWS. It deploys a vulnerable docker image from vulhub along with a Kali Linux container.

This is for educational purposes only! Be safe and be nice!

Pre-Requisites

  • Install Terraform onto your machine
  • Install AWS CLI
  • Generate SSH key

Configure AWS Provider

You will need to install the AWS CLI onto the machine

Generate SSH key ssh-keygen -f ~/.ssh/id_rsa_terraform

Create keys and secrets in AWS.

Usage

Clone the repository with git clone https://github.com/nericksen/terraform-exploit-lab-example.git. Change directories into the newly cloned repository and run terraform init. Review the main.tf file. Note there are no security groups assigned to this image in order to keep it simple. It uses the default settings for a region. The default security group could therefore be modified to allow for a single IP access over ssh, or more secure setup would be to setup a private subnet with access via VPN or AWS SSM agent or similar.

Run terraform plan to see the proposed infrastructure changes. Run terraform apply to create the infrastructure.

Post Deployment

Note you may want to install all the default Kali linux metapackages. You can do so with apt update && apt -y install kali-linux-headless once inside the Kali container. The containers can be inspected with sudo docker ps -a. The Kali shell can be accessed with sudo docker exec -it <container_id> /bin/bash.

You may also want some vulnerability scanning capabilites in nmap.

cd /usr/share/nmap/scripts/
git clone https://github.com/vulnersCom/nmap-vulners.git

nmap --script nmap-vulners/ -sV 172.17.0.1

Study up while it updates and get ready to hack!

About

A simple terraform exploit lab with vulnerable container from Vulhub + Kali Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published