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
Conferences
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

Attacking vulnerabilities

Attacking vulnerabilities is one of the more interesting aspects of cybersecurity. It's one thing to discover and patch an issue that you may have discovered, but actually getting to attack it takes your skills to another level! Attacking vulnerabilities is what sets penetration testing apart from other security careers. While most security positions only discover and remediate, pentesting attacks and exploits discovered issues. Doing so sheds light on how real a system's security posture may or may not be. One of the more popular tools you will hear about is called Metasploit.

Exploring Metasploit

A popular tool in the pentesting community is a framework known as Metasploit Framework. Also known as Metasploit, the automated software comes preinstalled on Kali Linux with exploits and payloads that can be configured and launched at vulnerable hosts. It also comes with exploits applicable to all flavors of operating systems, and payloads of various types. The exploits are known as modules and created in Ruby.

One of the more common exploits is the exploit/multi/handler. The multi handler works as a listener that looks for incoming connections on ports from specific services. For example, a web-based exploit may use a more common service such as HTTPS, which runs on port 443. The listener can be set up to listen on port 443 and establish a connection once the web exploit is executed. We will look at more ways to use Metasploit in Chapter 9, Real-Life Pentesting with Metasploit and More!.

We need to learn to walk before we can run, so now let's take a look at getting Metasploit set up on our Kali Linux host. The next portion is going to give you an exercise to get Metasploit up and running.

For this exercise, we are simply going to connect to the Kali Linux host and update Metasploit. New exploits are constantly getting uploaded to Metasploit, so it is important that you update often:

  1. Here's how we are going to update Metasploit. Connect to your Kali instance you set up earlier in the chapter by using the PuTTY methods from before. Review the section to connect if you need to. Once connected, you'll want to switch over to the root user. The root user is going to give you privileges to read, write, and execute anything on the machine. To switch to root, type the command sudo su.
  2. Now that you are the root user, let's update Metasploit to the current version. We want to ensure that Metasploit is updated with the most recent exploits and modules for testing. To update the tool, type the following command:
    $ apt install metasploit-framework

    The screenshot illustrates the command being executed in our Kali Linux terminal:

    Figure 1.26 – Installing Metasploit

    Figure 1.26 – Installing Metasploit

  3. Once connected, you'll be able to start Metasploit with a fresh new database full of exploits. In previous years, you would have had to start up a database in the background before launching Metasploit. However, now, the following command will start Metasploit with a database running in the background:
    $ msfdb run

Feel free to get comfortable with Metasploit. There are copious amounts of resources to learn all things about the popular pentesting tool. We will be using the tool quite a bit throughout this book, so don't worry if you don't want to rummage around the internet and books for more information.

In this section, we learned quite a bit about what exactly a vulnerable service is and how it can be set up. We also included a brief introduction to what it means to attack these vulnerabilities and learned a little bit about Metasploit – a very popular tool in the pentesting community.

Next, we are going to learn about the AWS Command Line Interface and how we can install it and use it.

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