From the course: Python: Pen Testing AWS
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Listing all EC2 instances - Python Tutorial
From the course: Python: Pen Testing AWS
Listing all EC2 instances
- [Instructor] It's useful to be able to get a quick reference list of all our EC2 instances. We can get a summary through AWS's config service, but let's see what we can do with the EC2 service in Python. To support this scripting, I've deployed the CloudGoat Code Build Secret Scenario and saved the credentials as scenario3. The method we'll be focusing on is the describe-instances. And we can see the format of this if we call it using the Command Line Interface. We'll use our scenario3 profile to do this. AWS EC2 describe-instances, and we'll put the profile as scenario3, and I'll set the region as us-east-1. Okay, so here we get the details of our reservations and instances in that region. In this case, we have the keyname, cg-ec2-key-pair and it's a t2.micro. I won't examine this output in detail, but if you're not familiar with EC2 JSON structures, you might want to pause here and spend a bit of time looking at it.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Taking a first look at the Python boto3 AWS library3m 19s
-
(Locked)
Enumerating policies2m 4s
-
(Locked)
Adding sessions to your Python scripts2m 6s
-
(Locked)
Checking for guards2m 38s
-
(Locked)
Managing IAM programmatically2m 44s
-
(Locked)
Creating users programmatically2m 28s
-
(Locked)
Managing secrets using Python3m 42s
-
(Locked)
Listing all EC2 instances7m 6s
-
(Locked)
Listing all RDS instances3m 36s
-
(Locked)
Challenge1m 15s
-
(Locked)
Solution42s
-
(Locked)
-
-
-