Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
AWS Penetration Testing

You're reading from   AWS Penetration Testing Beginner's guide to hacking AWS with tools such as Kali Linux, Metasploit, and Nmap

Arrow left icon
Product type Paperback
Published in Dec 2020
Publisher Packt
ISBN-13 9781839216923
Length 330 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jonathan Helmus Jonathan Helmus
Author Profile Icon Jonathan Helmus
Jonathan Helmus
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Setting Up AWS and Pentesting Environments
2. Chapter 1: Building Your AWS Environment FREE CHAPTER 3. Chapter 2: Pentesting and Ethical Hacking 4. Section 2: Pentesting the Cloud – Exploiting AWS
5. Chapter 3: Exploring Pentesting and AWS 6. Chapter 4: Exploiting S3 Buckets 7. Chapter 5: Understanding Vulnerable RDS Services 8. Chapter 6: Setting Up and Pentesting AWS Aurora RDS 9. Chapter 7: Assessing and Pentesting Lambda Services 10. Chapter 8: Assessing AWS API Gateway 11. Chapter 9: Real-Life Pentesting with Metasploit and More! 12. Section 3: Lessons Learned – Report Writing, Staying within Scope, and Continued Learning
13. Chapter 10: Pentesting Best Practices 14. Chapter 11: Staying Out of Trouble 15. Chapter 12: Other Projects with AWS 16. Other Books You May Enjoy

The AWS Command Line Interface (CLI)

The AWS CLI is a great command-line tool that allows you to interface with AWS technology such as S3 buckets, interacting with EC2 instances and others. We will start to see actual use cases of implementing the AWS CLI in more depth in Chapter 4, Exploiting S3 Buckets. The AWS CLI is a great way to learn and get comfortable with using a terminal-like interface because it allows you to interact with everything in your AWS environment. For pentesting, it's always good to be comfortable with using a command line and/or a terminal because you never know when a GUI just won't do the trick. Imagine being in the middle of a penetration test and your tool interface freezes, or the frontend of an application throws an error and ceases to work. This is where understanding the command line proves to be beneficial.

Installing the AWS CLI

Now we will need to move forward and install the AWS CLI on our Kali Linux machine. This will be the command line we will use throughout this book to interact with our AWS environment:

  1. To begin, let's check and see if the AWS CLI is already installed on our machines:
    $ aws --version
  2. If you have an old version, you should see what version you have. If you haven't used it in a while, it's best to go ahead and reinstall it:
    $ apt-get remove awscli -y
    $ apt-get install awscli -y
  3. Double-check to ensure that your command-line interface successfully installed by running the --version switch again.

Now your host is set up to interact with resources in AWS and cover the material in this book. Feel free to play around and get comfortable with the command-line interface. It's something that you'll need to get used to as you go through this book and interact with AWS in the real world.

Exploring basic AWS CLI commands

Now we will look at some basic AWS CLI commands, now that there is a general understanding of what the AWS CLI is and how it works. The following shows a few commands that you'll see throughout this book. These commands are meant to interact with various services, such as S3, EC2, and Lambda.

Once you've configured your AWS CLI, use the following command to get a list of commands:

$ aws help

The following command is useful to describe the attributes of an EC2 server:

$ aws ec2 describe instance

The next command will list out the buckets in an S3 environment:

$ aws s3 ls s3://

The last command we will mention is used to list out functions with Lambda:

$ aws lambda list-functions –-region <<region>>

As you can see, there are quite a few services that you can interact with via the AWS CLI. You'll become more and more familiar with interacting with these services as we continue to go through more exercises in this book. Now that we have discussed the last topic in this chapter, let's wrap up and recap!

You have been reading a chapter from
AWS Penetration Testing
Published in: Dec 2020
Publisher: Packt
ISBN-13: 9781839216923
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image