AWS - Lightsail Privesc
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
For more information about Lightsail check:
AWS - Lightsail EnumIt’s important to note that Lightsail doesn’t use IAM roles belonging to the user but to an AWS managed account, so you can’t abuse this service to privesc. However, sensitive data such as code, API keys and database info could be found in this service.
lightsail:DownloadDefaultKeyPair
This permission will allow you to get the SSH keys to access the instances:
Potential Impact: Find sensitive info inside the instances.
lightsail:GetInstanceAccessDetails
This permission will allow you to generate SSH keys to access the instances:
Potential Impact: Find sensitive info inside the instances.
lightsail:CreateBucketAccessKey
This permission will allow you to get a key to access the bucket:
Potential Impact: Find sensitive info inside the bucket.
lightsail:GetRelationalDatabaseMasterUserPassword
This permission will allow you to get the credentials to access the database:
Potential Impact: Find sensitive info inside the database.
lightsail:UpdateRelationalDatabase
This permission will allow you to change the password to access the database:
If the database isn't public, you could also make it public with this permissions with
Potential Impact: Find sensitive info inside the database.
lightsail:OpenInstancePublicPorts
This permission allow to open ports to the Internet
Potential Impact: Access sensitive ports.
lightsail:PutInstancePublicPorts
This permission allow to open ports to the Internet. Note taht the call will close any port opened not specified on it.
Potential Impact: Access sensitive ports.
lightsail:SetResourceAccessForBucket
This permissions allows to give an instances access to a bucket without any extra credentials
Potential Impact: Potential new access to buckets with sensitive information.
lightsail:UpdateBucket
With this permission an attacker could grant his own AWS account read access over buckets or even make the buckets public to everyone:
Potential Impact: Potential new access to buckets with sensitive information.
lightsail:UpdateContainerService
With this permissions an attacker could grant access to private ECRs from the containers service
Potential Impact: Get sensitive information from private ECR
lightsail:CreateDomainEntry
An attacker with this permission could create subdomain and point it to his own IP address (subdomain takeover), or craft a SPF record that allows him so spoof emails from the domain, or even set the main domain his own IP address.
Potential Impact: Takeover a domain
lightsail:UpdateDomainEntry
An attacker with this permission could create subdomain and point it to his own IP address (subdomain takeover), or craft a SPF record that allows him so spoof emails from the domain, or even set the main domain his own IP address.
Potential Impact: Takeover a domain
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)