Git Product home page Git Product logo

kali-ec2-lab's Introduction

Lab: Kali linux on EC2

This lab shows how to setup Kali Linux on an AWS EC2 instance and connect to it via RDP.

Warning

Before going through this lab or doing any penetration testing in AWS, make sure you read the AWS Customer Support Policy for Penetration Testing.

Remember to clean up the created resources from your AWS account after this lab.

Pre-requisites

  • AWS CLI installed and configured with proper credentials.

  • An RDP client installed.

  • A subscription to the Kali Linux official AWS AMI on the AWS Marketplace (search for "Kali Linux").

  • Go to the product subscription page in the AWS Marketplace and find the AMI ID. Save it for later.

Steps

  1. copy the example instance configuration:

    cp instance.example.json instance.json
  2. edit the instance.json file to add the property:

  • ImageId: the Kali AMI ID (from Pre-requisites)
  • also remove the DryRun property
  1. set environment variables for the scripts:

    export SECURITY_GROUP_ALLOWED_CIDR="$(curl --silent checkip.amazonaws.com)/32" 
    export SECURITY_GROUP_NAME="kali-lab"
    export SECURITY_GROUP_DESCRIPTION="Allow SSH and RDP traffic"
    export KEY_NAME="kali"
  2. create a security group:

    ./create-security-group
  3. create a key pair:

    ./create-key-pair
  4. create an EC2 instance:

    ./create-instance
  5. find the instance ip:

    export INSTANCE_IP=$(./get-instance-ip)
  6. connect to the instance via SSH:

    ./kali-ssh "${INSTANCE_IP}"
  7. install a kali metapackage to get some tools:

    sudo apt install --yes kali-linux-headless
  8. run the commands listed in rdp-setup.md

  9. connect via RDP client through the public ip with the username and password created in the previous step

Next Steps

Set up some vulnerable infrastructure to test against !

Check out, for example, AWSGoat.

Clean Up

Go to the AWS console and delete the resources created during the lab:

  • EC2 instance
  • SSH key pair
  • Security group

Author

Andre Silva - @andreswebs

License

This project is licensed under the Unlicense.

References

https://aws.amazon.com/security/penetration-testing/

https://www.kali.org/

https://remmina.org/

https://docs.aws.amazon.com/cli/latest/

https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html

https://serverfault.com/questions/981763/how-do-i-set-user-data-when-using-the-aws-cli-cli-input-json-argument

https://www.onemarcfifty.com/blog/video/How-to-build-Kali-Linux-from-Debian/

https://www.kali.org/docs/cloud/aws/

https://www.kali.org/docs/general-use/xfce-with-rdp/

https://github.com/ine-labs/AWSGoat

kali-ec2-lab's People

Contributors

andreswebs avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.