Configuring Aws CLI for security testing!

Fazal
3 min readJul 18, 2022

Hello fellas it’s been long since I blogged. I have been working on some personal building and giving my time to do bug bounty now I gonna explain to you the thing which I suffered a lot for a long period not knowing how to set up and ended up giving card and learning an easy way after that.

Yes, setting up AWS CLI is the biggest thing I suffered a lot for not knowing how to set up for cloud testing keep on researching here’s the easy way to set up!

How to install AWS CLI?

How to install AWS CLI on Windows:

To install on Windows, download one of the appropriate installers:

AWS CLI MSI Installer for Windows 64-bit
AWS CLI MSI Installer for Windows 32-bit

Follow the prompts on the installer to complete the installation.
As an alternative, run this installer batch script in an Administrator command prompt to download and run the installer.

How to install AWS CLI on Linux/Unix/MacOS:

It installs as a python package. So, you will need to install some pre-requisites, in the following order.

  1. Install Python (skip this step, if python is already installed). Python Version 2.6.5 or later is required.
  2. Install pip (skip this step, if pip is already installed)

You can download and install pip using following commands:

curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py –user

3. Install AWS CLI using pip

With python and pip installed, you can install AWS CLI using the following command:

pip install awscli --upgrade --user

Once AWS CLI is installed, you need to configure it. The configuration enables the CLI to authenticate with AWS as a user with a fixed set of permissions.

If you are trying to use the CLI on your machine or AWS EC2 instance, then you can follow the below instructions:

First, you will need a pair of Access Key ID and Secret Access Key. If you don’t already have one, you will need to generate it by going to profile->Security credentials and select the users in the left-hand side taskbar and click create access key (see the screenshot below).

You will only be able to view the secret access key on the console while creating, and then you won’t be able to view it again anytime in the future. So, make sure you write it down and save it somewhere.

Once you have the keys, then run the command “aws configure” on the command line, and enter the keys as shown below. Region and Output format values are optional and can be left blank.

I have already configured mine and it show’s like this just fill it up. With this setup done, you can now access/query the AWS resources from your command line.

Print a list of all buckets in your AWS account:

aws s3 ls s3://bucket_name

Sync all the files from your s3 bucket to the local path:

aws s3 sync s3://bucket_name .

To copy a file to a bucket:

aws s3 cp test.txt s3://bucket_name

To move a file to a bucket:

aws s3 mv test.txt s3://bucket_name

I guess I covered the major Topics, Sorry for the grammar mistakes I made in this blog hope you like it.

Cheers…….!

--

--

Fazal

Security Analyst | Bug Hunter | google VRP researcher | Developer