MACROMEDIA COLDFUSION 5 - CFML Bedienungsanleitung

Stöbern Sie online oder laden Sie Bedienungsanleitung nach Bücher MACROMEDIA COLDFUSION 5 - CFML herunter. ColdFusion for Penetration Testers [en] Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken

Inhaltsverzeichnis

Seite 1 - ColdFusion for Pentesters

ColdFusion for Pentesters Chris Gates Carnal0wnage Lares Consulting

Seite 2 - • Chris Gates (CG)

• inurl:/index.cfm Finding Sites Running ColdFusion

Seite 3 - • Defense?

• CFM Shells • Sky’s the limit! • Pretty much anything you can code in Java, CF will run for you • ColdFusion 9 and above support cfscript == javascri

Seite 4 - Why This Talk?

• http://www.petefreitag.com/ lots of defense/CF hardening info • http://www.bennadel.com/blog/ • http://www.raymondcamden.com/ http://12robots.com/

Seite 5 - What Is ColdFusion?

Questions? @carnal0wnage cgates [] laresconsulting[] com Chris Gates

Seite 6 - Who Uses ColdFusion?

• Who doesn’t love Google Dorks… • filetype:cfm "cfapplication name" password • inurl:login.cfm • intitle:"Error Occurred" "

Seite 7

• inurl:/CFIDE/componentutils/ Finding Sites Running ColdFusion

Seite 8

• inurl:/CFIDE/componentutils/ (Find misconfigured servers) Finding Sites Running ColdFusion

Seite 9

• http://www.gotcfm.com/thelist.cfm Finding Sites Running ColdFusion

Seite 10 - • inurl:/index.cfm

• Delicious  Finding Sites Running ColdFusion

Seite 11 - • inurl:login.cfm

• ColdFusion 5 ColdFusion Hit list

Seite 12

• ColdFusion 6 ColdFusion Hit list

Seite 13

• ColdFusion 7 ColdFusion Hit list

Seite 14

• ColdFusion 8 ColdFusion Hit list

Seite 15 - • Delicious 

• Chris Gates (CG) – Twitter carnal0wnage – Blog carnal0wnage.attackresearch.com – Job Partner/Principal Security Consultant at Lares – Affiliation

Seite 16 - ColdFusion Hit list

• ColdFusion 9 ColdFusion Hit list

Seite 17

• ColdFusion 10 ColdFusion Hit list

Seite 18

• Metasploit Module to find ColdFusion URLs ColdFusion Scanner

Seite 19

• Metasploit Module to find ColdFusion URLs ColdFusion Scanner

Seite 20

• http://www.cvedetails.com/version-list/53/8739/1/Adobe-Coldfusion.html Attacking ColdFusion

Seite 21

• Common Vulnerabilities – Information Disclosure – XSS – SQL Injection – Admin Interfaces Exposed (more later) Attacking ColdFusion

Seite 22 - ColdFusion Scanner

• Information Disclosure • Need to determine standard vs Enterprise ColdFusion? * • Just request a .jsp page – Standard versions don’t do JSP and will

Seite 23

• Enterprise Attacking ColdFusion

Seite 24 - Attacking ColdFusion

• Standard Attacking ColdFusion

Seite 25 - • Common Vulnerabilities

• Information Disclosure Attacking ColdFusion

Seite 26 - • Information Disclosure

• What is ColdFusion • Who uses ColdFusion • Finding sites running ColdFusion • Attacking ColdFusion – Common vulnerabilities – Insta-Shell – Gotta wo

Seite 27 - • Enterprise

Attacking ColdFusion

Seite 28 - • Standard

Attacking ColdFusion

Seite 29

Attacking ColdFusion

Seite 30

Attacking ColdFusion

Seite 31

• XSS • Generally XSS is boring, but wait until we talk about cookies…. • ColdFusion has scriptProtect helps strip out <script> tags • The black

Seite 32

• XSS Attacking ColdFusion

Seite 33

• XSS Attacking ColdFusion

Seite 34 - <script> tags

• SQL Injection • If you see =somenumber go after it <cfquery name="getContent" dataSource="myDataSource"> select title fro

Seite 35

• SQL Injection • http://site.com/links/apply.cfm?id=(@@version) Attacking ColdFusion

Seite 36

• Insta-Shell • BlazeDS/AMF External XML Entity Injection (CVE-2009-3960) • File Upload Vulnerability in CF8 FCKeditor (APSB09-09) • ‘locale’ Path Tra

Seite 37 - </cfquery>

• Kept running into ColdFusion on pentests • Last “pentester” talk on ColdFusion was 2006 at EUSec – http://eusecwest.com/esw06/esw06-davis.pdf • Chr

Seite 38

• Patching – ColdFusion requires manual patching, unzip in folder, overwrite a jar, etc – Admin interface doesn’t alert you to available patches – I’

Seite 39 - • Insta-Shell

• Pro Tip • Determining version is helpful for insta-shell exploits • Metasploit module can tell you by admin interface, or you can just look at CFIDE

Seite 40 - • Patching

• Or you can check the wsdl  • /CFIDE/adminapi/base.cfc?wsdl – Checked on 7-9 Attacking ColdFusion

Seite 41 - • Pro Tip

Attacking ColdFusion

Seite 42 - – Checked on 7-9

Attacking ColdFusion

Seite 43

• BlazeDS/AMF External XML Entity Injection – Advisory pdf: http://www.security-assessment.com/files/advisories/2010-02-22_Multiple_Adobe_Products-XM

Seite 44

• BlazeDS/AMF External XML Entity Injection • http://www.security-assessment.com/files/advisories/2010-02-22_Multiple_Adobe_Products-XML_Extern

Seite 45

Attacking ColdFusion • BlazeDS/AMF External XML Entity Injection

Seite 46

Attacking ColdFusion • FCKeditor (apsb09-09) • ColdFusion 8.01 enabled the ColdFusion FCKeditor connector && FCKeditor vulns == unauth fileupl

Seite 47

Attacking ColdFusion • (related) FCKeditor (CVE 2009-2265) input sanitization issues • FCKeditor prior to 2.6.4.1 • Can also check version with a GET

Seite 48

• CFML = ColdFusion Markup Language • ColdFusion = Adobe’s product that handles CFML page/libs – Runs on Windows, Solaris, HP/UX and Linux – Apache,

Seite 49

Attacking ColdFusion • “Locale” Directory Traversal • Full walkthru here: • http://www.gnucitizen.org/blog/coldfusion-directory-traversal-

Seite 50

Attacking ColdFusion • http://www.gnucitizen.org/blog/coldfusion-directory-traversal-faq-cve-2010-2861/ • TL;DR – You can pass the hash • Mod

Seite 51

Attacking ColdFusion • “Locale” Directory Traversal • Vulnerable Versions: • ColdFusion MX6 6.1 base patches ColdFusion MX7 7,0,0,91690 base patches

Seite 52

Attacking ColdFusion • “Locale” Directory Traversal • ColdFusion 7 is always vuln, no patch

Seite 53

Attacking ColdFusion • Yeah, CF 8 too (has patch)

Seite 54

Attacking ColdFusion • Problem with traversal exploit, is you need to know full path. • Manageable on Windows… • Can be anywhere on *nix – Cue path di

Seite 55

Attacking ColdFusion • Componentutils (Component cfcexplorer) • Documentation for functions, includes full paths 

Seite 56

• Gotta work for it… • Brute Force RDS Access (If Enabled) – Check if RDS is enabled  – Brute force RDS • Brute Force Admin Interfaces – Main login p

Seite 57 - • Gotta work for it…

• RDS = Remote Development Services • “In ColdFusion Studio/Builder/Eclipse, you can connect to and work with the files on any server that has ColdFus

Seite 58

• RDS Attacking ColdFusion

Seite 59

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/coldfusion/pdfs/cf-evangelist-kit.pdf Who Uses ColdFusion?

Seite 60

• RDS Attacking ColdFusion

Seite 61

• RDS Attacking ColdFusion

Seite 62 - • Admin Interfaces

• Admin Interfaces • Prior to CF8 only password auth, CF 8 introduces usernames • Easy to tell if just “admin” or other usernames Attacking ColdFusion

Seite 63

Attacking ColdFusion

Seite 64

Attacking ColdFusion

Seite 65

• Admin Interfaces • /CFIDE/administrator/index.cfm salts the password Attacking ColdFusion

Seite 66

• Lots of other pages don’t  • Ex. /CFIDE/componentutils/login.cfm Attacking ColdFusion

Seite 67

• Get the password right, CF sets a cookie Attacking ColdFusion

Seite 68 - • Metasploit Module

• Metasploit Module • Can do this easily in Burp Suite as well Attacking ColdFusion

Seite 70 - • Other Stuff

http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/coldfusion/pdfs/cf-evangelist-kit.pdf Who Uses ColdFusion?

Seite 71

• Other Stuff • Solr • Interacting with CFC’s • Cookies Attacking ColdFusion

Seite 72

• Solr APSB10-04 (Information Disclosure) – “Vulnerability in Solr could allow access to collections created by the Solr Service to be accessed from

Seite 73 - • Interacting with CFC’s

• Solr APSB10-04 (Information Disclosure) Attacking ColdFusion

Seite 74

• Interacting with CFC’s http://example.com/foo.cfc?method=mymethod&arga=val1&argb=val2 • This URL will invoke method mymethod on an anonymous

Seite 75 - • Base64Decodes to:

• Cookies • Normally that XSS pop up with the session cookie is pretty lame. • “Supposed” to have a limited lifespan. • BUT cfadmin cookie and cfutils

Seite 76

• Example Admin Cookie: CFAUTHORIZATION_cfadmin=YWRtaW4NRTM4QUQyMTQ5NDNEQUFEMUQ2NEMxMDJGQUVDMjlERTRBRkU5REEzRA1jZmFkbWlu • Base64Decodes to: – admin –

Seite 78 - • OMGWTFBBQ!!!

• To Recap… • Got the cfadmin cookie • No randomness at all in the cookie • SSL not enabled by default on admin interface • Cookie base64 decodes to t

Seite 79 - • But real world?

• CFAUTHORIZATION_componentutils=cGFzc3dvcmQxDXBhc3N3b3JkMQ1jb21wb25lbnR1dGlscw== • Base64Decodes to: – password1 – password1 – componentutils • OMGW

Seite 80

• But real world? Attacking ColdFusion

Seite 81

Who Uses ColdFusion? http://www.bricecheddarn.com/blog/post.cfm/universities-love-using-coldfusion

Seite 82

• But real world? Attacking ColdFusion

Seite 83

• From 2009 to 2012… Attacking ColdFusion

Seite 84 - Post Exploitation

• ColdFusion Privilege Level • Scheduling tasks • Executing code • Decrypting database credentials • CFM Shells Post Exploitation

Seite 85

• ColdFusion (by default) runs as SYSTEM on Windows and NOBODY ON *nix • Obviously, CF on Windows is what you want • Sites that run other languages t

Seite 86

• Scheduling Tasks • Once you have access to admin interface you can schedule a task to download code/executables/ bat files/etc Post Exploitation

Seite 87

Post Exploitation

Seite 88

• Executing code • Once you have code/exe on box you can create a system probe (that we want to fail) to make the code execute • Or if you put cfm/jsp

Seite 89

Post Exploitation

Seite 90

Post Exploitation

Seite 92

http://www.getmura.com/index.cfm/overview/who-uses-mura/ Who Uses ColdFusion [MURA CMS]?

Seite 93 - • View Source, get value

• Decrypting database credentials • http://hexale.blogspot.com/2008/07/how-to-decrypt-coldfusion-datasource.html Post Exploitation

Seite 94

• Go to DataSource Selection Post Exploitation

Seite 95

• Click on DataSource (ex TEST) Post Exploitation

Seite 96 - • CFM Shells

• View Source, get value Post Exploitation

Seite 97

• Decrypt it $ python coldfusiondecrypt.py maJsuHYMay8zpmptC2yibA== Coldfusion v7 y v8 DataSource password decryptor (c) 2008 Hernan Ochoa (hernan@gm

Seite 98

• If you have file system access, just grab the XML files • Coldfusion 7: \lib\neo-query.xml for example: c:\CFusionMX7\lib\neo-query.xml • Coldfusi

Seite 99

• CFM Shells • ColdFusion has several handy CFML tags: – CFEXECUTE – CFREGISTRY – CFFILE – CFHTTP Simple CFM Shell: <html> <body> <cfe

Seite 100

• CFM Shells • Its common to disable CFEXECUTE* • CF also runs java so: <cfset runtime = createObject("java", "java.lang.System"

Seite 102 - Questions?

• CFM Shells • Remember Enterprise vs Standard? – Enterprise runs jsp, so some jsp shells will work too (depends on the shell’s java version requireme

Kommentare zu diesen Handbüchern

Keine Kommentare