In this activity, I will explore cloud security auditing and a penetration tool. Here are the topics that I will cover:
- ScouteSuite - an open-source auditing tool for multi-cloud architecture, including AWS, Azure, GCP, Alibaba Cloud, Oracle Cloud Infrastructure, Kubernetes cluster and Digital Ocean
- Pacu is an open-source penetration testing and exploitation framework used to exploit configuration flaws of an AWS account.
- Prowler is also an open-source cloud security tool that helps organizations audit their cloud environments, securing them based on the recommendations.
Activity 1: ScouteSuite Activity
Now I'll start with the ScoutSuite activity
Download ScoutSuite from the GitHub repository at github.com/nccgroup/ScoutSuite. Clone the repository using
git clone github.com/nccgroup/ScoutSuite.
Run it on a system that has Python installed using the command python3 scout.py. Review the instructions presented to you to configure and run ScoutSuite against the cloud provider of your choice.
- Go to Scoutsuite directory
cd /Scoutesuite - Install the requirements
pip3 install -r requirements.txt

- Go to Scoutsuite directory
I tried to run
python scout.pybut I encountered error as I have not configured AWS credentials in my local machine.
- To configure AWS credential, you need an AWS account. Take note that it will ask you credit card number and your email.
After creating you AWS accoumt, go to Identity and Access Management (IAM) to create a user.

Created a user named grace_zabala

Set the default permission, then click Next.

Here is the summary of the created user.

User created successfully!

After that, under Access Management, click Users. Then go to Security Credentials and create an access key.

Select CLI as you will need it to access your AWS from Kali.

Your access key and Secret access key are now created. Take note of these credentials, you will configure those in your Kali to access your AWS account.

Now execute
aws configureto set your AWS credentials in your Kali linux machine.
- You should now be able to run scout.py


7. Summary of report – Warning for the IAM (Identity and Access Management) role.

8. Below are the warnings:

The most pressing vulnerabilities that I found were that the Password Length is too short, the Password expiration is Disabled, and the Password policy allows the reuse of passwords. As we learned how easily the password can be cracked with the use of dictionary attacks, we must use longer passwords, allow expiration of passwords and enforce not to reuse passwords.
To address them,
Go to IAM service of AWS

In the IAM dashboard, select account settings. And then in the Password Policy section, click the Password Policy button.

- Ensure the "Require minimum password length" option is checked.
- Set the minimum password length to a more secure value, such as 12 or more characters. Check
Other settings in the image(red box), then save the changes.

Activity 2: Explore the Exploits Available with Pacu
Pacu is an open-source penetration testing and exploitation framework used to exploit configuration flaws of an AWS account. Take note that you need to obtain the necessary permissions before conducting a penetration test against an AWS account.
Clone the git to your machine using git clone
https:// github.com/RhinoSecurityLabs/pacu
Follow https://github.com/RhinoSecurityLabs/pacu/wiki/Installation for installation steps. Please see the images below for demonstration:
- First, set your keys in
~/.aws/credentials. The creation of keys in AWS is included in the ScoutSuite activity instructions.

- Install the dependencies. The instructions are in https://github.com/RhinoSecurityLabs/pacu/wiki/Installation
- Go first in the pacu folder: cd /pacu
- Then do pip install -U pacu

- Install the python module requirements:
pip install -r requirements.txt

- First, set your keys in
After that, execute
./cli.py. This will prompt you to create pacu session. I previously created a session named pacu-grace-session. Please see below
After creating and logging in to your PACU session, import the keys you set in ~/.aws/credentials. I named the imported keys as default(please see image).

Now that I have set up the pacu session and credentials, next I will do penetration testing.
There are many options to enumerate or do a reconnaissance attack when you list all available commands using
ls.
I did penetration testing on the account I created
grace_zabala. I tried to create an IAM policy with limited permissions
I named the policy as pacu-example-limited-Policy.

I then attached the policy to grace_zabala.

Policy successfully attached to grace_zabala

Run the privilege escalation in pacu `run iam_privesc_scan`and it successfully created an inline policy with access to all resources.

I was able to do a privilege escalation. As you see in the above and below images, an inline policy "wifbqv6ok1!" was created by the attacker using the
iam_privilege_scanof PACU, and it has administrator permission. There was also a note saying "Privilege escalation was successful".
As checked in the AWS console, this policy has access to all resources.

As checked in the KALI, this policy has access to all resources. It also enumerated some portion of the AccessKeyID and SecretAccessKey.

Checking that it has 15012 confirmed permissions

In this activity, we learned that we must be cautious in configuring IAM policy. The policy below was customized, and we over-assigned roles, which are iam: Get* and iam: Put*.
"Action": [
"iam:Get*",
"iam:List*",
"iam:Put*",
"iam:SimulateCustomPolicy",
"iam:SimulatePrincipalPolicy"
]Hence, when we did a privilege escalation in the AWS user account using PACU, an inline policy was created, and the attack was successful.
The iam__privesc_scan in PACU was powerful. It is used to do privilege escalation and gain access to AWS resources. Once an attacker gains access to your account, they will do further exploitation/lateral movement.
Activity 3: Scan an AWS account with Prowler
Prowler is an open-source cloud security tool that helps organizations audit their cloud environments, securing them based on the recommendations.
Let's start the activity
Clone the GitHub repository
https://github.com/prowler-cloud/prowler.git.
- Open the README.md file and follow the steps to configure and install it.
After cloning the repository, go to the prowler folder. Install poetry by using
pip install poetry. Based on the code, it's using poetry dependency management and a packaging tool. This is typically used in Python for managing virtual environments.
Install all package dependencies written in poetry.lock using
poetry install.
Execute
poetry shellto activate the virtual environment.
Run
python3 prowler.py.
Analyze the findings from Prowler report.
Here is the report finding:


Open the HTML file in Kali's web browser.

To remediate MFA vulnerability:

I deleted the IAM user and policy afterwards to clean up my AWS resources.
No Comments