Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Step by step AWS Cloud Hacking
Search
andresriancho
September 25, 2020
Technology
640
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Step by step AWS Cloud Hacking
andresriancho
September 25, 2020
More Decks by andresriancho
See All by andresriancho
Step by step AWS Cloud Hacking
andresriancho
2
3k
Internet-Scale analysis of AWS Cognito Security
andresriancho
1
13k
Threat Modelling
andresriancho
0
1.6k
Automated Security Analysis AWS Clouds
andresriancho
1
3.4k
Injecting into URLs / Breaking URL-Encoding
andresriancho
0
280
Galería de Fallos en Unicornios
andresriancho
1
270
Esoteric Web Application Vulnerabilities
andresriancho
0
1.2k
String Compare Timing Attacks
andresriancho
0
670
Timing Attacks
andresriancho
1
440
Other Decks in Technology
See All in Technology
Kiro Crew で始める マルチエージェント開発
miu_crescent
PRO
0
180
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
GopherCon @シアトル に行ってきました
logica0419
0
290
「面白い!」を信じ抜け。激動の時代を貫く、オンリーワン・エンジニアの条件
kizawa2020
0
250
AI時代のデータ基盤を考える問い
pacocat
0
680
AWSとGitHub Actionsの責任境界と 組織で安全に使用する取り組み
nealle
0
160
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
Introduction to Bill One Development Engineer
sansan33
PRO
0
470
AI時代のアウトプット――変わったこと、変わらないこと / Devsumi 2026 Kansai #devsumi
jnchito
0
580
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
110
[ホンマでっか SRE] あなたはなぜ SRE に?
_awache
0
260
EMの役割で 変わったこと・変わらなかったこと
sansantech
PRO
0
130
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
520
Designing for humans not robots
tammielis
254
26k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
ラッコキーワード サービス紹介資料
rakko
1
4.5M
My Coaching Mixtape
mlcsv
0
280
Skip the Path - Find Your Career Trail
mkilby
1
190
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
The SEO Collaboration Effect
kristinabergwall1
1
530
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
740
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.5k
Transcript
Ekoparty 2020 Andrés Riancho
2
3
None
5
need credentials • • • 6
7
IAM permissions 8
9 http://169.254.169.254/ /latest/meta-data/iam/security-credentials/ /latest/meta-data/iam/security-credentials/{role-name}
10
11 from urllib.request import urlopen from flask import request @app.route('/ssrf')
def handler(): url = request.args.get('url') return urlopen(url).read()
Instance metadata and S3 compromise
13
None
two ways to enumerate permissions IAM service In most cases
this will fail brute-force 15
Get* / List* / Describe* DryRun parameter 16
17 SUPPORTED_SERVICES = [ 'ec2', 's3' ]
18
./enumerate-iam.py
20
many things the attacker doesn't know. 21 { "Statement":[ {
"Effect":"Allow", "Action":[ "s3:*", "lambda:*", "..." ], "Resource":"*" } ] }
try to elevate privileges to a principal with full access
22 { "Statement":[ { "Effect":"Allow", "Action":[ "*", ], "Resource": "*" } ] }
Lambda function will have access to the IAM role 23
Getting * on *
None
existing trust policy in the AdminRole 26
27
28 { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::925877178748:root" }, "Action":
"sts:AssumeRole" } { "Effect": "Allow", "Principal": { "AWS": ["arn:aws:iam::925877178748:root", "arn:aws:iam::320222540496:root"] }, "Action": "sts:AssumeRole" }
Never trust the trust policy
30 ARN for the backdoored role
None
32 most resources in the AWS account VPC is completely
isolated from the Internet
None
34 VPN between the attacker's workstation and a VPC
35
vpc-vpn-pivot
None
From zero to full pwn
None
40 • enumerate-iam • pacu • vpc-vpn-pivot Follow @AndresRiancho
None